{"id":1811,"library":"biopython","title":"Biopython","description":"Biopython is a comprehensive collection of freely available Python tools for computational molecular biology and bioinformatics. It provides functionality for common tasks such as parsing various bioinformatics file formats (e.g., FASTA, GenBank, BLAST), interacting with online biological databases (e.g., NCBI Entrez), working with sequences and alignments, and structural bioinformatics. Currently at version 1.87, it is actively maintained with several releases per year.","status":"active","version":"1.87","language":"en","source_language":"en","source_url":"https://github.com/biopython/biopython/","tags":["bioinformatics","biology","genomics","proteomics","sequence analysis","NGS","structural biology"],"install":[{"cmd":"pip install biopython","lang":"bash","label":"Install stable release"}],"dependencies":[{"reason":"Required for many numerical operations, especially in modules like Bio.PDB and Bio.Align.","package":"numpy","optional":false},{"reason":"Optional, used by Bio.Graphics for generating graphical outputs.","package":"reportlab","optional":true},{"reason":"Optional, used for various plotting functionalities.","package":"matplotlib","optional":true}],"imports":[{"note":"Core sequence object.","symbol":"Seq","correct":"from Bio.Seq import Seq"},{"note":"Module for reading and writing sequence file formats.","symbol":"SeqIO","correct":"from Bio import SeqIO"},{"note":"Module for sequence alignment functionality.","symbol":"Align","correct":"from Bio import Align"},{"note":"Module for working with protein structures.","symbol":"PDB","correct":"from Bio import PDB"},{"note":"Module for accessing NCBI's Entrez databases.","symbol":"Entrez","correct":"from Bio import Entrez"},{"note":"The Bio.Alphabet module was removed in Biopython 1.78. Sequence objects now handle molecule type as a string in SeqRecord annotations or by inferring from context. Explicit alphabet arguments should be removed.","wrong":"from Bio.Alphabet import generic_dna","symbol":"Alphabet","correct":"No direct equivalent"},{"note":"The Bio.Fasta module was deprecated in 1.51 and removed in 1.55. Use Bio.SeqIO.parse() with format='fasta' instead.","wrong":"from Bio import Fasta","symbol":"Fasta","correct":"from Bio import SeqIO"}],"quickstart":{"code":"import os\nfrom Bio.Seq import Seq\nfrom Bio import SeqIO\n\n# 1. Working with a basic sequence\nmy_dna = Seq(\"ATGACGTACGT\")\nprint(f\"Original DNA: {my_dna}\")\nprint(f\"Complement: {my_dna.complement()}\")\nprint(f\"Reverse Complement: {my_dna.reverse_complement()}\")\nprint(f\"Translated protein: {my_dna.translate()}\")\n\n# 2. Parsing a FASTA file\n# Create a dummy FASTA file for demonstration\nfasta_content = (\n    \">seq1 description for sequence 1\\n\"\n    \"ATGCGTACGTAGCTAGCTAGCATGCAGCTAGCATGCGATGC\\n\"\n    \">seq2 description for sequence 2\\n\"\n    \"GATCGATCGATCGATCGATCGATCGATCGATCGATCGA\"\n)\n\nwith open(\"example.fasta\", \"w\") as f:\n    f.write(fasta_content)\n\nprint(\"\\n--- Parsing example.fasta ---\")\nfor seq_record in SeqIO.parse(\"example.fasta\", \"fasta\"):\n    print(f\"ID: {seq_record.id}\")\n    print(f\"Description: {seq_record.description}\")\n    print(f\"Sequence: {seq_record.seq}\")\n    print(f\"Length: {len(seq_record.seq)}\")\n\n# Clean up the dummy file\nos.remove(\"example.fasta\")","lang":"python","description":"This quickstart demonstrates creating and manipulating a Bio.Seq object, and then parsing a FASTA file using Bio.SeqIO.parse, which is a common task in bioinformatics. It includes creating a temporary FASTA file to make the example runnable."},"warnings":[{"fix":"Remove `alphabet` arguments from `Bio.Seq.Seq` constructors. Access molecule type via `SeqRecord.annotations.get('molecule_type')` if needed.","message":"The `Bio.Alphabet` module was removed in Biopython 1.78 (September 2020). Explicit `alphabet` arguments for `Seq` objects are no longer supported, and molecule type is often inferred or stored as a string in `SeqRecord.annotations['molecule_type']`.","severity":"breaking","affected_versions":">=1.78"},{"fix":"Migrate code to use `Bio.SeqIO.parse()` or `Bio.SeqIO.read()` with `format='fasta'` for FASTA file parsing.","message":"The `Bio.Fasta` module was deprecated in Biopython 1.51 (August 2009) and removed in Biopython 1.55 (August 2010).","severity":"breaking","affected_versions":">=1.55"},{"fix":"Upgrade to Python 3.10 or newer. Biopython 1.87 officially supports Python 3.10-3.14.","message":"Support for Python 2.7 was dropped in Biopython 1.77 (2020), in line with Python 2.7's end-of-life.","severity":"breaking","affected_versions":">=1.77"},{"fix":"Consider using Python's `subprocess` module directly to call external tools, or investigate dedicated Python wrappers if available.","message":"The use of command-line tool wrappers in modules like `Bio.Applications` was deprecated in Biopython 1.78. They are no longer recommended due to potential security and compatibility issues.","severity":"deprecated","affected_versions":">=1.78"},{"fix":"Ensure FASTA files strictly start with a `>` character for the first sequence header, or an empty line if not. Remove any preamble text before the first record.","message":"FASTA file parsing became stricter in Biopython 1.85, and as of 1.87, lines before the first '>' are no longer interpreted as comments but cause errors if they are not empty. This can break parsing of some non-standard FASTA files.","severity":"gotcha","affected_versions":">=1.85 (stricter), >=1.87 (removed comment tolerance)"},{"fix":"Update code to use `.location.strand`, `.location.ref`, and `.location.ref_db` directly.","message":"The `.strand`, `.ref`, and `.ref_db` attributes of `SeqFeature` objects were temporarily removed in Biopython 1.82 without deprecation, then restored with deprecation warnings in 1.83. They are aliases for `.location.strand`, `.location.ref`, and `.location.ref_db` respectively.","severity":"deprecated","affected_versions":"1.82-1.87 (deprecated in 1.83)"},{"fix":"For contributors/developers, build systems should now respect `pyproject.toml`. Standard `pip install` users are unaffected.","message":"The `setup.py` script for project metadata and build configuration was deprecated in Biopython 1.87 in favor of a `pyproject.toml`-based setup.","severity":"deprecated","affected_versions":">=1.87"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}