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.6.tar.gz
(8.9 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.6-py3-none-any.whl
(11.1 kB
view details)
File details
Details for the file biofiles-0.0.6.tar.gz.
File metadata
- Download URL: biofiles-0.0.6.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
733293db14633814a737dc3c95da59fb4f9c739f8b26b8c4b2b98517befacac9
|
|
| MD5 |
1abdd16c865d658a6d6d13adbf0b16ef
|
|
| BLAKE2b-256 |
84d69bd7727b5909a497966451683fa60fb3dccdcbb58dcb5714907f405a0b46
|
File details
Details for the file biofiles-0.0.6-py3-none-any.whl.
File metadata
- Download URL: biofiles-0.0.6-py3-none-any.whl
- Upload date:
- Size: 11.1 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 |
5b0bed08662360045543c6256171920d862827728936226934b6cf9efc5a9be9
|
|
| MD5 |
96f7bfa1f8711ac2b4d5f86c47553cd6
|
|
| BLAKE2b-256 |
77de375edc63aa9a3f4bb2389004851532197ccce55adf19b803970cb2fea020
|