Beispiel #1
0
    def test_ref_deletion(self):
        v3loop_ref = 'TGTACAAGACCCAACAAC'
        counts = [(("TGTACA---AGACCCAAC", "TGTACAGGGAGACCCAAC"), 2)]
        hiv_seed = "ATGTACAGGGAGACCCAACAAC"
        aligned_csv = DummyFile()
        expected_aligned_csv = """\
refname,qcut,rank,count,offset,seq
HIV1-CON-XX-Consensus-seed,15,0,2,1,TGTACA---AGACCCAAC
"""

        list(write_aligned_reads(counts, aligned_csv, hiv_seed, v3loop_ref))

        self.assertEqual(expected_aligned_csv, aligned_csv.getvalue())
Beispiel #2
0
    def test_ref_deletion(self):
        v3loop_ref = 'TGTACAAGACCCAACAAC'
        counts = [(("TGTACA---AGACCCAAC", "TGTACAGGGAGACCCAAC"), 2)]
        hiv_seed = "ATGTACAGGGAGACCCAACAAC"
        aligned_csv = DummyFile()
        expected_aligned_csv = """\
refname,qcut,rank,count,offset,seq
HIV1-CON-XX-Consensus-seed,15,0,2,1,TGTACA---AGACCCAAC
"""

        list(write_aligned_reads(counts, aligned_csv, hiv_seed, v3loop_ref))

        self.assertEqual(expected_aligned_csv, aligned_csv.getvalue())
Beispiel #3
0
    def test_ref_insertion(self):
        v3loop_ref = 'TGTACAAGACCCAACAAC'
        counts = [(("TGTACAAGACCCAAC", "TGTACAAGACCCAAC"), 2)]
        # inserted codon   ^^^ shouldn't be included in aligned seq.
        hiv_seed = "ATGTACACCCAACAAC"
        aligned_csv = DummyFile()
        expected_aligned_csv = """\
refname,qcut,rank,count,offset,seq
HIV1-CON-XX-Consensus-seed,15,0,2,1,TGTACACCCAAC
"""

        list(write_aligned_reads(counts, aligned_csv, hiv_seed, v3loop_ref))

        self.assertEqual(expected_aligned_csv, aligned_csv.getvalue())
Beispiel #4
0
    def test_ref_insertion(self):
        v3loop_ref = 'TGTACAAGACCCAACAAC'
        counts = [(("TGTACAAGACCCAAC", "TGTACAAGACCCAAC"), 2)]
        # inserted codon   ^^^ shouldn't be included in aligned seq.
        hiv_seed = "ATGTACACCCAACAAC"
        aligned_csv = DummyFile()
        expected_aligned_csv = """\
refname,qcut,rank,count,offset,seq
HIV1-CON-XX-Consensus-seed,15,0,2,1,TGTACACCCAAC
"""

        list(write_aligned_reads(counts, aligned_csv, hiv_seed, v3loop_ref))

        self.assertEqual(expected_aligned_csv, aligned_csv.getvalue())
Beispiel #5
0
    def test_counts(self):
        v3loop_ref = 'TGTACAAGACCCAACAAC'
        counts = [(("TGTACAAGACCCAAC", "TGTACAAGACCCAAC"), 2),
                  (("TGTACAAGACCCAAC", "AGAACAAGACCCAAC"), 1)]
        seed = "AAAAATGTACAAGACACAACAAC"
        aligned_csv = DummyFile()
        expected_aligned_csv = """\
refname,qcut,rank,count,offset,seq
HIV1-CON-XX-Consensus-seed,15,0,2,5,TGTACAAGACCCAAC
HIV1-CON-XX-Consensus-seed,15,1,1,5,AGAACAAGACCCAAC
"""

        counts2 = list(write_aligned_reads(counts, aligned_csv, seed, v3loop_ref))

        self.assertEqual(expected_aligned_csv, aligned_csv.getvalue())
        self.assertEqual(counts, counts2)