def test_batch(self): """The 'batch' command.""" target_bed = "formats/my-targets.bed" fasta = "formats/chrM-Y-trunc.hg19.fa" bam = "formats/na12878-chrM-Y-trunc.bam" annot = "formats/my-refflat.bed" # Build a single-sample WGS reference ref_fname, tgt_bed_fname, _ = batch.batch_make_reference( [bam], None, None, True, fasta, annot, True, 500, None, None, None, None, 'build', 1, False, "wgs") self.assertEqual(ref_fname, 'build/reference.cnn') refarr = cnvlib.read(ref_fname, 'bed') tgt_regions = tabio.read(tgt_bed_fname, 'bed') self.assertEqual(len(refarr), len(tgt_regions)) # Build a single-sample hybrid-capture reference ref_fname, tgt_bed_fname, anti_bed_fname = batch.batch_make_reference( [bam], target_bed, None, True, fasta, None, True, 10, None, 1000, 100, None, 'build', 1, False, "hybrid") self.assertEqual(ref_fname, 'build/reference.cnn') refarr = cnvlib.read(ref_fname, 'bed') tgt_regions = tabio.read(tgt_bed_fname, 'bed') anti_regions = tabio.read(anti_bed_fname, 'bed') self.assertEqual(len(refarr), len(tgt_regions) + len(anti_regions)) # Run the same sample batch.batch_run_sample(bam, tgt_bed_fname, anti_bed_fname, ref_fname, 'build', True, True, True, None, False, False, "hybrid", 1) cns = cnvlib.read("build/na12878-chrM-Y-trunc.cns") self.assertGreater(len(cns), 0)
def test_batch(self): """The 'batch' command.""" target_bed = "formats/my-targets.bed" fasta = "formats/chrM-Y-trunc.hg19.fa" bam = "formats/na12878-chrM-Y-trunc.bam" annot = "formats/my-refflat.bed" # Build a single-sample WGS reference ref_fname, tgt_bed_fname, _ = batch.batch_make_reference( [bam], None, None, True, fasta, annot, True, 500, None, None, None, None, 'build', 1, False, "wgs") self.assertEqual(ref_fname, 'build/reference.cnn') refarr = cnvlib.read(ref_fname, 'bed') tgt_regions = tabio.read(tgt_bed_fname, 'bed') self.assertEqual(len(refarr), len(tgt_regions)) # Build a single-sample hybrid-capture reference ref_fname, tgt_bed_fname, anti_bed_fname = batch.batch_make_reference( [bam], target_bed, None, True, fasta, None, True, 10, None, 1000, 100, None, 'build', 1, False, "hybrid") self.assertEqual(ref_fname, 'build/reference.cnn') refarr = cnvlib.read(ref_fname, 'bed') tgt_regions = tabio.read(tgt_bed_fname, 'bed') anti_regions = tabio.read(anti_bed_fname, 'bed') self.assertEqual(len(refarr), len(tgt_regions) + len(anti_regions)) # Run the same sample batch.batch_run_sample( bam, tgt_bed_fname, anti_bed_fname, ref_fname, 'build', True, True, True, None, False, False, "hybrid", 1) cns = cnvlib.read("build/na12878-chrM-Y-trunc.cns") self.assertGreater(len(cns), 0)