for rec in SeqIO.parse("CP002701.embl","embl"): if rec.features: for feature in rec.features: if feature.type == "CDS": print(feature.location) print(feature.qualifIErs["protein_ID"]) print(feature.location.extract(rec).seq)
是我想改变的部分,但不知道如何更改.location以选择我感兴趣的额外4个基数.
解决方法 @ user7550844(OP)于2017年2月12日15:46写道:在mofoniusrex on reddit的一些帮助下,这是一个有效的解决方案:
for rec in SeqIO.parse("CP002701.embl","embl"):if rec.features: for feature in rec.features: if feature.type == "CDS": pad=2 newloc = SeqFeature.FeatureLocation( feature.location.start - pad,feature.location.end + pad) newfeature=SeqFeature.SeqFeature(location=newloc,type=feature.type,strand=feature.strand,ref=feature.ref,ref_db=feature.ref_db) newfeature.qualifIErs = feature.qualifIErs print(newfeature.qualifIErs) print(newfeature.location) print(newfeature.location.extract(rec).seq)总结
以上是内存溢出为你收集整理的python-3.x – Biopython在基因的任一侧记录额外的2个核苷酸,用于2个-2个阅读框全部内容,希望文章能够帮你解决python-3.x – Biopython在基因的任一侧记录额外的2个核苷酸,用于2个-2个阅读框所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)