Skip to content

Commit 7555e0c

Browse files
committed
ADD: tests for HamronizationNormalizer
- Updated 'run_argnorm.py' to support the 'hamronization' tool option rather than the '--hamronization' flag - Removed '@pytest.mark.parametrize('hamronized', [True, False])' in 'test_normalizers.py'. Added test_hamronization_normalizer() which normalizes and tests every file in examples/hamronized - Updated example outputs in `outputs/` directory to match changes to input_gene and reference_gene processing in HamronizationNormalizer - Notes on changes to example outputs: 1) `resfinder.resfinder.reads.tsv` and `resfinder.resfinder.orfs.tsv`: ant(6)-Ia, cat, tet(X), and tet(O/32/O) have been mapped to their exact entries in resfinder ARO mapping because their reference_accession is also being used 2) `abricate.resfinder.tsv`: aadA24_1 has been mapped to its exact entry in resfinder ARO mapping. blaCTX-M-63_1_EU660216 and blaCARB-4_1_FJ785525 don't exist in the resfinder database anymore. They were previously mapped as their gene_symbols (blaCTX-M-63 and blaCARB-4) could be mapped to other genes. Now, as their reference_accession is also used, they aren't mapped to AROs anymore. 3) `abricate.ncbi.tsv`: Many new genes have been mapped to the ARO (e.g. dfrB3). However, there has been no change to the preprocessing of ncbi or amrfinderplus inputs. These genes are getting mapped as HamronizationNormalizer combines ARO mapping tables of all dbs, and these genes are being mapped to ARO mapping tables of other dbs. This will be corrected in a future commit where the gene_name of ncbi and amrfinderplus inputs will be used (this will pinpoint the exact unique gene in NCBI ARO mapping).
1 parent 475e823 commit 7555e0c

File tree

7 files changed

+1169
-86
lines changed

7 files changed

+1169
-86
lines changed

integration_tests/run_argnorm.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
os.makedirs('integration_tests/outputs/hamronized', exist_ok=True)
77

88
def run_cli_test(tool, file, folder, db=None):
9+
if folder == 'hamronized':
10+
tool = 'hamronization'
11+
912
command = [
1013
'argnorm',
1114
tool,
1215
'-i', f'examples/{folder}/{file}',
1316
'-o', f'integration_tests/outputs/{folder}/{file}'
1417
]
1518

16-
if folder == 'hamronized':
17-
command.append('--hamronized')
18-
1919
if tool in ['abricate', 'groot']:
2020
command += ['--db', db]
2121

@@ -41,6 +41,8 @@ def run_cli_test(tool, file, folder, db=None):
4141

4242
for db in ['ARGANNOT', 'argannot', 'MEGAres', 'megares', 'ncbi', 'resfinder', 'resfinderfg']:
4343
file = f'abricate.{db.lower()}.tsv'
44-
run_cli_test('abricate', file, 'hamronized', db=db)
44+
run_cli_test('hamronization', file, 'hamronized', db=db)
4545
if not 'resfinder' in db:
4646
run_cli_test('abricate', file, 'raw', db=db)
47+
48+
run_cli_test('hamronization', 'combined_hamronization.tsv', 'hamronized')

outputs/hamronized/abricate.ncbi.tsv

Lines changed: 15 additions & 15 deletions
Large diffs are not rendered by default.

outputs/hamronized/abricate.resfinder.tsv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ GMGC10.008_177_033.ERMX GMGC10.95nr_block_0019 erm(46)_1 erm(46) resfinder 2021-
528528
GMGC10.008_222_153.SCLAV_1890 GMGC10.95nr_block_0019 lnu(G)_1 lnu(G) resfinder 2021-Mar-27 KX470419 abricate abricate 1.0.1 98.51 1 804 + 100.0 Lincomycin ARO:3004085 ARO:0000046 ARO:0000017
529529
GMGC10.008_362_797.OXA GMGC10.95nr_block_0019 blaOXA-22_1 blaOXA-22 resfinder 2021-Mar-27 AF064820 abricate abricate 1.0.1 92.0 4 828 + 100.0 Amoxicillin;Ampicillin;Aztreonam;Cefepime;Piperacillin;Piperacillin+Tazobactam ARO:3001417 ARO:0000032,ARO:0000056,ARO:3000008 ARO:3000007,ARO:3000007,ARO:3000007
530530
GMGC10.008_362_873.YBXI GMGC10.95nr_block_0019 blaOXA-60d_1 blaOXA-60d resfinder 2021-Mar-27 AY664506 abricate abricate 1.0.1 100.0 1 816 + 100.0 ARO:3005326 ARO:0000020,ARO:0000056,ARO:3000008 ARO:3000007,ARO:3000007,ARO:3000007
531-
GMGC10.009_105_560.AADA GMGC10.95nr_block_0019 aadA24_1 aadA24 resfinder 2021-Mar-27 AM711129 abricate abricate 1.0.1 100.0 40 819 + 100.0 Streptomycin ARO:3002621 ARO:0000039,ARO:0000040 ARO:0000016,ARO:0000016
531+
GMGC10.009_105_560.AADA GMGC10.95nr_block_0019 aadA24_1 aadA24 resfinder 2021-Mar-27 AM711129 abricate abricate 1.0.1 100.0 40 819 + 100.0 Streptomycin ARO:3002601 ARO:0000039,ARO:0000040 ARO:0000016,ARO:0000016
532532
GMGC10.009_704_406.AADA GMGC10.95nr_block_0019 ant(9)-Ia_1 ant(9)-Ia resfinder 2021-Mar-27 X02588 abricate abricate 1.0.1 94.1 1 780 + 99.62 ARO:3002630 ARO:0000039 ARO:0000016
533533
GMGC10.009_706_608.UNKNOWN GMGC10.95nr_block_0019 blaOXA-209_1 blaOXA-209 resfinder 2021-Mar-27 JF268688 abricate abricate 1.0.1 82.06 1 731 + 88.0 ARO:3001809 ARO:0000056 ARO:3000007
534534
GMGC10.010_454_812.YBXI GMGC10.95nr_block_0019 blaOXA-54_1 blaOXA-54 resfinder 2021-Mar-27 AY500137 abricate abricate 1.0.1 100.0 1 798 + 100.0 Amoxicillin;Amoxicillin+Clavulanic_acid;Ampicillin;Ampicillin+Clavulanic_acid;Imipenem;Piperacillin;Piperacillin+Tazobactam ARO:3001812 ARO:0000020,ARO:0000056,ARO:3000008 ARO:3000007,ARO:3000007,ARO:3000007
@@ -753,7 +753,7 @@ GMGC10.026_771_731.UNKNOWN GMGC10.95nr_block_0021 blaGOB-13_1 blaGOB-13 resfinde
753753
GMGC10.026_771_858.UNKNOWN GMGC10.95nr_block_0021 blaCME-1_1 blaCME-1 resfinder 2021-Mar-27 AJ006275 abricate abricate 1.0.1 87.68 1 885 + 99.66 ARO:3004775 ARO:3000008 ARO:3000007
754754
GMGC10.026_777_350.UNKNOWN GMGC10.95nr_block_0021 blaCME-1_1 blaCME-1 resfinder 2021-Mar-27 AJ006275 abricate abricate 1.0.1 97.07 1 888 + 100.0 ARO:3004775 ARO:3000008 ARO:3000007
755755
GMGC10.026_779_337.UNKNOWN GMGC10.95nr_block_0021 blaGOB-7_1 blaGOB-7 resfinder 2021-Mar-27 AF189297 abricate abricate 1.0.1 99.47 64 819 + 100.0 ARO:3005696 ARO:0000020,ARO:0000032,ARO:3000008 ARO:3000007,ARO:3000007,ARO:3000007
756-
GMGC10.027_771_681.BLA GMGC10.95nr_block_0021 blaCTX-M-63_1 blaCTX-M-63 resfinder 2021-Mar-27 EU660216 abricate abricate 1.0.1 100.0 1 873 + 100.0 Amoxicillin;Ampicillin;Aztreonam;Cefepime;Cefotaxime;Ceftazidime;Ceftriaxone;Piperacillin;Ticarcillin ARO:3001924 ARO:0000032 ARO:3000007
756+
GMGC10.027_771_681.BLA GMGC10.95nr_block_0021 blaCTX-M-63_1 blaCTX-M-63 resfinder 2021-Mar-27 EU660216 abricate abricate 1.0.1 100.0 1 873 + 100.0 Amoxicillin;Ampicillin;Aztreonam;Cefepime;Cefotaxime;Ceftazidime;Ceftriaxone;Piperacillin;Ticarcillin
757757
GMGC10.031_929_892.BLA GMGC10.95nr_block_0021 blaNMC-A_1 blaNMC-A resfinder 2021-Mar-27 AJ536087 abricate abricate 1.0.1 94.31 1 879 + 100.0 ARO:3003589 ARO:0000008,ARO:0000020,ARO:0000058,ARO:3000637 ARO:3000007,ARO:3000007,ARO:3000007,ARO:3000007
758758
GMGC10.033_249_710.BLA GMGC10.95nr_block_0021 blaSME-2_1 blaSME-2 resfinder 2021-Mar-27 AF275256 abricate abricate 1.0.1 100.0 1 885 + 100.0 ARO:3002380 ARO:0000020 ARO:3000007
759759
GMGC10.034_566_540.AACC GMGC10.95nr_block_0021 aac(3)-VIIa_1 aac(3)-VIIa resfinder 2021-Mar-27 M22999 abricate abricate 1.0.1 94.0 1 867 + 100.0 ARO:3002541 ARO:3000657 ARO:0000016
@@ -767,7 +767,7 @@ GMGC10.036_938_985.BLA GMGC10.95nr_block_0021 blaBKC-1_1 blaBKC-1 resfinder 2021
767767
GMGC10.037_085_608.AACC GMGC10.95nr_block_0021 aac(3)-VIII_1 aac(3)-VIII resfinder 2021-Mar-27 AB211959 abricate abricate 1.0.1 99.77 1 864 + 100.0 ARO:3002542 ARO:0000005 ARO:0000016
768768
GMGC10.037_640_871.APHD GMGC10.95nr_block_0021 aph(6)-Ib_1 aph(6)-Ib resfinder 2021-Mar-27 X05648 abricate abricate 1.0.1 80.97 1 878 + 94.48 Streptomycin ARO:3002658 ARO:0000040 ARO:0000016
769769
GMGC10.037_977_769.UNKNOWN GMGC10.95nr_block_0021 blaCME-1_1 blaCME-1 resfinder 2021-Mar-27 AJ006275 abricate abricate 1.0.1 85.63 71 891 + 92.45 ARO:3004775 ARO:3000008 ARO:3000007
770-
GMGC10.038_139_710.BLA GMGC10.95nr_block_0021 blaCARB-4_1 blaCARB-4 resfinder 2021-Mar-27 FJ785525 abricate abricate 1.0.1 99.65 1 867 + 100.0 Ampicillin;Amoxicillin;Piperacillin ARO:3002243 ARO:3000008 ARO:3000007
770+
GMGC10.038_139_710.BLA GMGC10.95nr_block_0021 blaCARB-4_1 blaCARB-4 resfinder 2021-Mar-27 FJ785525 abricate abricate 1.0.1 99.65 1 867 + 100.0 Ampicillin;Amoxicillin;Piperacillin
771771
GMGC10.038_221_062.BLA GMGC10.95nr_block_0021 blaCARB-9_1 blaCARB-9 resfinder 2021-Mar-27 AY248038 abricate abricate 1.0.1 99.65 1 867 + 100.0 Ampicillin;Amoxicillin;Piperacillin ARO:3002248 ARO:3000008 ARO:3000007
772772
GMGC10.040_295_342.UNKNOWN GMGC10.95nr_block_0021 blaOXA-152_1 blaOXA-152 resfinder 2021-Mar-27 KP771980 abricate abricate 1.0.1 81.03 136 873 + 86.01 ARO:3001457 ARO:0000020,ARO:0000056,ARO:3000008 ARO:3000007,ARO:3000007,ARO:3000007
773773
GMGC10.041_088_390.DIMT1 GMGC10.95nr_block_0021 erm(O)_1 erm(O) resfinder 2021-Mar-27 M74717 abricate abricate 1.0.1 82.12 1 775 + 98.21 Erythromycin;Lincomycin;Clindamycin;Quinupristin;Pristinamycin_IA;Virginiamycin_S ARO:3004652 ARO:0000006,ARO:0000046,ARO:3000145 ARO:0000000,ARO:0000000,ARO:0000017

0 commit comments

Comments
 (0)