示例#1
0
 def _write_mlst_reports(cls,
                         mlst_profile_file,
                         ariba_report_tsv,
                         outprefix,
                         verbose=False):
     if os.path.exists(mlst_profile_file):
         if verbose:
             print('\nMaking MLST reports', flush=True)
         reporter = mlst_reporter.MlstReporter(ariba_report_tsv,
                                               mlst_profile_file, outprefix)
         reporter.run()
示例#2
0
 def test_new_set(self):
     '''test when allele combination is new'''
     profile_in = os.path.join(data_dir, 'mlst_reporter.profile.in.tsv')
     report_in = os.path.join(data_dir, 'mlst_reporter.new_st.report.in.tsv')
     expected_out_simple = os.path.join(data_dir, 'mlst_reporter.new_st.report.out.tsv')
     expected_out_all = os.path.join(data_dir, 'mlst_reporter.new_st.report.out.details.tsv')
     tmp_out = 'tmp.mlst_reporter.test_new_st'
     got_simple = tmp_out + '.tsv'
     got_details = tmp_out + '.details.tsv'
     reporter = mlst_reporter.MlstReporter(report_in, profile_in, tmp_out)
     reporter.run()
     self.assertTrue(filecmp.cmp(expected_out_simple, got_simple, shallow=False))
     self.assertTrue(filecmp.cmp(expected_out_all, got_details, shallow=False))
     os.unlink(got_simple)
     os.unlink(got_details)
示例#3
0
 def test_het_snps(self):
     '''test when one gene has two het snps'''
     profile_in = os.path.join(data_dir, 'mlst_reporter.profile.in.tsv')
     report_in = os.path.join(data_dir, 'mlst_reporter.het_snps.in.tsv')
     expected_out_simple = os.path.join(data_dir, 'mlst_reporter.het_snps.out.tsv')
     expected_out_all = os.path.join(data_dir, 'mlst_reporter.het_snps.out.details.tsv')
     tmp_out = 'tmp.mlst_reporter.test_het_snps'
     got_simple = tmp_out + '.tsv'
     got_details = tmp_out + '.details.tsv'
     reporter = mlst_reporter.MlstReporter(report_in, profile_in, tmp_out)
     reporter.run()
     self.assertTrue(filecmp.cmp(expected_out_simple, got_simple, shallow=False))
     self.assertTrue(filecmp.cmp(expected_out_all, got_details, shallow=False))
     os.unlink(got_simple)
     os.unlink(got_details)
示例#4
0
 def test_all_present_perfect(self):
     '''test when all alleles 100% there no variants'''
     profile_in = os.path.join(data_dir, 'mlst_reporter.profile.in.tsv')
     report_in = os.path.join(data_dir, 'mlst_reporter.all_present_perfect.report.in.tsv')
     expected_out_simple = os.path.join(data_dir, 'mlst_reporter.all_present_perfect.report.out.tsv')
     expected_out_all = os.path.join(data_dir, 'mlst_reporter.all_present_perfect.report.out.details.tsv')
     tmp_out = 'tmp.mlst_reporter.test_all_present_perfect'
     got_simple = tmp_out + '.tsv'
     got_details = tmp_out + '.details.tsv'
     reporter = mlst_reporter.MlstReporter(report_in, profile_in, tmp_out)
     reporter.run()
     self.assertTrue(filecmp.cmp(expected_out_simple, got_simple, shallow=False))
     self.assertTrue(filecmp.cmp(expected_out_all, got_details, shallow=False))
     os.unlink(got_simple)
     os.unlink(got_details)