{"id":2885,"library":"bio","title":"Bio","description":"The 'bio' library provides common bioinformatics algorithms and data structures implemented in Python. It is a lightweight alternative to larger bioinformatics packages, focusing on core functionalities like sequence manipulation, alignment, and motif analysis. The current version is 1.8.1, with a release cadence of a few updates per year, mainly for bug fixes and minor feature enhancements.","status":"active","version":"1.8.1","language":"en","source_language":"en","source_url":"https://github.com/ialbert/bio/","tags":["bioinformatics","sequence-analysis","genomics","alignment","dna","rna","protein"],"install":[{"cmd":"pip install bio","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"Seq","correct":"from bio import seq; s = seq.Seq(...)"},{"symbol":"global_alignment","correct":"from bio import align; aln = align.global_alignment(...)"},{"symbol":"motifs","correct":"from bio import motifs"}],"quickstart":{"code":"from bio import seq\n\n# Create a DNA sequence object\ndna_sequence = seq.Seq(\"ATGATCCAGGGC\", seq.DNA)\n\n# Get the reverse complement\nreverse_complement = dna_sequence.rc()\nprint(f\"Original DNA: {dna_sequence}\")\nprint(f\"Reverse complement: {reverse_complement}\")\n\n# Get the RNA transcription\nrna_sequence = dna_sequence.transcribe()\nprint(f\"RNA: {rna_sequence}\")\n\n# Translate to protein (starts from first codon)\nprotein_sequence = rna_sequence.translate()\nprint(f\"Protein: {protein_sequence}\")","lang":"python","description":"This quickstart demonstrates basic sequence manipulation, including creating DNA sequences, obtaining reverse complements, transcribing to RNA, and translating to protein using the `bio.seq` module."},"warnings":[{"fix":"Ensure you are importing from `bio` (e.g., `from bio import seq`) and refer to its specific documentation and API.","message":"The 'bio' library is distinct from 'Biopython'. While both handle bioinformatics, 'bio' is a smaller, more focused library by a different author. Do not confuse their APIs or expect interoperability without explicit conversion.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When performing operations on sequences, store the result: `new_seq = old_seq.operation()`. Do not expect `old_seq` to be modified.","message":"Sequence objects (e.g., `bio.seq.Seq`) are immutable. Methods like `.rc()`, `.transcribe()`, or `.translate()` return *new* `Seq` objects rather than modifying the original in-place. Always assign the result of these methods to a new variable.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your development environment uses Python 3.10 or a later version. Upgrade Python if necessary or use a virtual environment with the correct Python version.","message":"The 'bio' library requires Python 3.10 or newer. Attempting to install or run it on older Python versions (e.g., Python 3.9 or earlier) will result in installation failures or runtime errors.","severity":"breaking","affected_versions":"1.8.0+"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}