Exemplo n.º 1
0
    def test_claim_ignoresNonVcfExtensions(self):
        record1 = "chr1\t.\t.\t.\t.\t.\t.\t.\t."
        content1 = ["##foo", "##MuTect=123", "#chrom", record1]
        reader1 = MockFileReader("fileA.txt", content1)
        file_readers = [reader1]

        caller = mutect.Mutect()
        unrecognized_readers, vcf_readers = caller.claim(file_readers)

        self.assertEquals(1, len(unrecognized_readers))
        self.assertEquals([reader1], unrecognized_readers)
        self.assertEquals(0, len(vcf_readers))
Exemplo n.º 2
0
    def test_claim_metaheaderRecognizesMutectV2x(self):
        record1 = "chr1\t.\t.\t.\t.\t.\t.\t.\t."
        content1 = [
            "##foo", "##MuTect=2.1", "##FORMAT=<ID=FA,...>", "#chrom", record1
        ]
        reader1 = MockFileReader("fileA.vcf", content1)
        file_readers = [reader1]

        caller = mutect.Mutect()
        unrecognized_readers, vcf_readers = caller.claim(file_readers)

        self.assertEquals(0, len(unrecognized_readers))
        self.assertEquals(1, len(vcf_readers))
Exemplo n.º 3
0
    def test_claim_vcfExtensionCaseInsensitive(self):
        record1 = "chr1\t.\t.\t.\t.\t.\t.\t.\t."
        content1 = [
            "##foo", "##MuTect=123", "##FORMAT=<ID=AF,...>", "#chrom", record1
        ]
        reader1 = MockFileReader("fileA.VcF", content1)
        file_readers = [reader1]

        caller = mutect.Mutect()
        unrecognized_readers, vcf_readers = caller.claim(file_readers)

        self.assertEquals(0, len(unrecognized_readers))
        self.assertEquals(1, len(vcf_readers))
Exemplo n.º 4
0
    def test_claim_metaheaderRecognizesMutectV4x(self):
        record1 = "chr1\t.\t.\t.\t.\t.\t.\t.\t."
        content1 = [
            "##foo",
            '##GATKCommandLine=<ID=Mutect2,CommandLine="Mutect2 ...">',
            "##FORMAT=<ID=AF,...>", "#chrom", record1
        ]
        reader1 = MockFileReader("fileB.vcf", content1)
        file_readers = [reader1]

        caller = mutect.Mutect()
        unrecognized_readers, vcf_readers = caller.claim(file_readers)

        self.assertEquals(0, len(unrecognized_readers))
        self.assertEquals(1, len(vcf_readers))
Exemplo n.º 5
0
    def test_claim(self):
        record1 = "chr1\t.\t.\t.\t.\t.\t.\t.\t."
        content1 = ["##foo", "##source=strelka", "#chrom", record1]
        content2 = [
            "##foo", "##MuTect=123", "##FORMAT=<ID=AF,...>", "#chrom", record1
        ]
        reader1 = MockFileReader("fileA.vcf", content1)
        reader2 = MockFileReader("fileB.vcf", content2)
        file_readers = [reader1, reader2]

        caller = mutect.Mutect()
        unrecognized_readers, vcf_readers = caller.claim(file_readers)

        self.assertEquals(1, len(unrecognized_readers))
        self.assertEquals([reader1], unrecognized_readers)
        self.assertEquals(1, len(vcf_readers))
        self.assertIsInstance(vcf_readers[0], mutect._MutectVcfReader)
        self.assertEquals(reader2.file_name,
                          vcf_readers[0]._vcf_reader.file_name)
Exemplo n.º 6
0
 def setUp(self):
     super(MutectTestCase, self).setUp()
     self.caller = mutect.Mutect()
Exemplo n.º 7
0
 def __init__(self, args=None):
     self._callers = [
         varscan.Varscan(args),
         strelka.Strelka(),
         mutect.Mutect()
     ]