当前位置: 首页 > news >正文

个人网站排行在哪里打广告效果最好

个人网站排行,在哪里打广告效果最好,珠海网站建设联系方式,武汉设计工程学院校考成绩查询template_hits(Sequence[TemplateHit]数据格式)来自结构数据库搜索结果 python运行hhsearch二进制命令的包装器类 映射索引计算:TemplateHit 中含有 indices_query,需要换算成在原始query序列中的index,hit 中indices_hit 需要减去最小index…

template_hits(Sequence[TemplateHit]数据格式)来自结构数据库搜索结果 python运行hhsearch二进制命令的包装器类  映射索引计算:TemplateHit 中含有 indices_query,需要换算成在原始query序列中的index,hit 中indices_hit 需要减去最小index(-1 gap 除外)

import pickle 
import dataclasses
from typing import Optional, List, Sequence, Mapping@dataclasses.dataclass(frozen=True)
class TemplateHit:"""Class representing a template hit."""index: intname: straligned_cols: intsum_probs: Optional[float]query: strhit_sequence: strindices_query: List[int]indices_hit: List[int]### 读入Sequence[TemplateHit]数据
with open('test_pdb_hits.pkl', 'rb') as file:# 使用 pickle.load 从文件中加载对象test_pdb_hits = pickle.load(file)#test_pdb_hits.pkl由python运行hhsearch二进制命令的包装器类 的结果 template_hits 保存得到
#import pickle
#with open('test_pdb_hits.pkl', 'wb') as file:
#  pickle.dump(template_hits, file)def build_query_to_hit_index_mapping(hit_query_sequence: str,hit_sequence: str,indices_hit: Sequence[int],indices_query: Sequence[int],original_query_sequence: str) -> Mapping[int, int]:"""Gets mapping from indices in original query sequence to indices in the hit.hit_query_sequence and hit_sequence are two aligned sequences containing gapcharacters. hit_query_sequence contains only the part of the original querysequence that matched the hit. When interpreting the indices from the .hhr, weneed to correct for this to recover a mapping from original query sequence tothe hit sequence.Args:hit_query_sequence: The portion of the query sequence that is in the .hhrhithit_sequence: The portion of the hit sequence that is in the .hhrindices_hit: The indices for each aminoacid relative to the hit sequenceindices_query: The indices for each aminoacid relative to the original querysequenceoriginal_query_sequence: String describing the original query sequence.Returns:Dictionary with indices in the original query sequence as keys and indicesin the hit sequence as values."""# If the hit is empty (no aligned residues), return empty mappingif not hit_query_sequence:return {}# Remove gaps and find the offset of hit.query relative to original query.hhsearch_query_sequence = hit_query_sequence.replace('-', '')hit_sequence = hit_sequence.replace('-', '')hhsearch_query_offset = original_query_sequence.find(hhsearch_query_sequence)print(f"hhsearch_query_offset:{hhsearch_query_offset}")# Index of -1 used for gap characters. Subtract the min index ignoring gaps.min_idx = min(x for x in indices_hit if x > -1)fixed_indices_hit = [x - min_idx if x > -1 else -1 for x in indices_hit]print(f"fixed_indices_hit:{fixed_indices_hit}")min_idx = min(x for x in indices_query if x > -1)fixed_indices_query = [x - min_idx if x > -1 else -1 for x in indices_query]print(f"fixed_indices_query:{fixed_indices_query}")# Zip the corrected indices, ignore case where both seqs have gap characters.mapping = {}for q_i, q_t in zip(fixed_indices_query, fixed_indices_hit):if q_t != -1 and q_i != -1:if (q_t >= len(hit_sequence) orq_i + hhsearch_query_offset >= len(original_query_sequence)):continuemapping[q_i + hhsearch_query_offset] = q_treturn mappinghit = test_pdb_hits[0]
input_fasta_file = 'Q94K49.fasta'
## 从fasta文件提取 query_sequence(str格式)
query_sequence = ""
with open(input_fasta_file) as f:for line in f.readlines():if line.startswith(">"):continuequery_sequence += line.strip()print(f"hit.query:{hit.query}")
print(f"hit.hit_sequence:{hit.hit_sequence}")
print(f"hit.indices_hit:{hit.indices_hit}")
print(f"hit.indices_query:{hit.indices_query}")
print(f"query_sequence:{query_sequence}")##query和hit序列比对上的氨基酸在各自多肽链上索引的对应字典
mapping = build_query_to_hit_index_mapping(hit.query, hit.hit_sequence, hit.indices_hit, hit.indices_query,query_sequence)
print(mapping)

http://www.dinnco.com/news/31930.html

相关文章:

  • 软件工程师招聘简章河南seo
  • 硅塑胶 东莞网站建设加快实施创新驱动发展战略
  • 优化一下seo简单速排名软件
  • 做花瓶的网站百度一下首页百度
  • 全中文网站开发东莞网络排名优化
  • 东莞网站建设推广多少钱磁力天堂torrentkitty
  • 网站开发实训心得体会平台推广费用一般是多少
  • 电商平台商城系统搭建搜索引擎优化是指什么
  • 给公司做网站的公司整合营销传播策略
  • 攻击自己做的网站网络销售适合什么人做
  • 江苏建设教育网站百度快照推广有效果吗
  • 网站建设领导小组全国疫情排行榜最新情况列表
  • 做网站在手机端预览乱码了百度链接提交收录入口
  • 中国建设银行网上银行官方网站网站推广步骤
  • 微信020网站怎么建立什么是搜索引擎销售
  • 免费域名怎么做网站免费推广网站排名
  • 成都网站排名关键词包括哪些内容
  • 网站建设与管理方案书第三方网络营销平台有哪些
  • 自己建立网站后怎么做淘客搜索引擎优化自然排名的优点
  • 云南营销型网站建设长春做网站推广的公司
  • 网站建设怎样把网页连接起来合肥做网站哪家好
  • 县政府网站网建设方案知乎怎么申请关键词推广
  • 乔拓云微信小程序seo排名优化推广
  • 有路由器做网站账户竞价托管哪里好
  • 自己做产品品牌网站短视频平台推广方案
  • 网站建设需要的一些技术怎么在线上推广自己的产品
  • 网站域名禁止续费网络营销方法和手段
  • 做企业网站需要买什么站长工具使用方法
  • 纯静态网站 维护百度的客服电话是多少
  • app开发哪家公司比较专业优化设计答案六年级上册