python - 为什么我不能比较 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)
解决方案
推荐阅读
- swiftui - 如何在 SwiftUI 中获得水平 ScrollView 以在更新封闭的文本时自动滚动以结束
- linux - 在 ubuntu 中使用 sudo apt update 后如何获得干净的消息?
- xpath - 如何获得正确的 xpath
- reactjs - ReactRedux 嵌套 react-redux 组件:列表中的每个孩子都应该有一个唯一的“key”道具
- c++ - 带有 scons 的仅标头库
- firebase - Flutter Firebase 身份验证。更新管理员端用户信息
- python - 使用 prefetch_related 和聚合来避免 Django 数据库查询具有时间序列数据的模型的 n+1 问题
- c - 在 C 中逐行解析文件时出现问题
- php - 如何从条带预建结账中获取客户数据
- python - 尝试在 django 模型中使用文件中的函数