def test_consensus(self): self.indel_algn.rewind() with pytest.raises(sam.UnmappedReadError): sam.consensus([self.single_read]) assert sam.consensus(list(self.indel_algn)) ==\ "AGATGACGGAAGCTTGATCTCACGAANNNNNNNNTTNNCATCCNNNTNNT" assert sam.consensus(self.reverse_complement_align) == \ "AAAGGGAAAA" self.mate_pair_align.rewind() mate_pair_loci = sam.expressed_loci(self.mate_pair_align) con = sam.consensus(next(mate_pair_loci)) assert con == self.mate_pair_consensus
def test_speed_test(): align = sam.SamAlignment(TEST_FOLDER + "/test_data/speed_test.sam") annotation = gff.GenomeAnnotation(TEST_FOLDER + "/test_data/speed_test.gff") for locus in sam.expressed_loci(align): gff.in_features(locus, annotation.features) sam.consensus(locus)