def testSamtoolsMpileupSingleThread(self): Grid.useGrid = False SamtoolsMpileup.SamtoolsMpileup(TestSnvCaller.testPool).callSnvs() outputFile = TestSnvCaller.testPool.vcf[None].fileName self.assertEqual( os.path.abspath(outputFile), os.path.abspath(TestSnvCaller.expVcfFile), os.path.abspath(outputFile) + " not is " + os.path.abspath(TestSnvCaller.expVcfFile)) #Check if the file contains exactly one snp self.checkNoOfSnps(TestSnvCaller.expVcfFile)
def testSamtoolsPath(self): SnvCaller.converting = "not done" gzFile = "../testFiles/input/test.fq.gz" refGzFile = "../testFiles/input/revTest.fq.gz" TestSnvCaller.sample.bam = None TestSnvCaller.sample.setForwardFq(gzFile) TestSnvCaller.sample.setReversedFq(refGzFile) TestSnvCaller.sample.reversedFq.forward = False samt = SamtoolsMpileup.SamtoolsMpileup(TestSnvCaller.testPool) samt.callSnvs() outputFile = TestSnvCaller.testPool.vcf[None].fileName self.assertEqual( os.path.abspath(outputFile), os.path.abspath(TestSnvCaller.expVcfFile), os.path.abspath(outputFile) + " not is " + os.path.abspath(TestSnvCaller.expVcfFile)) #Check if the file contains exactly one snp self.checkNoOfSnps(TestSnvCaller.expVcfFile)
def testSamtoolsMultiple(self): #add an extra sample to the pool TestSnvCaller.sample2 = Sample.Sample(TestSnvCaller.testPool, "testLib2") TestSnvCaller.sample2.bam = BamFile.BamFile(TestSnvCaller.testPool, TestSnvCaller.sample2, TestSnvCaller.inputBam) TestSnvCaller.testPool.addSample(TestSnvCaller.sample2) #Execute and check execution output SamtoolsMpileup.SamtoolsMpileup(TestSnvCaller.testPool).callSnvs() outputFile = TestSnvCaller.testPool.vcf[None].fileName self.assertEqual( os.path.abspath(outputFile), os.path.abspath(TestSnvCaller.expVcfFile), os.path.abspath(outputFile) + " not is " + os.path.abspath(TestSnvCaller.expVcfFile)) #Check if the file contains exactly one snp self.checkNoOfSnps(TestSnvCaller.expVcfFile)