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.9.tar.gz
(9.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.9-py3-none-any.whl
(11.6 kB
view details)
File details
Details for the file biofiles-0.0.9.tar.gz.
File metadata
- Download URL: biofiles-0.0.9.tar.gz
- Upload date:
- Size: 9.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 |
43cada73b01269d6a09e651b45fff35319c8d2f0a7a9e819962b4f31cc747984
|
|
| MD5 |
f86df41be537703e892f8f8edcb76642
|
|
| BLAKE2b-256 |
d41a6621b60769133a0690b00965b4e7d54248542707c837eaaab36cceae8eba
|
File details
Details for the file biofiles-0.0.9-py3-none-any.whl.
File metadata
- Download URL: biofiles-0.0.9-py3-none-any.whl
- Upload date:
- Size: 11.6 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 |
98afa59b322cc652ff03df993386cd24444c66db6e90c1509d7be2c0c70bf242
|
|
| MD5 |
d9fcdcdc571abc059a06f193a2c84407
|
|
| BLAKE2b-256 |
ae4ee11bf53ff39da0dfe132f409900988ad9d299c89988b8a98da53b5a5a987
|