首页 > 解决方案 > 为什么我不能比较 SeqRecord(来自 Biopython 模块)?

问题描述

所以基本上我有一个从 SeqIO 解析的序列列表。我正在尝试按他们的名字过滤它们。因此,如果序列列表有重复项,则只取第一个。我遇到了以下错误:

“SeqRecord 比较是故意不实现的。明确比较感兴趣的属性。”

FilterDuplicates = []
FilteredNames = []

for i in Sequences:
    if i.name not in FilteredNames:
        #Append SeqRecord Object to list
        FilterDuplicates.append(i)
        #Append the name to the list of names
        FilteredNames.append(i.name)

标签: pythonbioinformaticsbiopython

解决方案


推荐阅读