def test_7_calculate_snp_distances(self): """Run calculate_snp_distances and verify snp_distance_matrix.tsv contains expected contents. """ command_line = "distance -f " + os.path.join(self.__class__.directory_run_result, 'snpma.fasta') + ' ' + \ "--matrix " + os.path.join(self.__class__.directory_run_result, 'snp_distance_matrix.tsv') args = cfsan_snp_pipeline.parse_command_line(command_line) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snp_distance_matrix.tsv')
def test_3_call_consensus(self): """Run call_consensus and verify consensus.fasta and consensus.vcf contain expected contents for each sample. """ command_line = "call_consensus -f -l " + os.path.join(self.__class__.directory_run_result, 'snplist.txt') + \ " --vcfRefName lambda_virus.fasta" + \ " --vcfFailedSnpGt 1" + \ " dummyAllPileupFile" args = cfsan_snp_pipeline.parse_command_line(command_line) ignore_lines = ["##fileDate", "##source"] for dir in [ 'samples/sample1', 'samples/sample2', 'samples/sample3', 'samples/sample4' ]: args.allPileupFile = os.path.join( self.__class__.directory_run_result, dir, 'reads.all.pileup') args.consensusFile = os.path.join( self.__class__.directory_run_result, dir, 'consensus.fasta') args.vcfFileName = None self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, os.path.join(dir, 'consensus.fasta')) args.vcfFileName = 'consensus.vcf' self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, os.path.join(dir, 'consensus.vcf'), ignore_lines)
def test_4_create_snp_matrix(self): """Run snp_matrix and verify snpma.fasta contains expected contents. """ command_line = "snp_matrix -f -o " + os.path.join(self.__class__.directory_run_result, 'snpma.fasta') + ' ' + \ os.path.join(self.__class__.directory_run_result, 'sampleDirectories.txt') args = cfsan_snp_pipeline.parse_command_line(command_line) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snpma.fasta')
def test_7_calculate_snp_distances(self): """Run calculate_snp_distances and verify snp_distance_matrix.tsv contains expected contents. """ command_line = "distance -f " + os.path.join(self.__class__.directory_run_result, 'snpma.fasta') + ' ' + \ "--matrix " + os.path.join(self.__class__.directory_run_result, 'snp_distance_matrix.tsv') args = cfsan_snp_pipeline.parse_command_line(command_line) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snp_distance_matrix.tsv')
def test_4_create_snp_matrix(self): """Run snp_matrix and verify snpma.fasta contains expected contents. """ command_line = "snp_matrix -f -o " + os.path.join(self.__class__.directory_run_result, 'snpma.fasta') + ' ' + \ os.path.join(self.__class__.directory_run_result, 'sampleDirectories.txt') args = cfsan_snp_pipeline.parse_command_line(command_line) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snpma.fasta')
def test_5_create_snp_reference_seq(self): """Run create_snp_reference_seq and verify referenceSNP.fasta contains expected contents. """ command_line = "snp_reference -f -l " + os.path.join(self.__class__.directory_run_result, 'snplist.txt') + \ " -o " + os.path.join(self.__class__.directory_run_result, 'referenceSNP.fasta') + ' ' + \ os.path.join(self.__class__.directory_run_result, 'reference/lambda_virus.fasta') args = cfsan_snp_pipeline.parse_command_line(command_line) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'referenceSNP.fasta')
def test_2_merge_sites(self): """Run merge_sites and verify snplist.txt contains expected contents. """ command_line = "merge_sites -f -o " + os.path.join(self.__class__.directory_run_result, 'snplist.txt') + ' ' + \ os.path.join(self.__class__.directory_run_result, 'sampleDirectories.txt') + ' ' + \ os.path.join(self.__class__.directory_run_result, 'filteredSampleDirectories.txt') args = cfsan_snp_pipeline.parse_command_line(command_line) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snplist.txt')
def test_5_create_snp_reference_seq(self): """Run create_snp_reference_seq and verify referenceSNP.fasta contains expected contents. """ command_line = "snp_reference -f -l " + os.path.join(self.__class__.directory_run_result, 'snplist.txt') + \ " -o " + os.path.join(self.__class__.directory_run_result, 'referenceSNP.fasta') + ' ' + \ os.path.join(self.__class__.directory_run_result, 'reference/lambda_virus.fasta') args = cfsan_snp_pipeline.parse_command_line(command_line) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'referenceSNP.fasta')
def test_2_merge_sites(self): """Run merge_sites and verify snplist.txt contains expected contents. """ command_line = "merge_sites -f -o " + os.path.join(self.__class__.directory_run_result, 'snplist.txt') + ' ' + \ os.path.join(self.__class__.directory_run_result, 'sampleDirectories.txt') + ' ' + \ os.path.join(self.__class__.directory_run_result, 'filteredSampleDirectories.txt') args = cfsan_snp_pipeline.parse_command_line(command_line) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, 'snplist.txt')
def test_1_filter_regions(self): """Run filter_regions and verify var.flt_preserved.vcf and var.flt_removed.vcf contains expected contents for each sample. """ command_line = "filter_regions -f " + \ os.path.join(self.__class__.directory_run_result, 'sampleDirectories.txt') + ' ' + \ os.path.join(self.__class__.directory_run_result, "reference", "lambda_virus.fasta") args = cfsan_snp_pipeline.parse_command_line(command_line) for dir in ['samples/sample1', 'samples/sample2','samples/sample3','samples/sample4']: self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, os.path.join(dir, 'var.flt_preserved.vcf')) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, os.path.join(dir, 'var.flt_removed.vcf'))
def test_1_filter_regions(self): """Run filter_regions and verify var.flt_preserved.vcf and var.flt_removed.vcf contains expected contents for each sample. """ command_line = "filter_regions -f " + \ os.path.join(self.__class__.directory_run_result, 'sampleDirectories.txt') + ' ' + \ os.path.join(self.__class__.directory_run_result, "reference", "lambda_virus.fasta") args = cfsan_snp_pipeline.parse_command_line(command_line) for dir in [ 'samples/sample1', 'samples/sample2', 'samples/sample3', 'samples/sample4' ]: self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, os.path.join(dir, 'var.flt_preserved.vcf')) self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, os.path.join(dir, 'var.flt_removed.vcf'))
def test_3_call_consensus(self): """Run call_consensus and verify consensus.fasta and consensus.vcf contain expected contents for each sample. """ command_line = "call_consensus -f -l " + os.path.join(self.__class__.directory_run_result, 'snplist.txt') + \ " --vcfRefName lambda_virus.fasta" + \ " --vcfFailedSnpGt 1" + \ " dummyAllPileupFile" args = cfsan_snp_pipeline.parse_command_line(command_line) ignore_lines = ["##fileDate", "##source"] for dir in ['samples/sample1', 'samples/sample2','samples/sample3','samples/sample4']: args.allPileupFile = os.path.join(self.__class__.directory_run_result, dir, 'reads.all.pileup') args.consensusFile = os.path.join(self.__class__.directory_run_result, dir, 'consensus.fasta') args.vcfFileName = None self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, os.path.join(dir, 'consensus.fasta')) args.vcfFileName = 'consensus.vcf' self.run_function_test(cfsan_snp_pipeline.run_command_from_args, args, os.path.join(dir, 'consensus.vcf'), ignore_lines)