Skip to main content

Tiny FASTA package, without dependencies, for processing biological sequence files.

Project description

TinyFasta is a Python package for parsing biological sequences from FASTA files.

There are already several Python packages available for parsing FASTA files. However, many of these packages do much more than just parse FASTA files and as such have dependencies on NumPy and SciPy . These are quite heavy weight dependencies if all you want to do is a little bit of text processing. This is where TinyFasta fits in. It is a lightweight Python package with no dependencies outside of the Python standard library.

To install the TinyFasta package:

sudo pip install tinyfasta

To parse a FASTA file:

>>> from tinyfasta import FastaParser
>>> for fasta_record in FastaParser("tests/data/dummy.fasta"):
...     if fasta_record.description.contains('seq1'):
...         print(fasta_record)
...
>seq1|contains 2x78 A's
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

To create a FASTA record:

>>> from tinyfasta import FastaRecord
>>> sequence = "C" * 100
>>> fasta_record = FastaRecord.create("My Sequence", sequence)
>>> print(fasta_record)
>My Sequence
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCC

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tinyfasta, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size tinyfasta-0.0.2.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page