Welcome to peasel’s documentation!

Some python wrappers for a little bit of Sean Eddy‘s excellent Easel library for sequence manipulation.

At present, it’s just a Python API to the Simple Sequence Index (SSI) format for rapid sequence retrieval from large files.

Installation

peasel requires Python 2.7, either setuptools or distribute and a working C compiler.

Development requires Cython, tested with version 0.17.

To install:

python setup.py install

To run the unit tests:

python setup.py test

Example Usage

Create an index file

Use peasel.create_ssi to build a sequence index:

>>> import peasel
>>> peasel.create_ssi('my_big_sequence_file.fasta') # creates my_big_sequence_file.fasta.ssi
2 # Number of sequences indexed

Retrieving sequences from an index

Sequence-indexes support dict-like behavior:

>>> import peasel
>>> # Open the index
>>> index = peasel.open_ssi('my_big_sequence_file.fasta')
>>> index['sequence1']
<EaselSequence 0x7f38735b80f0 [name="sequence1";description="";length=5]>
>>> index.get('sequence1')
<EaselSequence 0x7f38735b8108 [name="sequence1";description="";length=5]>
>>> print index.get('missing_sequence')
None

Using a temporary index

If you’d prefer not to litter the filesystem with .ssi files, use the temp_ssi context manager:

>>> import peasel
>>> with peasel.temp_ssi('my_big_sequence_file.fasta') as index:
...     index['sequence1']
...
<EaselSequence 0x7ff15065a0f0 [name="sequence1";description="";length=5]>

API documentation

peasel Module

License

Distributed under the GPLv3. Easel source code is distributed under the Janelia Farm License, included in the easel-src subdirectory.

Indices and tables

Table Of Contents