为什么我不能比较SeqRecord(来自Biopython模块)?

2024-04-29 11:44:32 发布

您现在位置:Python中文网/ 问答频道 /正文

所以基本上我有一个序列列表,我从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)

Tags: thetonamein列表错误序列seqrecord