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

Uploaded Python 3

File details

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

File metadata

  • Download URL: biofiles-0.0.7.tar.gz
  • Upload date:
  • Size: 9.0 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.7.tar.gz
Algorithm Hash digest
SHA256 8003532b4536f5347b513d6cb2ff6e0c3933ea0bb5283c64adc325b198564b6f
MD5 ee0a3d71ba6f012aaf1187fcee47acc5
BLAKE2b-256 14038cb5b01238e3d93e3ff477387d64a8ce8510882268e6e182624fe73c31ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: biofiles-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.2 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4787a300dc785d89ea980a3968d329fd79b54de867036395fcdf09e7ad6355fc
MD5 b9c95360c886aa5d47bd8166c270385c
BLAKE2b-256 ae32d1cda8ca909b666ea3217ad55c52ab0c87dd9dccfb9ec986911f7ba3dfd2

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