Bioutils Collection
Bioinformatics utilities for sequence analysis, alignment, annotation, FASTA processing, and molecular biology workflows.
Installation
pip install bioutils-collection
Requires Python 3.10+ and NumPy, SciPy, scikit-learn, and Numba. Runtime dependencies
are declared in pyproject.toml. To install a local checkout:
pip install -r requirements.txt
Quick start
from bioutils_collection import (
gc_content,
needleman_wunsch,
parse_fasta,
reverse_complement,
translate_dna_to_protein,
)
assert reverse_complement("ATCGATCG") == "CGATCGAT"
assert gc_content("ATCGATCG") == 50.0 # Percentage, from 0 to 100
# Alignment returns the score first, followed by the aligned sequences.
score, aligned1, aligned2 = needleman_wunsch("GATTACA", "GCATGCU")
assert translate_dna_to_protein("ATGGCCTAA") == "MA*"
# parse_fasta accepts FASTA text.
for header, sequence in parse_fasta(">example\nATGGCCTAA\n"):
print(f"{header}: {len(sequence)} bp")
Modules
alignment_functions: global/local alignment, distances, identity, score ratios.sequence_operations: complements, ORFs, CpG islands, k-mers, minimizers, syncmers.translation_functions: transcription, genetic codes, batch/streaming translation.gc_functions: GC percentages, GC skew, and windowed GC analysis.sequence_statistics: codon usage, entropy, conservation, protein properties.data_validation: DNA and protein validation.fasta_misc: FASTA parsing, writing, filtering, splitting, and format conversion.annotation_functions: BED/GFF/GTF/VCF parsing, conversion, and statistics.motif_functions: motif search, consensus generation, and pattern matching.repeat_functions: tandem repeats and palindrome detection.restriction_functions: restriction enzyme site identification.clustering_functions: motif clustering.
Functions are available from their modules; common utilities are also exported
from bioutils_collection. Docstrings describe inputs, outputs, and validation.
Sequence analysis example
from bioutils_collection import find_orfs, gc_content_windows
from bioutils_collection.sequence_operations.find_cpg_islands import find_cpg_islands
from bioutils_collection.sequence_statistics.amino_acid_composition import (
amino_acid_composition,
)
from bioutils_collection.sequence_statistics.calculate_isoelectric_point import (
calculate_isoelectric_point,
)
dna_sequence = "ATG" + "GCC" * 100 + "TAA"
orfs = [orf for orf in find_orfs(dna_sequence) if len(orf[2]) >= 300]
gc_profile = gc_content_windows(dna_sequence, window_size=100, step_size=25)
cpg_islands = find_cpg_islands(dna_sequence)
protein_seq = "MAAAAA"
pi = calculate_isoelectric_point(protein_seq)
composition = amino_acid_composition(protein_seq)
GC windows return (start, end, percentage) tuples with zero-based, exclusive
end positions. Incomplete trailing windows are skipped.
Development and testing
git clone https://github.com/MForofontov/bioutils-collection.git
cd bioutils-collection
python -m venv .venv
# Activate .venv using the command for your shell, then:
python -m pip install -e ".[dev]"
python -m pytest
python -m pytest -m alignment
python -m pytest --cov=bioutils_collection --cov-report=html
python -m mypy bioutils_collection
python -m ruff check .
python -m ruff format --check .
See the major check plan for the staged correctness, packaging, file safety, and performance audit.
To reproduce performance measurements separately from functional tests:
python benchmarks/major_audit.py --output benchmarks/major_audit_results.json
python benchmarks/paired_audit.py --output benchmarks/paired_audit_results.json
python scripts/check_distribution.py --artifact-dir dist --report dist/distribution-report.json
The benchmark uses deterministic inputs, checks reference equivalence, and records repeated timings and peak Python allocations. Native allocations and worker memory are not included in that memory measurement. Timings depend on the machine. The paired runner additionally records immutable baseline/current source manifests, five counterbalanced timing samples, and separately measured process peak RSS. It labels corrected-reference comparisons and does not claim speedups when old outputs differ. Runtime/memory retention criteria are in AGENTS.md.
Use a fresh artifact directory for distribution checks. The verifier derives the
version from package metadata and installs the wheel and sdist into separate
temporary virtual environments, checks imports/examples outside the checkout,
and rejects stale package sources. Default checks resolve dependencies freshly.
For offline local checks, --reuse-dependencies --no-build-isolation can reuse
available dependencies/build tools; the report explicitly records this limitation.
Conventions and scientific models
- BED parsers retain zero-based, half-open coordinates; GFF/GTF parsers retain
one-based, inclusive coordinates.
annotation_to_bedexpects one-based, inclusive input, including its legacychromalias. Convert a parsed BED start by adding one before passing it to this converter orannotation_statistics. Annotation statistics sum record lengths, including overlaps repeatedly. - GFF/GTF writers accept their corresponding parser records as well as existing writer field names. Existing writer fields take precedence. GFF attribute dictionaries retain percent-encoded values; writers do not decode them.
- Closed syncmers select a k-mer when its leftmost minimum s-mer is first or last. Open syncmers retain offset zero. Both pattern-matching modes include overlaps.
- Translation uses the NCBI internal-codon AAs rows. Alternative initiation and context-dependent termination are not modeled; table 32 is not implemented. Empty records are skipped by file translation. Dictionary translation keeps the last duplicate ID; streaming translation preserves each record. Output replaces its destination only after successful processing; input aliases are rejected. Streaming memory grows with the largest record, rather than total file size.
- Protein pI solves zero net charge using the fixed pKa values in its docstring. Approximate mass tables are rounded to 0.1 Da and include linear-chain bond and terminal corrections. DNA/RNA masses assume a single strand, 5-prime phosphate, and 3-prime hydroxyl. These models omit modifications and sequence context.
- ENC uses population homozygosity without a finite-sample correction; sparse sequences are unreliable unbiased estimates. Sequence complexity reports a unique-substring fraction. Melting temperature uses composition approximations, rather than nearest-neighbor thermodynamics. DNA validation computes GC over standard A/T/G/C bases only; ambiguous symbols are excluded from its denominator.
Contributing
Fork the repository, create a branch, add regression tests for fixes, and run relevant checks before submitting a pull request. Include type hints and regression tests, and update documentation when behavior changes. Follow AGENTS.md: always update documentation to reflect the change, add release notes, and update the package version once per completed changeset. Fixes, documentation, and tooling use a patch increment unless a larger change requires a minor or breaking-change increment. Version updates do not publish.
Contact and related projects
- Author: Mykyta Forofontov
- Report bugs or request features
- PyPI package
- Biopython and scikit-bio
- pyutils-collection
License
MIT © 2026 Mykyta Forofontov. See LICENSE.
Metadata
Release files for bioutils-collection 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bioutils_collection-0.3.2.tar.gz | 65.9 kB | With provenance | Details for bioutils_collection-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bioutils_collection-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for bioutils_collection-0.3.2-py3-none-any.whl |
Total release size: 181.9 kB
Release files / bioutils_collection-0.3.2.tar.gz
| Download URL | bioutils_collection-0.3.2.tar.gz |
|---|---|
| Size | 65.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8fa9e8d758da17db1e46a131edfa06596f1b41450ea3dae8786c5462b4b19b9d
|
|
BLAKE2b-256 checksum How to use checksums |
edef847ea195dab6dc934596715ad9514f37835e650c3491dc725d24b7b6f905
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / bioutils_collection-0.3.2-py3-none-any.whl
| Download URL | bioutils_collection-0.3.2-py3-none-any.whl |
|---|---|
| Size | 116.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cd77da748e75611e842ee47629144f9eb306c2b8d06c2b6f48c0546fc0a32c1
|
|
BLAKE2b-256 checksum How to use checksums |
a2b5ca106a862ab3f7510516e94e3d7bb8a255f8d90cc05bbaa727c002755397
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for bioutils-collection 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for bioutils_collection-0.3.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.