def test_unmasked_seq_location_detector(): "it detects the location of the unmasked seq regions" seq = SeqWithQuality(seq=Seq("AATTaaTTaaTTT"), name="seq") locations = _get_unmasked_locations(seq) assert locations[0] == (0, 3) assert locations[1] == (6, 7) assert locations[2] == (10, 12) seq = SeqWithQuality(seq=Seq("AATT"), name="seq") locations = _get_unmasked_locations(seq) assert locations[0] == (0, 3) seq = SeqWithQuality(seq=Seq("aatt"), name="seq") locations = _get_unmasked_locations(seq) assert not locations
def test_unmasked_seq_location_detector(): 'it detects the location of the unmasked seq regions' seq = SeqWithQuality(seq=Seq('AATTaaTTaaTTT'), name='seq') locations = _get_unmasked_locations(seq) assert locations[0] == (0, 3) assert locations[1] == (6, 7) assert locations[2] == (10, 12) seq = SeqWithQuality(seq=Seq('AATT'), name='seq') locations = _get_unmasked_locations(seq) assert locations[0] == (0, 3) seq = SeqWithQuality(seq=Seq('aatt'), name='seq') locations = _get_unmasked_locations(seq) assert not locations
def test_get_matched_regions(): "it tests get_matched_region function" seq1 = "AATTaatAATTAATtctcTTCtctctctctctcGCGCGCGCGCCC" seq = SeqWithQuality(seq=Seq(seq1), name="seq") locations = _get_unmasked_locations(seq) seqs = list(_get_matched_locations(seq, locations, 3)) assert str(seqs[0].seq) == "AATT" assert str(seqs[1].seq) == "AATTAAT" assert str(seqs[2].seq) == "TTC" assert str(seqs[3].seq) == "GCGCGCGCGCCC" seqs = list(_get_matched_locations(seq, locations, 5)) assert str(seqs[0].seq) == "AATTAAT" assert str(seqs[1].seq) == "GCGCGCGCGCCC"
def test_get_matched_regions(): 'it tests get_matched_region function' seq1 = 'AATTaatAATTAATtctcTTCtctctctctctcGCGCGCGCGCCC' seq = SeqWithQuality(seq=Seq(seq1), name='seq') locations = _get_unmasked_locations(seq) seqs = list(_get_matched_locations(seq, locations, 3)) assert str(seqs[0].seq) == 'AATT' assert str(seqs[1].seq) == 'AATTAAT' assert str(seqs[2].seq) == 'TTC' assert str(seqs[3].seq) == 'GCGCGCGCGCCC' seqs = list(_get_matched_locations(seq, locations, 5)) assert str(seqs[0].seq) == 'AATTAAT' assert str(seqs[1].seq) == 'GCGCGCGCGCCC'