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.3.tar.gz
(8.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
File details
Details for the file biofiles-0.0.3.tar.gz.
File metadata
- Download URL: biofiles-0.0.3.tar.gz
- Upload date:
- Size: 8.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 |
74b5a9200f3f46ed7f629097ac1add28d881feaa0260381adbd19ddb9cc4c566
|
|
| MD5 |
fd39a4dc826b4d9f33305ec22baf040e
|
|
| BLAKE2b-256 |
f29ddfabf3879b2f9a7b25b195c8094092c9082bb630c8bab2f8039f1cadcac4
|
File details
Details for the file biofiles-0.0.3-py3-none-any.whl.
File metadata
- Download URL: biofiles-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.9 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 |
80390e3b7a1e8329df5044bc947317fae7689c74ab2be6ee1f92a5d80d3dbfca
|
|
| MD5 |
4fc22f40e7c22e68b6678e9e0c1f7513
|
|
| BLAKE2b-256 |
f7a3785f8605bd58b804cebe14efee029a3e1e6881260db33e11fb187a5f1583
|