Ejemplo n.º 1
0
 def test_analyze_alignment_file_querysorted(self):
     arguments = ['alignment', 'myworkdir', 'mybamfile', 'mygenome']
     options = parse_arguments('1.2.0', arguments)
     signatures = analyze_alignment_file_querysorted(
         self.alignment_file, options)
     self.assertEqual(
         len([sig for sig in signatures if sig.signature == "cigar"]), 0)
Ejemplo n.º 2
0
    def test_combine(self):
        with tempfile.TemporaryDirectory() as tmpdirname:
            options = parse_arguments('1.2.0', ['alignment', tmpdirname, 'mybamfile', 'mygenome'])
            signature_clusters = cluster_sv_signatures(self.signatures, options)

            # Write SV signature clusters
            write_signature_clusters_bed(options.working_dir, signature_clusters)
            write_signature_clusters_vcf(options.working_dir, signature_clusters, '1.2.0')

            combine_clusters(signature_clusters, options)
Ejemplo n.º 3
0
 def test_parse_arguments(self):
     arguments = ['alignment', 'myworkdir', 'mybamfile', 'myalignment']
     options = parse_arguments('1.2.0', arguments)
     self.assertEqual(type(options.min_mapq), int)
     self.assertEqual(type(options.min_sv_size), int)
     self.assertEqual(type(options.max_sv_size), int)
     self.assertEqual(type(options.segment_gap_tolerance), int)
     self.assertEqual(type(options.segment_overlap_tolerance), int)
     self.assertEqual(type(options.partition_max_distance), int)
     self.assertEqual(type(options.distance_normalizer), int)
     self.assertEqual(type(options.cluster_max_distance), float)
     self.assertEqual(type(options.del_ins_dup_max_distance), float)
     self.assertEqual(type(options.trans_sv_max_distance), int)
     self.assertEqual(type(options.sample), str)
Ejemplo n.º 4
0
 def setUp(self):
     self.signatures = []
     for i in range(10):
         center = 100000 + uniform(-100, 100)
         half_span = 1000 + uniform(-100, 100)
         new_sig = SignatureDeletion("chr1", center - half_span,
                                     center + half_span, "cigar", str(i))
         self.signatures.append(new_sig)
     for i in range(10, 20):
         center = 200000 + uniform(-100, 100)
         half_span = 1000 + uniform(-100, 100)
         new_sig = SignatureDeletion("chr1", center - half_span,
                                     center + half_span, "cigar", str(i))
         self.signatures.append(new_sig)
     for i in range(20, 30):
         center = 100000 + uniform(-100, 100)
         half_span = 2000 + uniform(-100, 100)
         new_sig = SignatureDeletion("chr1", center - half_span,
                                     center + half_span, "cigar", str(i))
         self.signatures.append(new_sig)
     self.options = parse_arguments(
         '1.2.0', ['alignment', 'myworkdir', 'mybamfile', 'mygenome'])