python - Bio.Alphabet _verify_alphabet 函数现在位于哪里?
问题描述
由于Bio.Alphabet
最近迁移Bio.Seq
,我想了解_verify_alphabet函数现在所在的位置。
我也可以完全重写该函数,但由于我只是在更新旧的 python 代码,我更愿意使用已经发布的东西。
谢谢您的支持
解决方案
恐怕Bio.Alphabet
没有迁移,它已被弃用,现在已在 Biopython 1.78 中完全删除。这是旧的源代码。_verify_alphabet
幸运的是,您可以轻松地模拟该功能:
def _verify_alphabet(sequence, alphabet):
alphabet = set(alphabet)
return all(letter in alphabet for letter in sequence)
print(_verify_alphabet("AATGC", "ATCG"))
print(_verify_alphabet("AATUC", "ATCG"))
推荐阅读
- java - Android Studio - 如何将数据从 MainActivity.xml 发送到服务?
- reactjs - Django/React 部署仅在我设置 DEBUG=True & STATICFILES_DIRS 而不是列表时才有效
- qt - 获取所选项目的 QML 模型
- sql - 如何在 RelNode 中实现 STRING_AGG?
- kubernetes - 无法使用 opa 网守在 kubernetes 上的特定命名空间 (prod) 中拒绝具有最新标签的 pod
- c# - aws s3 Transferutility.upload() 是否返回响应?
- html - 当宽度大于 1 时进度条改变颜色
- azure - 例外:断言在 ...,条件 '
' 没见过。这意味着什么? - c# - 如何确定表达式是否作为参数传递到将在服务器上评估扩展方法的位置
- android - 改造和房间模型互操作性