About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • License: Freeware
  • Last update: 6 years ago
  • Total downloads: 78
  • Price: Free |
  • Operating system: Linux
  • Publisher: brentp
See full specifications

linux default iconpyfasta Publisher's description

pyfasta is a library that offers Pythonic access to fasta sequence files.

Pythonic access to fasta sequence files

pyfasta is a library that offers Pythonic access to fasta sequence files.

.. sourcecode:: python

>>> from pyfasta import Fasta

>>> f = Fasta('tests/data/three_chrs.fasta')
>>> sorted(f.keys())
['chr1', 'chr2', 'chr3']

>>> f['chr1']
FastaGz('tests/data/three_chrs.fasta.gz', 0..80)

>>> f['chr1'][:10]

# the index stores the start and stop of each header from teh fasta file
>>> f.index
{'chr3': (160, 3760), 'chr2': (80, 160), 'chr1': (0, 80)}

# can query by a 'feature' dictionary
>>> f.sequence({'chr': 'chr1', 'start': 2, 'stop': 9})

# with reverse complement for - strand
>>> f.sequence({'chr': 'chr1', 'start': 2, 'stop': 9, 'strand': '-'})

# creates a .gz and a .gdx pickle of the fasta and the index.
>>> import os
>>> sorted(os.listdir('tests/data/'))[1:]
['three_chrs.fasta', 'three_chrs.fasta.gdx', 'three_chrs.fasta.gz']

# cleanup (though for real use these will remain for faster access)
>>> os.unlink('tests/data/three_chrs.fasta.gdx')
>>> os.unlink('tests/data/three_chrs.fasta.gz')

What's New in This Release:

В· add key_fn kwarg to constuctor

System Requirements:

No special requirements.
Program Release Status:
Program Install Support: Install and Uninstall

pyfasta Tags:

Click on a tag to find related softwares

Is pyfasta your software?

Manage your software

Most Popular

linux default icon GDB 7.4
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it... Read more
linux default icon Coral 0.9.1
Coral is a tool and a development platform to create and transform models and modeling languages.
linux default icon Forum Paid Plus Script 6.1
Forum Paid Pay Per Post Exchange is targeted at forum owners who wish to...
linux default icon sdo 0.6.5
Converts oracle SDO_GEOMETRY objects to WKT and GeoJSON.
linux default icon Get Paid Plus Script 6.1
Get Paid Plus Script

Related Category

» Other (877)
» Tools & Editors (359)
» Web Development (146)