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))
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))
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))
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))
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)
def setUp(self): super(MutectTestCase, self).setUp() self.caller = mutect.Mutect()
def __init__(self, args=None): self._callers = [ varscan.Varscan(args), strelka.Strelka(), mutect.Mutect() ]