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.13.tar.gz
(16.3 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.13-py3-none-any.whl
(21.0 kB
view details)
File details
Details for the file biofiles-0.0.13.tar.gz.
File metadata
- Download URL: biofiles-0.0.13.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c4af394dc21d50f44b9259368e66e33897c12dfa484914ce466d0e1c991dbec
|
|
| MD5 |
bc34945352f8576f5bf408641511ad3e
|
|
| BLAKE2b-256 |
74354883f4a609c143419338e554dbcc385851a701613c20b943ac8132419186
|
File details
Details for the file biofiles-0.0.13-py3-none-any.whl.
File metadata
- Download URL: biofiles-0.0.13-py3-none-any.whl
- Upload date:
- Size: 21.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 |
0bb3845ab4743483ab6f96ceabe1b808707625840a7f1b704c576ecdeee5b1ba
|
|
| MD5 |
aa8b4a71ccd78497585cd01df7e463d3
|
|
| BLAKE2b-256 |
37d3ccd216d6a1a269d771e2711d42b446bca746b1712a0023c0f512b73871f6
|