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.5.tar.gz
(8.5 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.5.tar.gz.
File metadata
- Download URL: biofiles-0.0.5.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
784e4ee85a1596144350852ba7de1eff5460a3b39a41ebebc72840aabaae54b1
|
|
| MD5 |
637c3778c46c624967eaa57159b7e162
|
|
| BLAKE2b-256 |
1ff0614e48902ff8a07e06aa34b5cde15ffe767e3a7ad32617852c9a1da3f10f
|
File details
Details for the file biofiles-0.0.5-py3-none-any.whl.
File metadata
- Download URL: biofiles-0.0.5-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 |
e65481447bc06a0dfb5c5f7342f70b46921f5cd3f2967024634b8a8cac3f7497
|
|
| MD5 |
682fd3ae228b32dbcaa9459150e4afc8
|
|
| BLAKE2b-256 |
8b6133488351a4f0536b53cfa11f00f1e71b2b84131d4225212f948b878d2ae3
|