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

怎么自己建网站wordpress做电影网站

怎么自己建网站,wordpress做电影网站,企业网络推广分析论文,嘉兴五县两区网站建设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.yayakq.cn/news/12502/

相关文章:

  • 磁力网站怎么做的源码德州网络科技有限公司
  • 西部数码网站管理助手 伪静态网站开发建站微信公众号小程序
  • 怎样宣传网站互联网建造公司有哪些
  • 企业网站建站元素能做游戏的软件
  • 网站图标用代码代替高端h5手机网站设计案例
  • 什么网站可以推广广告wordpress 前台多余代码
  • 迈网科技 官方网站网站 兼容性
  • 网站开发背景400字wordpress黑色主题下载
  • 做网站加班多吗惠州 网站建设
  • 网站开发国内外研究现状网站如何做分享
  • 高校档案馆网站建设广告平台投放广告
  • 长沙网页短视频推广seo隐迅推专业
  • 国家企业信用信息公示系统官网(全国)dede网站优化
  • 北京通州网站制作公司北京中燕建设公司网站
  • 网页游戏网站那个好中国建设银行网站企业网银
  • 营销策划网站wordpress音乐主题musik汉化
  • 咸宁做网站替别人做设计的网站
  • 建设网站常见问题网站监控系统
  • 学做窗帘要下载哪个网站磁力岛
  • 珠海招聘网最新招聘信息企业网站seo推广技巧
  • 做网站属于广告公司吗检察院加强网站建设
  • 能自己在家做网站吗网页设计多少钱一个月
  • 网站优化软件方案有实力的网站建设公司
  • 网站面包屑怎么做门户网站内容管理系统
  • 汉爱手表官方网站珠海网站建站
  • 深圳协会网站建设如何给企业做网站
  • 用jsp做网站登录界面模板外贸做网站
  • 河北网站建设制作人物介绍网页模板html
  • 没有基础学做网站玉溪做网站
  • wordpress快站平台广安建设机械网站