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.11.tar.gz
(13.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.11-py3-none-any.whl
(16.9 kB
view details)
File details
Details for the file biofiles-0.0.11.tar.gz.
File metadata
- Download URL: biofiles-0.0.11.tar.gz
- Upload date:
- Size: 13.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 |
a417be4e4675ba4ac256ca05ae9955ce20fe7ff69fdb0f79bfc271bebed19aaf
|
|
| MD5 |
501a3284586ec83797cc2ee2baae28a7
|
|
| BLAKE2b-256 |
e1aa101a8b2e0f750096bc5cfe763c1fb7db464385cbd5d8a811352a0b23fa9c
|
File details
Details for the file biofiles-0.0.11-py3-none-any.whl.
File metadata
- Download URL: biofiles-0.0.11-py3-none-any.whl
- Upload date:
- Size: 16.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 |
11d31475eea99b95a694c2b13163444485a1c22072145f6f661d3b92930f1bea
|
|
| MD5 |
bb9bc3f592a3450dfa196488ad2efd0b
|
|
| BLAKE2b-256 |
b9e3dc2a2ffb2b17750096ed147e950a5bc6e585f87be19ae77c78c24e708d5b
|