Skip to main content

Pure-Python, zero-dependency collection of bioinformatics-related file readers and writers

Project description

biofiles

Pure-Python, zero-dependency collection of bioinformatics-related file readers and writers.

Installation

python -m pip install biofiles

Usage

Reading FASTA files:

from biofiles.fasta import FASTAReader

with FASTAReader("sequences.fasta") as r:
    for seq in r:
        print(seq.id, len(seq.sequence))

# or

with open("sequences.fasta") as f:
    r = FASTAReader(f)
    for seq in r:
        print(seq.id, len(seq.sequence))

Writing FASTA files:

from biofiles.fasta import FASTAWriter
from biofiles.types.sequence import Sequence

seq = Sequence(id="SEQ", description="Important sequence", sequence="GAGAGA")

with FASTAWriter("output.fasta") as w:
    w.write(seq)

Reading GFF genome annotations:

from biofiles.gff import GFFReader
from biofiles.types.feature import Gene

with GFFReader("GCF_009914755.1_T2T-CHM13v2.0_genomic.gff") as r:
    for feature in r:
        if isinstance(feature, Gene):
            print(feature.name, len(feature.exons))

License

MIT license, see License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

biofiles-0.0.10.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

biofiles-0.0.10-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file biofiles-0.0.10.tar.gz.

File metadata

  • Download URL: biofiles-0.0.10.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for biofiles-0.0.10.tar.gz
Algorithm Hash digest
SHA256 5054f7f0f036ef03124b36d63c283b1fd8d94457c2dba0b8551d1e0889761dd4
MD5 ecc59d626e6e1910ba9425f39a7a61a7
BLAKE2b-256 e8dc56765f425d43ca4d33249a2d43d3e15991f1220c79b9cc9b0e6fc13e7d37

See more details on using hashes here.

File details

Details for the file biofiles-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: biofiles-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for biofiles-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 8945190fef8e27f5312684c4a08cba2779774da7a55fe2c131c68d8d09eee947
MD5 7ae6ea73c72fc387153e5ff58731c60a
BLAKE2b-256 3c1dc7b0e19e963cfc4848a88a98f120b43569c9693ad9699da67d81be433d7c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page