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.14.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.14-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: biofiles-0.0.14.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.14.tar.gz
Algorithm Hash digest
SHA256 a7af5f4db265a1ade2ed2cacec4abc0a01b97958f2b14869446bc5e7f396d526
MD5 e1b8eaaefa4372ae305784315c3f2c10
BLAKE2b-256 ba9a8045be78d454486e73304c59532c7fc32e21b5ae0ea47d02fd24a01f4658

See more details on using hashes here.

File details

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

File metadata

  • Download URL: biofiles-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 21.1 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.14-py3-none-any.whl
Algorithm Hash digest
SHA256 707e0e11ef46b8bc622d88fa78c1d7a916863782db78bb106a5300ee4eb9422a
MD5 173e2e96dd57d6fe2c63d1ba076a4798
BLAKE2b-256 fc367fa9b621e708d797075b251b770c4c58b548b629b568405cc9b1708f4fb4

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