Skip to content

Commit

Permalink
fix all the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
humbertoevans committed Nov 22, 2019
1 parent dd6ce27 commit 3a30fa5
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 122 deletions.
5 changes: 0 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Python 3 CircleCI 2.0 configuration file
# For Synthego ICE
#
# https://circleci.com/docs/2.0/language-python/
#
version: 2
jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .pytest_cache/v/cache/lastfailed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
52 changes: 52 additions & 0 deletions .pytest_cache/v/cache/nodeids
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[
"ice/tests/test_alignment.py::test_windowed_alignment",
"ice/tests/test_alignment.py::test_coord_conversion",
"ice/tests/test_alignment.py::test_no_aln_possible",
"ice/tests/test_alignment.py::test_no_aln_done",
"ice/tests/test_alignment.py::test_all_alignment",
"ice/tests/test_alignment.py::test_aln_str",
"ice/tests/test_alignment.py::test_aln_data",
"ice/tests/test_alignment.py::test_aln_shorter_sample",
"ice/tests/test_alignment.py::test_no_aln",
"ice/tests/test_alignment.py::test_donor_alignment_hdr_indel_size",
"ice/tests/test_analysis.py::test_high_quality_sample",
"ice/tests/test_analysis.py::test_lowercase_guide",
"ice/tests/test_analysis.py::test_low_quality_control",
"ice/tests/test_analysis.py::test_low_quality_control_fail",
"ice/tests/test_analysis.py::test_sanger_analysis_bad_path",
"ice/tests/test_analysis.py::test_low_quality_sample",
"ice/tests/test_analysis.py::test_bad_paths",
"ice/tests/test_analysis.py::test_alignment_fail",
"ice/tests/test_analysis.py::test_sequence_not_found",
"ice/tests/test_analysis.py::test_donor_example",
"ice/tests/test_analysis.py::test_donor_substitution_example",
"ice/tests/test_analysis.py::test_multiplex_0_0",
"ice/tests/test_analysis.py::test_multiplex_0_1",
"ice/tests/test_analysis.py::test_multiplex_0_2",
"ice/tests/test_analysis.py::test_multiplex_1_0",
"ice/tests/test_analysis.py::test_multiplex_1_1",
"ice/tests/test_analysis.py::test_multiplex_three_guides",
"ice/tests/test_analysis.py::test_multiplex_three_guides_no_editing",
"ice/tests/test_analysis.py::test_should_skip_proposal",
"ice/tests/test_batch.py::test_batch_analysis",
"ice/tests/test_batch.py::test_bad_batch",
"ice/tests/test_edit_proposal_creator.py::test_single_cut",
"ice/tests/test_edit_proposal_creator.py::test_human_readable_sequence_single_edit_proposal",
"ice/tests/test_edit_proposal_creator.py::test_human_readable_sequence_multiplex_proposal",
"ice/tests/test_edit_proposal_creator.py::test_multiplex_cut",
"ice/tests/test_edit_proposal_creator.py::test_bad_multiplex",
"ice/tests/test_edit_proposal_creator.py::test_wt_proposal",
"ice/tests/test_edit_proposal_creator.py::test_req_ctrl_trace",
"ice/tests/test_edit_proposal_creator.py::test_generated_trace",
"ice/tests/test_sanger_object.py::test_trace_to_seq",
"ice/tests/test_sequence.py::test_rev_comp",
"ice/tests/test_sequence.py::test_complement",
"ice/tests/test_sequence.py::test_rev_transcribe",
"ice/tests/test_sequence.py::test_transcribe",
"ice/tests/test_sequence.py::test_is_nuc_acid",
"ice/tests/test_sequence.py::test_rna2dna",
"ice/tests/test_sequence.py::test_dna2rna",
"ice/tests/test_utility.py::test_sequence_util",
"ice/tests/test_utility.py::test_dna_bad_input",
"ice/tests/test_utility.py::test_version"
]
1 change: 1 addition & 0 deletions .pytest_cache/v/cache/stepwise
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
49 changes: 26 additions & 23 deletions ice/tests/test_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
donor_alignment_noncontiguous_insert, donor_alignment_insert_and_deletion, donor_alignment_deletion


def test_windowed_alignment():
pa = example_alignment()
pa.align_with_window([0,3])
def test_windowed_alignment(example_alignment):
pa = example_alignment
pa.align_with_window([0, 3])
assert pa.aln_seqs[0] == "AAT---------"
assert pa.aln_seqs[1] == "AATGTATGATAG"

Expand All @@ -21,7 +21,7 @@ def test_coord_conversion():
seq1 = 'GGGAATGTCCTGATAG'
seq2 = 'AATGTTGATAG'
pa = PairAlignment(seq1, seq2)
pa.align_with_window([0,14])
pa.align_with_window([0, 14])
assert 2 == pa.ctrl2sample_coords(5)
assert 0 == pa.ctrl2sample_coords(3)
assert 9 == pa.ctrl2sample_coords(14)
Expand All @@ -41,55 +41,55 @@ def test_no_aln_possible():
assert 'No alignment found' in msg


def test_no_aln_done():
pa = example_alignment()
def test_no_aln_done(example_alignment):
pa = example_alignment
with pytest.raises(Exception):
pa.ctrl2sample_coords(5)


def test_all_alignment():
pa = example_alignment()
def test_all_alignment(example_alignment):
pa = example_alignment
pa.align_all()
assert "AATGT-ATGATAG" in pa.all_aligned_clustal

with pytest.raises(Exception):
pa.ctrl2sample_coords(None)

#only windowed alignment results in alingment_pairs
# only windowed alignment results in alingment_pairs
with pytest.raises(Exception):
assert 7 == pa.ctrl2sample_coords(8)


def test_aln_str():
pa = example_alignment()
def test_aln_str(example_alignment):
pa = example_alignment
pa.align_all()
assert (str(pa) == 'AATGTAATGATAG\nAATGT-ATGATAG') or \
(str(pa) == 'AATGTAATGATAG\nAATGTA-TGATAG')
(str(pa) == 'AATGTAATGATAG\nAATGTA-TGATAG')


def test_aln_data():
def test_aln_data(example_alignment):
'''
The alignment after windowing should ignore the last base of the ref seq
control AATGTAATGATA
edited AATGTATGATAG
'''
pa = example_alignment()
pa = example_alignment
pa.align_with_window([0, 3])
for idx, pair in enumerate(pa.alignment_pairs):
assert pair[0] == pair[1]


def test_aln_shorter_sample():
def test_aln_shorter_sample(shorter_alignment):
'''
The alignment after windowing should have gaps
AATGTAATGATAG---
AATGTATGATAGTGGG
'''
pa = shorter_alignment()
pa = shorter_alignment

pa.align_with_window([0, 3])

Expand All @@ -100,18 +100,21 @@ def test_aln_shorter_sample():
assert pair[0] == None


def test_no_aln():
def test_no_aln(no_alignment):
'''
This alignment should be None
'''

pa = no_alignment()
pa = no_alignment
pa.align_all()
assert pa.alignment_pairs is None


def test_donor_alignment_hdr_indel_size():
assert donor_alignment_contiguous_insert().hdr_indel_size == 5
assert donor_alignment_noncontiguous_insert().hdr_indel_size == 7
assert donor_alignment_insert_and_deletion().hdr_indel_size == 3
assert donor_alignment_deletion().hdr_indel_size == -4
def test_donor_alignment_hdr_indel_size(donor_alignment_contiguous_insert,
donor_alignment_noncontiguous_insert,
donor_alignment_insert_and_deletion,
donor_alignment_deletion):
assert donor_alignment_contiguous_insert.hdr_indel_size == 5
assert donor_alignment_noncontiguous_insert.hdr_indel_size == 7
assert donor_alignment_insert_and_deletion.hdr_indel_size == 3
assert donor_alignment_deletion.hdr_indel_size == -4

0 comments on commit 3a30fa5

Please sign in to comment.