예제 #1
0
 def test_rhinoscleromatis(self):
     contigs = 'test/sequences/GCF_000163455.1.fna.gz'
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(contigs, tmp_dir)
         results = get_chromosome_mlst_results(self.data_dir, contigs, True)
         self.assertEqual(results['ST'], 'ST67 (subsp. rhinoscleromatis)')
         self.assertEqual(results['Chr_ST'], 'ST67')
예제 #2
0
 def test_GCF_003400925(self):
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(
             'test/sequences/GCF_003400925.1.fna.gz', tmp_dir)
         results = self.get_all_results(contigs)
         self.assertEqual(results['num_resistance_genes'], '5')
         self.assertEqual(results['rmpA'], '-')
         self.assertEqual(results['rmpA2'], 'rmpA2_9')
         self.assertEqual(results['AGly'], 'RmtC')
         self.assertEqual(results['Col'], '-')
         self.assertEqual(results['Fcyn'], '-')
         self.assertEqual(results['Flq'], 'GyrA-83I;ParC-80I')
         self.assertEqual(results['Gly'], '-')
         self.assertEqual(results['MLS'], '-')
         self.assertEqual(results['Ntmdz'], '-')
         self.assertEqual(results['Phe'], '-')
         self.assertEqual(results['Rif'], '-')
         self.assertEqual(results['Sul'], 'SulI')
         self.assertEqual(results['Tet'], 'TetA')
         self.assertEqual(results['Tmt'], 'DfrA1')
         self.assertEqual(results['Omp'], '-')
         self.assertEqual(results['Bla'], '-')
         self.assertEqual(results['Bla_Carb'], 'NDM-1')
         self.assertEqual(results['Bla_ESBL'], '-')
         self.assertEqual(results['Bla_ESBL_inhR'], '-')
         self.assertEqual(results['Bla_broad'], 'SHV-11')
         self.assertEqual(results['Bla_broad_inhR'], '-')
예제 #3
0
 def test_ozanae(self):
     contigs = 'test/sequences/GCF_900451425.1.fna.gz'
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(contigs, tmp_dir)
         results = get_chromosome_mlst_results(self.data_dir, contigs, True)
         self.assertEqual(results['ST'], 'ST90 (subsp. ozanae)')
         self.assertEqual(results['Chr_ST'], 'ST90')
예제 #4
0
 def test_GCF_002248955(self):
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(
             'test/sequences/GCF_002248955.1.fna.gz', tmp_dir)
         results = self.get_all_results(contigs)
         self.assertEqual(results['num_resistance_genes'], '4')
         self.assertEqual(results['rmpA'], '-')
         self.assertEqual(results['rmpA2'], '-')
         self.assertEqual(results['AGly'], 'Aac3-IId^')
         self.assertEqual(results['Col'], 'Mcr3-1*')
         self.assertEqual(results['Fcyn'], '-')
         self.assertEqual(results['Flq'], 'GyrA-83F;GyrA-87A;ParC-80I')
         self.assertEqual(results['Gly'], '-')
         self.assertEqual(results['MLS'], '-')
         self.assertEqual(results['Ntmdz'], '-')
         self.assertEqual(results['Phe'], 'CatA1^')
         self.assertEqual(results['Rif'], '-')
         self.assertEqual(results['Sul'], '-')
         self.assertEqual(results['Tet'], 'TetA')
         self.assertEqual(results['Tmt'], '-')
         self.assertEqual(results['Omp'], '-')
         self.assertEqual(results['Bla'], 'SHV-28^')
         self.assertEqual(results['Bla_Carb'], '-')
         self.assertEqual(results['Bla_ESBL'], '-')
         self.assertEqual(results['Bla_ESBL_inhR'], '-')
         self.assertEqual(results['Bla_broad'], '-')
         self.assertEqual(results['Bla_broad_inhR'], '-')
예제 #5
0
 def test_GCF_900501255(self):
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(
             'test/sequences/GCF_900501255.1.fna.gz', tmp_dir)
         results = self.get_all_results(contigs)
         self.assertEqual(results['num_resistance_genes'], '0')
         self.assertEqual(results['rmpA'], 'rmpA_2(KpVP-1)')
         self.assertEqual(results['rmpA2'], 'rmpA2_4*-50%')
         self.assertEqual(results['AGly'], '-')
         self.assertEqual(results['Col'], '-')
         self.assertEqual(results['Fcyn'], '-')
         self.assertEqual(results['Flq'], '-')
         self.assertEqual(results['Gly'], '-')
         self.assertEqual(results['MLS'], '-')
         self.assertEqual(results['Ntmdz'], '-')
         self.assertEqual(results['Phe'], '-')
         self.assertEqual(results['Rif'], '-')
         self.assertEqual(results['Sul'], '-')
         self.assertEqual(results['Tet'], '-')
         self.assertEqual(results['Tmt'], '-')
         self.assertEqual(results['Omp'], '-')
         self.assertEqual(results['Bla'], 'SHV-187*')
         self.assertEqual(results['Bla_Carb'], '-')
         self.assertEqual(results['Bla_ESBL'], '-')
         self.assertEqual(results['Bla_ESBL_inhR'], '-')
         self.assertEqual(results['Bla_broad'], '-')
         self.assertEqual(results['Bla_broad_inhR'], '-')
예제 #6
0
 def test_GCF_003345475(self):
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(
             'test/sequences/GCF_003345475.1.fna.gz', tmp_dir)
         results = self.get_all_results(contigs)
         self.assertEqual(results['num_resistance_genes'], '5')
         self.assertEqual(results['rmpA'], '-')
         self.assertEqual(results['rmpA2'], '-')
         self.assertEqual(results['AGly'], '-')
         self.assertEqual(results['Col'], 'Mcr1-1;MgrB-49%')
         self.assertEqual(results['Fcyn'], '-')
         self.assertEqual(results['Flq'], 'Qnr-S1')
         self.assertEqual(results['Gly'], '-')
         self.assertEqual(results['MLS'], '-')
         self.assertEqual(results['Ntmdz'], '-')
         self.assertEqual(results['Phe'], '-')
         self.assertEqual(results['Rif'], '-')
         self.assertEqual(results['Sul'], 'SulI')
         self.assertEqual(results['Tet'], 'TetA')
         self.assertEqual(results['Tmt'], 'DfrA1')
         self.assertEqual(results['Omp'], '-')
         self.assertEqual(results['Bla'], 'SHV-110')
         self.assertEqual(results['Bla_Carb'], '-')
         self.assertEqual(results['Bla_ESBL'], '-')
         self.assertEqual(results['Bla_ESBL_inhR'], '-')
         self.assertEqual(results['Bla_broad'], '-')
         self.assertEqual(results['Bla_broad_inhR'], '-')
예제 #7
0
 def test_GCF_002247645(self):
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(
             'test/sequences/GCF_002247645.1.fna.gz', tmp_dir)
         results = self.get_all_results(contigs)
         self.assertEqual(results['num_resistance_genes'], '7')
         self.assertEqual(results['rmpA'], '-')
         self.assertEqual(results['rmpA2'], '-')
         self.assertEqual(results['AGly'], 'Aac3-IId^')
         self.assertEqual(results['Col'], '-')
         self.assertEqual(results['Fcyn'], '-')
         self.assertEqual(results['Flq'], 'Qnr-S1')
         self.assertEqual(results['Gly'], '-')
         self.assertEqual(results['MLS'], '-')
         self.assertEqual(results['Ntmdz'], '-')
         self.assertEqual(results['Phe'], 'FloR*')
         self.assertEqual(results['Rif'], '-')
         self.assertEqual(results['Sul'], '-')
         self.assertEqual(results['Tet'], 'TetA*')
         self.assertEqual(results['Tgc'], 'TetX4')
         self.assertEqual(results['Tmt'], '-')
         self.assertEqual(results['Omp'], '-')
         self.assertEqual(results['Bla'], 'LAP-2;SHV-2a^;TEM-1D^')
         self.assertEqual(results['Bla_Carb'], '-')
         self.assertEqual(results['Bla_ESBL'], '-')
         self.assertEqual(results['Bla_ESBL_inhR'], '-')
         self.assertEqual(results['Bla_broad'], '-')
         self.assertEqual(results['Bla_broad_inhR'], '-')
예제 #8
0
 def test_GCF_002108345(self):
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(
             'test/sequences/GCF_002108345.1.fna.gz', tmp_dir)
         results = self.get_all_results(contigs)
         self.assertEqual(results['num_resistance_genes'], '11')
         self.assertEqual(results['rmpA'], '-')
         self.assertEqual(results['rmpA2'], '-')
         self.assertEqual(results['AGly'], 'Aac3-IId^;Aph3-Ia^')
         self.assertEqual(results['Col'], '-')
         self.assertEqual(results['Fcyn'], '-')
         self.assertEqual(results['Flq'], 'GyrA-83I;ParC-80I;QnrB4;QnrB4')
         self.assertEqual(results['Gly'], '-')
         self.assertEqual(results['MLS'], '-')
         self.assertEqual(results['Ntmdz'], '-')
         self.assertEqual(results['Phe'], 'CatA2*;CatB3*')
         self.assertEqual(results['Rif'], 'Arr3')
         self.assertEqual(results['Sul'], 'SulI*;SulI^')
         self.assertEqual(results['Tet'], '-')
         self.assertEqual(results['Tmt'], '-')
         self.assertEqual(results['Omp'], 'OmpK35-18%')
         self.assertEqual(results['Bla'], 'DHA-1;OXA-1;SHV-187*')
         self.assertEqual(results['Bla_Carb'], '-')
         self.assertEqual(results['Bla_ESBL'], '-')
         self.assertEqual(results['Bla_ESBL_inhR'], '-')
         self.assertEqual(results['Bla_broad'], '-')
         self.assertEqual(results['Bla_broad_inhR'], '-')
예제 #9
0
 def test_GCF_004010735(self):
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(
             'test/sequences/GCF_004010735.1.fna.gz', tmp_dir)
         results = self.get_all_results(contigs)
         self.assertEqual(results['wzi'], '-')
         self.assertEqual(results['K_locus'], '-')
예제 #10
0
    def test_GCF_003095495(self):
        with tempfile.TemporaryDirectory() as tmp_dir:
            contigs = gunzip_contigs_if_necessary(
                'test/sequences/GCF_003095495.1.fna.gz', tmp_dir)
            results = self.get_all_results(contigs)
            self.assertEqual(results['num_resistance_genes'], '17')
            self.assertEqual(results['rmpA'], '-')
            self.assertEqual(results['rmpA2'], '-')
            self.assertEqual(
                results['AGly'],
                'Aac3-IId^;AadA2^;Aph3-Ia^;RmtB;Sat-2A;StrA^;StrB')

            # PmrB is split in two: 36% (start) and 66% (end). The correct answer is 36% as that
            # includes the beginning of the gene.
            self.assertEqual(results['Col'], 'MgrB-62%;PmrB-36%')

            self.assertEqual(results['Fcyn'], '-')
            self.assertEqual(results['Flq'], 'GyrA-83I;ParC-80I')
            self.assertEqual(results['Gly'], '-')
            self.assertEqual(results['MLS'], 'Erm42*;MphA')
            self.assertEqual(results['Ntmdz'], '-')
            self.assertEqual(results['Phe'], 'CatA1^')
            self.assertEqual(results['Rif'], '-')
            self.assertEqual(results['Sul'], 'SulI;SulII')
            self.assertEqual(results['Tet'], 'TetG')
            self.assertEqual(results['Tmt'], 'DfrA12?')
            self.assertEqual(results['Omp'], 'OmpK35-25%;OmpK36GD')
            self.assertEqual(results['Bla'], 'TEM-1D^')
            self.assertEqual(results['Bla_Carb'], 'KPC-2')
            self.assertEqual(results['Bla_ESBL'], 'CTX-M-14')
            self.assertEqual(results['Bla_ESBL_inhR'], '-')
            self.assertEqual(results['Bla_broad'], 'SHV-11')
            self.assertEqual(results['Bla_broad_inhR'], '-')
예제 #11
0
    def test_GCF_001068035(self):
        with tempfile.TemporaryDirectory() as tmp_dir:
            contigs = gunzip_contigs_if_necessary(
                'test/sequences/GCF_001068035.1.fna.gz', tmp_dir)
            results = self.get_all_results(contigs)
            self.assertEqual(results['num_resistance_genes'], '0')
            self.assertEqual(results['rmpA'], 'rmpA_2(KpVP-1)')
            self.assertEqual(results['rmpA2'], 'rmpA2_3*-0%')
            self.assertEqual(results['AGly'], '-')

            # PmrB is split in two: 40% (start) and 60% (end). The correct answer is 40% as that
            # includes the beginning of the gene.
            self.assertEqual(results['Col'], 'PmrB-40%')

            self.assertEqual(results['Fcyn'], '-')
            self.assertEqual(results['Flq'], '-')
            self.assertEqual(results['Gly'], '-')
            self.assertEqual(results['MLS'], '-')
            self.assertEqual(results['Ntmdz'], '-')
            self.assertEqual(results['Phe'], '-')
            self.assertEqual(results['Rif'], '-')
            self.assertEqual(results['Sul'], '-')
            self.assertEqual(results['Tet'], '-')
            self.assertEqual(results['Tmt'], '-')
            self.assertEqual(results['Omp'], '-')
            self.assertEqual(results['Bla'], '-')
            self.assertEqual(results['Bla_Carb'], '-')
            self.assertEqual(results['Bla_ESBL'], '-')
            self.assertEqual(results['Bla_ESBL_inhR'], '-')
            self.assertEqual(results['Bla_broad'], '-')
            self.assertEqual(results['Bla_broad_inhR'], '-')
예제 #12
0
    def test_AS7(self):
        with tempfile.TemporaryDirectory() as tmp_dir:
            contigs = gunzip_contigs_if_necessary('test/sequences/AS7.fna.gz',
                                                  tmp_dir)
            results = self.get_all_results(contigs)

            # This genome is missing the start of rmpA, which counts as a truncation to 0%.
            self.assertEqual(results['rmpA'], 'rmpA_1*-0%(KpVP-1)')
예제 #13
0
 def test_83(self):
     contigs = 'test/sequences/83.fasta.gz'
     with tempfile.TemporaryDirectory() as tmp_dir:
         contigs = gunzip_contigs_if_necessary(contigs, tmp_dir)
         results = get_chromosome_mlst_results(self.data_dir, contigs, True)
         self.assertEqual(results['gapA'], '10')
         self.assertEqual(results['infB'], '7')
         self.assertEqual(results['mdh'], '1')
         self.assertEqual(results['pgi'], '1')
         self.assertEqual(results['phoE'], '1')
         self.assertEqual(results['rpoB'], '1')
         self.assertEqual(results['tonB'], '35')
         self.assertEqual(results['ST'], 'ST160')
         self.assertEqual(results['Chr_ST'], 'ST160')