https://github.com/brentp/fastahack-python
cython wrapper to fastahack
https://github.com/brentp/fastahack-python
Last synced: about 2 months ago
JSON representation
cython wrapper to fastahack
- Host: GitHub
- URL: https://github.com/brentp/fastahack-python
- Owner: brentp
- Created: 2010-09-25T04:02:12.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2013-08-27T14:53:39.000Z (over 12 years ago)
- Last Synced: 2025-02-02T04:41:13.118Z (11 months ago)
- Language: C++
- Homepage:
- Size: 120 KB
- Stars: 11
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
=========
FastaHack
=========
python/cython wrapper for `fastahack`_ library
The c++ library, fastahack, reads `.fai files`_ files for an index,
as created by e.g. `samtools`_ and the fastahack commandline interface.
Currently, the index (chr => (position, line length)) is read
into memory.
::
>>> from fastahack import FastaHack
>>> f = FastaHack('fastahack/tests/correct.fasta')
>>> f['1:1-10']
'TAACCCTAAC'
>>> f.get_sub_sequence('1', 0, 10)
'TAACCCTAACC'
>>> f.get_sequence('1')[1:11]
'AACCCTAACC'
>>> f.get_sequence_length('1')
630L
>>> f.names
['1', '2', '3']
Installation
------------
If `python setup.py install` gives an error, you may need to run
`cython fastahack/cfastahack.pyx`
.. _`fastahack`: http://github.com/ekg/fastahack/
.. _`samtools`: http://samtools.sourceforge.net/
.. _`.fai files`: http://biostar.stackexchange.com/questions/1496/can-you-please-tell-me-where-i-find-information-about-fai-file-format