【发布时间】:2017-07-07 20:17:50
【问题描述】:
我正在使用 biopython 完成一个简单的任务:从一个特定的基因库填充中,提取一个基因 ID 和相关信息到一个表中。
当我试图比较来自不同SeqFeature 的Seq.SeqFeature.SeqFeature.location 时,它每次都会给我False。即使在以下情况下:
from Bio.SeqFeature import FeatureLocation
location1 = FeatureLocation(0,0,strand = 1)
location2 = FeatureLocation(0,0,strand = 1)
print(location1 == location2) # will print False
只有这样才能给我想要的结果:
print(location1.start == location2.start and location1.end == location2.end and location1.strand == location2.strand) # will print True.
问题就这样解决了,但我仍然在犹豫这是出于某种原因设计的还是尚未内置比较方法。
下面是我为什么来这个问题的过程:
- 首先我只从genbank文件中提取
feat.type == 'CDS'信息,发现 所有的假基因都丢失了。 -
然后我想出了这个想法,将信息记录在
feat.type == 'gene'然后查找'CDS'或'misc_feature'记录该基因的更多信息。这就需要确认
'CDS'或'misc_feature'在同一位置注释,以防有多个'misc_feature'注释同一基因的一些域。
【问题讨论】:
标签: biopython