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.13.tar.gz (16.3 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.13-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: biofiles-0.0.13.tar.gz
  • Upload date:
  • Size: 16.3 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.13.tar.gz
Algorithm Hash digest
SHA256 3c4af394dc21d50f44b9259368e66e33897c12dfa484914ce466d0e1c991dbec
MD5 bc34945352f8576f5bf408641511ad3e
BLAKE2b-256 74354883f4a609c143419338e554dbcc385851a701613c20b943ac8132419186

See more details on using hashes here.

File details

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

File metadata

  • Download URL: biofiles-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 21.0 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 0bb3845ab4743483ab6f96ceabe1b808707625840a7f1b704c576ecdeee5b1ba
MD5 aa8b4a71ccd78497585cd01df7e463d3
BLAKE2b-256 37d3ccd216d6a1a269d771e2711d42b446bca746b1712a0023c0f512b73871f6

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