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
Release history Release notifications | RSS feed
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.12.tar.gz
(13.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
biofiles-0.0.12-py3-none-any.whl
(17.0 kB
view details)
File details
Details for the file biofiles-0.0.12.tar.gz.
File metadata
- Download URL: biofiles-0.0.12.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
405a66a2a337c7c948684d3dad3e977c02cb93fe97f1708422df823235597f85
|
|
| MD5 |
ff231d7ab6dad3208d46d1892f53ecf3
|
|
| BLAKE2b-256 |
225b866e6cf69537ecb698eb8c1f3cdfd0ce64c382092784e031db015015ed95
|
File details
Details for the file biofiles-0.0.12-py3-none-any.whl.
File metadata
- Download URL: biofiles-0.0.12-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34b5ff36964db92882179ecf4382ad5b4a74438aab64206bf5a4c38867e3ffba
|
|
| MD5 |
54c9f556ce00ee81d2233c981ba25660
|
|
| BLAKE2b-256 |
dbd97ae77970d0414429406775784b73de1662c69b1c402fa6016b6521fba985
|