def test_read_updates_1(self): c_1 = ['AAAATCA', 'AATCAGG', 'TTTTTTT'] contig_dict_1 = mc.merge_check_global(c_1, 3) bbr_test_1 = mc.suffix_filter(contig_dict_1) bbl_test_1 = mc.extract_bbl(bbr_test_1) contig_trace_test_1 = mc.trace_contigs(bbl_test_1) new_contigs_test_1 = mc.merge_contigs(contig_trace_test_1, c_1[:]) reads_dict_1 = { 'AAAAT': [[0, 0, 0.5, 1]], 'AAATC': [[0, 1, 0.5, 1]], 'AATCA': [[0, 2, 0.5, 1], [1, 0, 0.5, 1]], 'ATCAG': [[1, 1, 0.5, 1]], 'TTTTT': [[2, 0, 0.5, 1]] } reverse_dict_test_1 = mc.reverse_reads_dict(reads_dict_1) new_reads_dict_test_1 = mc.change_reads_on_merge( reverse_dict_test_1, reads_dict_1, contig_trace_test_1, c_1, new_contigs_test_1) new_reads_dict_truth_1 = { 'ATCAG': [[0, 3, 0.5, 1]], 'AATCA': [[0, 2, 0.5, 1]], 'AAAAT': [[0, 0, 0.5, 1]], 'TTTTT': [[1, 0, 0.5, 1]], 'AAATC': [[0, 1, 0.5, 1]] } self.assertEqual(new_reads_dict_truth_1, new_reads_dict_test_1)
def test_three_contig_3(self): c_1 = ['GATCTAAA', 'CCCGAAAA','AAAAGATC'] contig_dict_1 = mc.merge_check_global(c_1, 3) bbr_test_1 = mc.suffix_filter(contig_dict_1) bbl_test_1 = mc.extract_bbl(bbr_test_1) contig_trace_test_1 = mc.trace_contigs(bbl_test_1) contig_trace_truth_1 = [[['CCCGAAAA',0],['AAAAGATC',4],['GATCTAAA',4]]] self.assertEqual(contig_trace_test_1, contig_trace_truth_1)
def test_three_contig_4(self): c_1 = ['GATCTAAA', 'CCCGAAAA', 'AAAAGATC'] contig_dict_1 = mc.merge_check_global(c_1, 3) bbr_test_1 = mc.suffix_filter(contig_dict_1) bbl_test_1 = mc.extract_bbl(bbr_test_1) contig_trace_test_1 = mc.trace_contigs(bbl_test_1) new_contigs_test_1 = mc.merge_contigs(contig_trace_test_1, c_1) new_contigs_truth_1 = ['CCCGAAAAGATCTAAA'] self.assertEqual(new_contigs_test_1, new_contigs_truth_1)
def test_read_updates_1(self): c_1 = ['AAAATCA', 'AATCAGG', 'TTTTTTT'] contig_dict_1 = mc.merge_check_global(c_1,3) bbr_test_1 = mc.suffix_filter(contig_dict_1) bbl_test_1 = mc.extract_bbl(bbr_test_1) contig_trace_test_1 = mc.trace_contigs(bbl_test_1) new_contigs_test_1 = mc.merge_contigs(contig_trace_test_1, c_1[:]) reads_dict_1 = {'AAAAT':[[0,0,0.5,1]],'AAATC':[[0,1,0.5,1]],'AATCA':[[0,2,0.5,1],[1,0,0.5,1]],'ATCAG':[[1,1,0.5,1]],'TTTTT':[[2,0,0.5,1]]} reverse_dict_test_1 = mc.reverse_reads_dict(reads_dict_1) new_reads_dict_test_1 = mc.change_reads_on_merge(reverse_dict_test_1, reads_dict_1, contig_trace_test_1, c_1, new_contigs_test_1) new_reads_dict_truth_1 = {'ATCAG': [[0,3,0.5,1]], 'AATCA': [[0,2,0.5,1]], 'AAAAT': [[0,0,0.5,1]], 'TTTTT': [[1,0,0.5,1]], 'AAATC': [[0,1,0.5,1]]} self.assertEqual(new_reads_dict_truth_1, new_reads_dict_test_1)