介绍

什么是Biopython?

Biopython是计算分子生物学的免费Python(https://www.example.com)模块的集合。www.python.org Python是一种面向对象、解释性、灵活的语言,广泛用于科学计算。Python很容易学习,语法非常清晰,并且可以轻松地使用用C、C++或PSO编写的模块进行扩展。自2000年成立以来 [Chapman2000], Biopython由全球大量志愿者不断开发和维护。

Biopython网站(www.biopython.org)为基于Python的软件的开发人员提供了模块、脚本和网络链接的在线资源,用于生物信息学使用和研究。Biopython包括各种生物信息学文件格式的解析器(AMPS、Custalw、FASTA、Genbank等..),访问在线服务(NCBI、Expasy等),标准序列类、序列比对和基序分析工具、集群算法、结构生物学模块和线粒体遗传学分析模块。

我可以在Biopython包中找到什么

主要的Biopython版本具有许多功能,包括:

  • 能够将生物信息学文件解析为Python可利用的数据结构,包括对以下格式的支持:

    • Blast输出-来自独立和WWW Blast

    • Clustalw

    • FASTA

    • GenBank

    • PubMed和Medline

    • ExPasy文件,例如Enzene和Prosite

    • SCOP,包括“dom”和“lin”文件

    • UniGene

    • SwissProt

  • 受支持格式的文件可以逐记录迭代,或者通过Dictionary界面进行索引和访问。

  • 处理流行的在线生物信息学目的地的代码,例如:

    • NCBI - Blast、Deliverz和PubMed服务

    • ExPASy - Swiss-Prot和Prosite条目,以及Prosite搜索

  • 常见生物信息学程序的接口,例如:

    • NCBI的独立爆炸

    • 克鲁斯塔洛对齐计划

    • CLASS命令行工具

  • 一个标准序列类,处理序列、序列上的id和序列特征。

  • 用于对序列执行常见操作的工具,例如翻译、转录和权重计算。

  • 使用k个最近邻机、朴素Bayes或支持向量机执行数据分类的代码。

  • 用于处理对齐的代码,包括创建和处理替代矩阵的标准方法。

  • 代码可以轻松将可并行任务拆分为单独的流程。

  • 基于图形界面的程序,用于执行基本序列操作、翻译、BLASTing等。

  • 有关使用模块的大量文档和帮助,包括此文件、在线维基文档、网站和邮件列表。

  • 与BioSQL集成,BioSQL是一种序列数据库模式,也受到BioPerl和BioJava项目的支持。

我们希望这能给你足够的理由下载并开始使用Biopython!

安装Biopython

Biopython的所有安装信息都与此文档分开,以便更容易保持更新。

简短的版本是使用 pip install biopython, see the main README 文件以获取其他选项。

常见问题(常见问题解答)

  1. How do I cite Biopython in a scientific publication?
    请引用我们的申请说明 [Cock2009] 作为Biopython的主要参考。此外,如果合适,请引用以下列表中的任何出版物,特别是作为Biopython中特定模块的参考(更多信息可在我们的网站上找到):
    • 官方项目公告:Chapman和Chang,2000 [Chapman2000];

    • Bio.PDB :Hamelryck和Manderick,2003 [Hamelryck2003A];

    • Bio.Cluster :德勋 et al. ,2004年 [DeHoon2004];

    • Bio.Graphics.GenomeDiagram :普里查德 et al. ,2006年 [Pritchard2006];

    • Bio.PhyloBio.Phylo.PAML :塔列维奇 et al. 2012 [Talevich2012];

    • 对于Biopython、BioPerl、BioRuby、BioJava和CLARSS中支持的FASTQ文件格式:Cock et al. ,2010年 [Cock2010].

  2. How should I capitalize “Biopython”? Is “BioPython” OK?
    正确的大写字母是“Biopython”,而不是“BioPython”(尽管这会匹配BioPerl、BioJava和BioRuby)。
  3. How is the Biopython software licensed?
    Biopython分布在 Biopython License Agreement .然而,自Biopython 1.69发布以来,某些文件根据您选择的 Biopython License AgreementBSD 3-Clause License .这是为了以后在这种双重许可方式下提供所有Biopython。
  4. What is the Biopython logo and how is it licensed?
    截至2017年7月Biopython 1.70发布,Biopython徽标是一条黄色和蓝色的蛇,在小字“biopython”一词上方形成双螺旋。它由Patrick Kunzmann设计,该徽标通过您选择的双重授权 Biopython License AgreementBSD 3-Clause License .
    新标志
    在此之前,Biopython标志是两条黄蛇,围绕“BIOPYTHON”一词形成双螺旋,由Henrik Vestergaard和Thomas Hamelryck于2003年设计,作为公开竞赛的一部分。
    旧标志
  5. Do you have a change-log listing what’s new in each release?
    看到文件 NEWS.rst included with the source code (originally called just NEWS), or read the latest NEWS file on GitHub .
  6. What is going wrong with my print commands?
    自Biopython 1.77起,我们仅支持Python 3,因此本教程使用Python 3风格打印 function .
  7. How do I find out what version of Biopython I have installed?
    使用这个:
    >>> import Bio
    >>> print(Bio.__version__)
    

    如果““导入Bio”行失败,则不会安装Biopython。请注意,版本之前和之后这些都是双强调线。如果第二行失败,您的版本是 very 过时了

    如果版本字符串以“' 1.66+''”这样的加结尾,则您没有官方发布版本,而是开发中代码的旧快照 after 该版本已发布。这个命名一直使用到2016年6月Biopython 1.68准备阶段。

    如果版本字符串以“&#39;.dev &#39;”结尾<number>,例如“&#39; 1.68.dev 0 &#39;”,那么您也没有官方发布版本,而是开发中代码的快照 before 该版本已发布。

  8. Where is the latest version of this document?
    如果您下载Biopython源代码存档,它将包含HTML和PDF格式的相关版本。本文档的最新发布版本(每次发布时更新)已在线:
  9. What is wrong with my sequence comparisons?
    Biopython 1.65发生了重大变化,使 SeqMutableSeq 类(和子类)使用简单的基于字符串的比较,您可以显式地使用该比较 str(seq1) == str(seq2) .

    Biopython的旧版本将使用基于实例的比较 Seq 您可以显式处理的对象 id(seq1) == id(seq2) .

    如果您仍然需要支持旧版本的Biopython,请使用这些显式形式来避免问题。见章节  比较Seq对象 .

  10. What file formats do Bio.SeqIO and Bio.AlignIO read and write?
    检查内置文档字符串 (from Bio import SeqIO 那么 help(SeqIO) ),或访问维基上的http://biopython.org/wiki/SeqIO和http://biopython.org/wiki/AlignIO以获取最新列表。
  11. Why won’t the Bio.SeqIO and Bio.AlignIO functions parse, read and write take filenames? They insist on handles!
    您需要Biopython 1.54或更高版本,或者只是显式使用手柄(请参阅第节  把手到底是什么? ).尤其重要的是要记住在写入数据后显式关闭输出柄。
  12. Why won’t the Bio.SeqIO.write() and Bio.AlignIO.write() functions accept a single record or alignment? They insist on a list or iterator!
    您需要Biopython 1.54或更高版本,或者只需将物品包装起来 [...] 创建一个元素的列表。
  13. Why doesn’t str(...) give me the full sequence of a Seq object?
    您需要Biopython 1.45或更高版本。
  14. Why doesn’t Bio.Blast work with the latest plain text NCBI blast output?
    NCBI不断调整来自RST工具的纯文本输出,让我们的解析器保持最新状态是一项持续的斗争。如果您没有使用最新版本的Biopython,您可以尝试升级。然而,我们(和NCBI)建议您使用可供计算机程序读取的HTML输出。
  15. Why has my script using Bio.Entrez.efetch() stopped working?
    这可能是由于NCBI在2012年2月推出了EFetch 2.0。首先,他们更改了默认返回模式-您可能想添加 retmode="text" 接到您的电话。其次,他们现在对如何提供ID列表更加严格- Biopython 1.59以后会自动将列表转换为逗号分隔的字符串。
  16. Why doesn’t Bio.Blast.NCBIWWW.qblast() give the same results as the NCBI BLAST website?
    您需要指定相同的选项-NCBI经常调整网站上的默认设置,并且它们不再匹配QBST默认设置。检查差距处罚和期望阈值等内容。
  17. Why can’t I add SeqRecord objects together?
    您需要Biopython 1.53或更高版本。
  18. Why doesn’t Bio.SeqIO.index_db() work? The module imports fine but there is no ``index_db`` function!
    您需要Biopython 1.57或更高版本(以及支持SQLite3的Python)。
  19. Where is the MultipleSeqAlignment object? The Bio.Align module imports fine but this class isn’t there!
    您需要Biopython 1.54或更高版本。或者,老年人 Bio.Align.Generic.Alignment 类支持其部分功能,但现在不鼓励使用它。
  20. Why can’t I run command line tools directly from the application wrappers?
    您需要Biopython 1.55或更高版本,但这些在Biopython 1.78中已被弃用。考虑使用Python subprocess 模块直接。
  21. I looked in a directory for code, but I couldn’t find the code that does something. Where’s it hidden?
    需要知道的一件事是我们将代码放入 __init__.py 文件.如果您不习惯在此文件中查找代码,这可能会令人困惑。我们这样做的原因是为了使用户更容易导入。例如,不必执行“重复”导入, from Bio.GenBank import GenBank ,你可以直接使用 from Bio import GenBank .
  22. Why doesn’t Bio.Fasta work?
    我们反对 Bio.Fasta module in Biopython 1.51 (August 2009) and removed it in Biopython 1.55 (August 2010). There is a brief example showing how to convert old code to use Bio.SeqIO instead in the DEPRECATED.rst 文件.

对于更一般的问题,Python常见问题页面https://docs.python.org/3/faq/index.html可能会很有用。