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.2.tar.gz (8.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.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: biofiles-0.0.2.tar.gz
  • Upload date:
  • Size: 8.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.2.tar.gz
Algorithm Hash digest
SHA256 586626716d98e6b567d107b665df133661d575f231c57972bcb2a69f833a0ed2
MD5 e5fd1aa22c8d216c52dfea4dc3705cb1
BLAKE2b-256 d55f277aa91f54479a5cac4fa2638949a3b698f5d10ea1759aeff31bf9427fd4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: biofiles-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d756292037308082d06ef3b8a8392da9c36ac6124fbfdc25f2cb47ba5e95187c
MD5 52608eef0053ed5eff11b5aa4f8767e1
BLAKE2b-256 8e6adf5a075728915684db5afbce18e2b7cc10badb0c4e61dd7a74e34eb5bdf2

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