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

网站服务器架设中美俄最新军事新闻

网站服务器架设,中美俄最新军事新闻,网站做电商销售需要注册吗,国外photoshop素材网站template_hits(Sequence[TemplateHit]数据格式)来自结构数据库搜索结果 python运行hhsearch二进制命令的包装器类 映射索引计算#xff1a;TemplateHit 中含有 indices_query#xff0c;需要换算成在原始query序列中的index#xff0c;hit 中indices_hit 需要减去最小index…template_hits(Sequence[TemplateHit]数据格式)来自结构数据库搜索结果 python运行hhsearch二进制命令的包装器类  映射索引计算TemplateHit 中含有 indices_query需要换算成在原始query序列中的indexhit 中indices_hit 需要减去最小index-1 gap 除外 import pickle import dataclasses from typing import Optional, List, Sequence, Mappingdataclasses.dataclass(frozenTrue) 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(fhhsearch_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(ffixed_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(ffixed_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_sequencestr格式 query_sequence with open(input_fasta_file) as f:for line in f.readlines():if line.startswith():continuequery_sequence line.strip()print(fhit.query:{hit.query}) print(fhit.hit_sequence:{hit.hit_sequence}) print(fhit.indices_hit:{hit.indices_hit}) print(fhit.indices_query:{hit.indices_query}) print(fquery_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.hkea.cn/news/14420746/

相关文章:

  • 中国建设银行注册网站体外产品的研发网站如何建设
  • 网站建设dede什么网站需要经营性备案
  • 企业建立网站的原因合肥网络推广公司乐蜂
  • 网站建设做网站好吗三明住房建设局网站
  • 简洁手机导航网站模板下载安装重大违法建设项目举报网站
  • 国产成年做视频网站wordpress文章怎么写
  • 网站建设优化服务信息招商外包公司
  • server2003网站建设福建高速公路建设指挥部网站
  • 网站做多个页面简述企业网站建设的目的
  • dede旅游网站源码中国建设工程信息网站
  • 做网站如何通过流量赚钱吗photoshop手机版
  • 冠县网站建设价格北京网络运营推广团队
  • 重庆企业网站开发服务五十一团 黑龙江生产建设兵团知青网站
  • 个人博客网站开发开发手机端网站模板
  • html做网站例子制作古城西安网页
  • 百度一对一解答长沙seo优化推广
  • 地图网站怎么做的中国互联网网站性能
  • 唐山网站建设怎么样wordpress大图模板
  • 易联网站制作设计制作公司网站
  • 人力资源网站怎么建设营销型网站的缺点
  • 网教网站源码网站做多久
  • 公司网站怎么做关键字wordpress 标签seo插件
  • 江苏平台网站建设价位成都市建设领域网站咨询电话
  • 北京 建公司网站要多少钱纸箱 东莞网站建设
  • 最漂亮网站电商网站开发平台一
  • 企业网站托管收费标准深信服对单一网站做限速
  • 专门做视频的网站有哪些不写代码门户网站建设
  • 现在还有没有做任务的网站wordpress 亲子主题
  • 河南网站推广夜间直播平台哪个好用
  • 网站关键词的分类搭建网站的六个基本步骤流程