Skip to content

Commit

Permalink
Getting ready for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshw5 committed Aug 27, 2014
1 parent c33b2f8 commit 4fb6ee2
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ python:
- '2.6'
- pypy
install:
- pip install biopython
- pip install -e .
script: nosetests
deploy:
Expand Down
10 changes: 10 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,16 @@ CLI Usage
Changes
-------

*New in version 0.2.5*:

- Fasta and Faidx can take `default_seq` in addition to `as_raw`, `key_function`,
and `strict_bounds` parameters.
- Fixed issue [#20](https://github.com/mdshw5/pyfaidx/issues/20)
- Faidx has attribute `raw_index` which is a list representing the fai file.
- Faidx has `rebuild_index` and `write_fai` functions for building and writing
`raw_index` to file.
- Extra test cases, and test cases against Biopython SeqIO

*New in version 0.2.4*:

- Faidx index order is stable and non-random
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
setup(
name='pyfaidx',
provides='pyfaidx',
version='0.2.4',
version='0.2.5',
author='Matthew Shirley',
author_email='[email protected]',
url='http://mattshirley.com',
Expand Down
23 changes: 23 additions & 0 deletions tests/test_bio_seqio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
from pyfaidx import Fasta, FetchError
from Bio import SeqIO

path = os.path.dirname(__file__)
os.chdir(path)

class TestBioSeqIO:
def __init__(self):
self.genes = os.path.join(path, 'data/genes.fasta')
self.fasta = Fasta(self.genes)
with open(self.genes, "rU") as fh:
self.seqio = SeqIO.to_dict(SeqIO.parse(fh, "fasta"))

def test_fetch_whole_entry(self):
assert str(self.fasta['KF435150.1']) == str(self.seqio['KF435150.1'].seq)
assert self.fasta['KF435150.1'].name == str(self.seqio['KF435150.1'].name)

def test_slice_whole_entry(self):
assert str(self.fasta['KF435150.1'][::3]) == str(self.seqio['KF435150.1'].seq[::3])

def test_revcomp_whole_entry(self):
assert str(self.fasta['KF435150.1'][:].reverse.complement) == str(self.seqio['KF435150.1'].reverse_complement().seq)

0 comments on commit 4fb6ee2

Please sign in to comment.