当前位置: 首页 > 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.mmbaike.com/news/108522.html

相关文章:

  • .net搭建企业网站怎么让自己上百度
  • 网站做导航设计的作用是什么意思百度站长工具怎么关闭教程视频
  • 企业做网页还是网站百度移动端点赞排名软件
  • php网站开发web实例百度指数功能模块
  • 关于建设网站的报告书搜索引擎广告形式有哪些
  • 邯郸做移动网站价格seo模拟点击软件源码
  • 车陂手机网站开发seo搜索引擎优化主要做什么
  • cms网站管理系统设计网站排行
  • 专门做10s视频的网站百度官网首页网址
  • 做一百度网站seo软文是什么
  • seo排行榜年度10佳网站线上推广有哪些
  • 大数据营销模式优化大师在哪里
  • 快速提高网站权重提升策划方案网站
  • 做设计需要素材的常用网站宁波关键词网站排名
  • 怎样在建设厅网站查询安全员证企业网站管理
  • 百度推广要企业自己做网站吗百度电话客服24小时
  • 四会市城乡规划建设局网站网店买卖有哪些平台
  • 成都网站建设 全美一键生成网页
  • 工程信息网站排名电脑培训学校哪家好
  • 中国2020年哪里大建设优化好搜移动端关键词快速排名
  • 武汉公司网站开发软件推广平台
  • 企业建设网站的需求分析中国最大的企业培训公司
  • 武汉哪家做网站公司好风云榜
  • 衡水做阿里巴巴网站网推资源渠道
  • 自己做网站练手什么是关键词推广
  • 旅游网站建设导航栏关键词查询工具有哪些
  • WordPress设置用户访问个数网站的seo优化报告
  • 网站开发与设计实训报告总结官网制作公司
  • 宁波做企业网站公司长沙网络营销顾问
  • 重庆电商平台网站建设推广自己产品的文案