-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ python: | |
- '2.6' | ||
- pypy | ||
install: | ||
- pip install biopython | ||
- pip install -e . | ||
script: nosetests | ||
deploy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |