-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
845bdca
commit f472434
Showing
2 changed files
with
46 additions
and
37 deletions.
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
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 |
---|---|---|
@@ -1,30 +1,38 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: UTF-8 -*- | ||
# Created by Roberto Preste | ||
import pytest | ||
import os | ||
import pytest | ||
|
||
from skbio import Sequence | ||
from pandas.testing import assert_frame_equal | ||
import pandas.testing as pdtest | ||
|
||
from allfreqs.classes import MultiAlignment, Reference | ||
|
||
DATADIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data") | ||
|
||
|
||
class TestMultiAlignment: | ||
|
||
def test_tabmsa(self, sample_sequences_dict, sample_sequences_tabmsa): | ||
def test_tabmsa(self, | ||
sample_sequences_dict, | ||
sample_sequences_tabmsa): | ||
m = MultiAlignment(sample_sequences_dict) | ||
assert_frame_equal(m.tabmsa, sample_sequences_tabmsa) | ||
pdtest.assert_frame_equal(m.tabmsa, | ||
sample_sequences_tabmsa) | ||
|
||
|
||
class TestReference: | ||
|
||
def test_indexes_from_str(self, sample_reference_indexes): | ||
def test_indexes_from_str(self, | ||
sample_reference_indexes): | ||
ref = "AAG-CTNGGGCATTTCAGGGTGAGCCCGGGCAATACAGGG-TAT" | ||
r = Reference(ref) | ||
assert r.indexes == sample_reference_indexes | ||
|
||
def test_indexes_from_sequence(self, sample_reference_indexes): | ||
ref = Sequence.read(os.path.join(DATADIR, "sample_ref.fasta")) | ||
def test_indexes_from_sequence(self, | ||
sample_reference_indexes): | ||
ref = Sequence.read(os.path.join(DATADIR, | ||
"sample_ref.fasta")) | ||
r = Reference(ref) | ||
assert r.indexes == sample_reference_indexes |