def test_fragment_stats(self):
"""Test the gathering of fragment statistics."""
top = path.dirname(__file__)
bam = path.join(top, "data/test_bam_stats/stat_test.bam")
ref = path.join(top, "data/test_bam_stats/stat_ref.fas")
references = SeqIO.index(ref, format='fasta')
chrom_lengths = {name: len(so) for name, so in six.iteritems(references)}
res = stats.frag_coverage(bam, chrom_lengths, region=None, min_aqual=0, verbose=False)
self.maxDiff = None
target = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
self.assertEqual(list(res['frags_fwd']['seq_0']), target)
评论列表
文章目录