Exemplo n.º 1
0
 def test_fetch_single_read(self):
     b = BamCache(get_data('mini_mock_reads_for_events.sorted.bam'))
     s = b.fetch_from_bins('reference3', 1382, 1383, read_limit=1, sample_bins=1)
     self.assertEqual(1, len(s))
     r = list(s)[0]
     self.assertEqual('HISEQX1_11:4:2122:14275:37717:split', r.qname)
     b.close()
Exemplo n.º 2
0
 def test_genome_bam_stats(self):
     bamfh = BamCache(get_data('mock_reads_for_events.sorted.bam'))
     stats = compute_genome_bam_stats(
         bamfh, 1000, 100, min_mapping_quality=1, sample_cap=10000, distribution_fraction=0.99
     )
     self.assertGreaterEqual(50, abs(stats.median_fragment_size - 420))
     self.assertEqual(150, stats.read_length)
     bamfh.close()
Exemplo n.º 3
0
 def test_fetch_single_read(self):
     b = BamCache(BAM_INPUT)
     s = b.fetch_from_bins('reference3',
                           1382,
                           1383,
                           read_limit=1,
                           sample_bins=1)
     self.assertEqual(1, len(s))
     r = list(s)[0]
     self.assertEqual('HISEQX1_11:4:2122:14275:37717:split', r.qname)
     b.close()
Exemplo n.º 4
0
 def test_genome_bam_stats(self):
     bamfh = BamCache(FULL_BAM_INPUT)
     stats = compute_genome_bam_stats(bamfh,
                                      1000,
                                      100,
                                      min_mapping_quality=1,
                                      sample_cap=10000,
                                      distribution_fraction=0.99)
     self.assertGreaterEqual(50, abs(stats.median_fragment_size - 420))
     self.assertEqual(150, stats.read_length)
     bamfh.close()
Exemplo n.º 5
0
 def test_trans_bam_stats(self):
     bamfh = BamCache(TRANSCRIPTOME_BAM_INPUT)
     annotations = load_reference_genes(
         FULL_REFERENCE_ANNOTATIONS_FILE_JSON)
     stats = compute_transcriptome_bam_stats(bamfh,
                                             annotations,
                                             100,
                                             min_mapping_quality=1,
                                             stranded=True,
                                             sample_cap=10000,
                                             distribution_fraction=0.99)
     self.assertTrue(abs(stats.median_fragment_size - 185) < 5)
     self.assertEqual(75, stats.read_length)
     self.assertTrue(stats.stdev_fragment_size < 50)
     bamfh.close()
Exemplo n.º 6
0
 def test_trans_bam_stats(self):
     bamfh = BamCache(get_data('mock_trans_reads_for_events.sorted.bam'))
     annotations = load_reference_genes(get_data('mock_annotations.json'))
     stats = compute_transcriptome_bam_stats(
         bamfh,
         annotations,
         100,
         min_mapping_quality=1,
         stranded=True,
         sample_cap=10000,
         distribution_fraction=0.99,
     )
     self.assertTrue(abs(stats.median_fragment_size - 185) < 5)
     self.assertEqual(75, stats.read_length)
     self.assertTrue(stats.stdev_fragment_size < 50)
     bamfh.close()