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.dialects.gencode import GENCODE_DIALECT
from biofiles.dialects.genomic_base import Gene
with GFFReader("GCF_009914755.1_T2T-CHM13v2.0_genomic.gff", dialect=GENCODE_DIALECT) as r:
for feature in r:
if isinstance(feature, Gene):
print(feature.name, len(feature.exons))
Currently three dialects are supported:
biofiles.dialects.gencode.GENCODE_DIALECTfor GENCODE genome annotation;biofiles.dialects.refseq.REFSEQ_DIALECTfor RefSeq genome annotation;biofiles.dialects.stringtie.STRINGTIE_DIALECTfor StringTie output files.
License
MIT license, see License.
Metadata
Release files for biofiles 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| biofiles-0.1.10.tar.gz | 20.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| biofiles-0.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 47.9 kB
Release files / biofiles-0.1.10.tar.gz
| Download URL | biofiles-0.1.10.tar.gz |
|---|---|
| Size | 20.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43fdc004ba350ad4089fa76f814921c6be37db82deb6bed210ecf550e7819eb4
|
|
BLAKE2b-256 checksum How to use checksums |
d055cfe634979c7aa5271af05045a4c7c19207873dd4aec3f6e44bf4ebcc30ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.9
|
Release files / biofiles-0.1.10-py3-none-any.whl
| Download URL | biofiles-0.1.10-py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f72a9012b30757a616045df20503584f9423066751d244ab41bb6a021d20c8c
|
|
BLAKE2b-256 checksum How to use checksums |
5bb91fb9aaad6c401ae8e7d8fa47784776c3f8a9a24059c0a2b64b1ea75d2303
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.11.9
|