def test_ompk36td_non_kp_complex(self): """ Setting the Kp complex variable to False should turn off the OmpK tests. """ results = get_resistance_results(self.data_dir, 'test/sequences/test_res_omp_6.fasta', self.args, self.res_headers, False) self.assertTrue('OmpK36TD' not in results['Omp'])
def test_ompk35_early_stop(self): """ This tests an early stop mutation (without a frameshift) in OmpK35. """ results = get_resistance_results(self.data_dir, 'test/sequences/test_res_omp_3.fasta', self.args, self.res_headers, True) self.assertTrue('OmpK35-' in results['Omp'])
def test_ompk35_frameshift(self): """ A frameshift in OmpK35 should cause an early stop and lead to a carbapenem resistance call. """ results = get_resistance_results(self.data_dir, 'test/sequences/test_res_omp_2.fasta', self.args, self.res_headers, True) self.assertTrue('OmpK35-' in results['Omp'])
def test_pmrb_early_stop(self): """ This tests an early stop mutation (without a frameshift) in pmrB. """ results = get_resistance_results(self.resblast, self.data_folder, 'test/test_res_mgrb_pmrb_3.fasta', self.args, self.res_headers) self.assertTrue('PmrB' in results['Col'])
def test_mgrb_missing_non_kp_complex(self): """ Setting the Kp complex variable to False should turn off the MgrB/PmrB tests. """ results = get_resistance_results( self.data_dir, 'test/sequences/test_res_mgrb_pmrb_4.fasta', self.args, self.res_headers, False) self.assertTrue('MgrB-' not in results['Col'])
def test_pmrb_frameshift(self): """ A frameshift in pmrB should cause an early stop and lead to a colisitin resistance call. """ results = get_resistance_results(self.resblast, self.data_folder, 'test/test_res_mgrb_pmrb_2.fasta', self.args, self.res_headers) self.assertTrue('PmrB' in results['Col'])
def test_gyra_and_parc_non_kp_complex(self): """ Setting the Kp complex variable to False should turn off the QRDR tests. """ results = get_resistance_results(self.data_dir, 'test/sequences/test_res_qrdr_4.fasta', self.args, self.res_headers, False) self.assertTrue('GyrA-83C' not in results['Flq']) self.assertTrue('ParC-84D' not in results['Flq'])
def get_all_results(self, contigs): results = {'strain': get_strain_name(contigs)} results.update(get_contig_stat_results(contigs)) results.update(get_species_results(contigs, self.data_dir)) kp_complex = is_kp_complex(results) results.update( get_chromosome_mlst_results(self.data_dir, contigs, kp_complex)) results.update(get_ybt_mlst_results(self.data_dir, contigs)) results.update(get_clb_mlst_results(self.data_dir, contigs)) results.update(get_iuc_mlst_results(self.data_dir, contigs)) results.update(get_iro_mlst_results(self.data_dir, contigs)) results.update(get_hypermucoidy_results(self.data_dir, contigs)) results.update(get_wzi_and_k_locus_results(self.data_dir, contigs)) results.update( get_resistance_results(self.data_dir, contigs, self.args, self.res_headers, kp_complex)) results.update(get_summary_results(results, self.res_headers)) return results
def test_no_mutations(self): results = get_resistance_results(self.data_dir, 'test/sequences/test_res_qrdr_1.fasta', self.args, self.res_headers, True) self.assertEqual(results['Flq'], '-')
def test_ompk36td(self): results = get_resistance_results(self.data_dir, 'test/sequences/test_res_omp_6.fasta', self.args, self.res_headers, True) self.assertTrue('OmpK36TD' in results['Omp'])
def test_both_genes_intact(self): results = get_resistance_results(self.data_dir, 'test/sequences/test_res_omp_1.fasta', self.args, self.res_headers, True) self.assertEqual(results['Omp'], '-')
def test_mgrb_missing(self): results = get_resistance_results( self.data_dir, 'test/sequences/test_res_mgrb_pmrb_4.fasta', self.args, self.res_headers, True) self.assertTrue('MgrB-' in results['Col'])
def test_both_genes_intact(self): results = get_resistance_results(self.resblast, self.data_folder, 'test/test_res_mgrb_pmrb_1.fasta', self.args, self.res_headers) self.assertEqual(results['Col'], '-')
def test_pmrb_early_stop_SRR2098701(self): results = get_resistance_results(self.data_dir, 'test/sequences/SRR2098701.fasta', self.args, self.res_headers, True) self.assertTrue('PmrB-' in results['Col'])
def test_gyra_and_parc(self): results = get_resistance_results(self.data_dir, 'test/sequences/test_res_qrdr_4.fasta', self.args, self.res_headers, True) self.assertTrue('GyrA-83C' in results['Flq']) self.assertTrue('ParC-84D' in results['Flq'])
def test_mgrb_missing(self): results = get_resistance_results(self.resblast, self.data_folder, 'test/test_res_mgrb_pmrb_4.fasta', self.args, self.res_headers) self.assertTrue('MgrB' in results['Col'])
def test_tem(self): results = get_resistance_results(self.data_dir, 'test/sequences/tem.fasta', self.args, self.res_headers, True) self.assertEqual(results['Bla_ESBL'], '-') self.assertEqual(results['Bla'], 'TEM-1D^')