Skip to content
Kaixin edited this page May 6, 2022 · 21 revisions

A list of species and antibiotics involved in this benchmarking study:

Species Antibiotics Number of antibiotics
Mycobacterium tuberculosis amikacin , capreomycin, ethambutol, ethiomide, ethionamide, isoniazid, kanamycin, ofloxacin, pyrazinamide, rifampicin, rifampin, streptomycin 12
Salmonella enterica amoxicillin/clavulanic acid, ampicillin, cefoxitin, ceftiofur, ceftriaxone, chloramphenicol, gentamicin, nalidixic acid, streptomycin, sulfisoxazole, tetracycline 11
Streptococcus pneumoniae chloramphenicol, erythromycin, penicillin, tetracycline, trimethoprim/sulfamethoxazole 5
Neisseria gonorrhoeae azithromycin, cefixime 2
Escherichia coli amoxicillin, amoxicillin/clavulanic acid, ampicillin, aztreonam, cefotaxime, ceftazidime, ceftriaxone, cefuroxime, ciprofloxacin, gentamicin, piperacillin/tazobactam, tetracycline, trimethoprim 13
Staphylococcus aureus cefoxitin, ciprofloxacin, clindamycin, erythromycin, fusidic acid, gentamicin, methicillin, penicillin, tetracycline 9
Klebsiella pneumoniae amikacin, aztreonam, cefepime, cefoxitin, ciprofloxacin, gentamicin, imipenem, levofloxacin, meropenem, piperacillin/tazobactam, tetracycline, tobramycin, trimethoprim/sulfamethoxazole 13
Enterococcus faecium vancomycin 1
Acinetobacter baumannii amikacin, ampicillin/sulbactam, imipenem, levofloxacin, meropenem, tobramycin, trimethoprim/sulfamethoxazole 7
Pseudomonas aeruginosa ceftazidime, ciprofloxacin, levofloxacin, meropenem, tobramycin 5
Campylobacter jejuni tetracycline 1

Load ID list and phenotype through a module

cd Patric_data
python
import amr_utility.load_data
import numpy as np

antibiotics,ID,Y=Patric_data.load_data.extract_info(s,balance,level)

Input

  • s: one of 'Pseudomonas aeruginosa' 'Klebsiella pneumoniae' 'Escherichia coli' 'Staphylococcus aureus' 'Mycobacterium tuberculosis' 'Salmonella enterica' 'Streptococcus pneumoniae' 'Neisseria gonorrhoeae'
  • balance: True; False. If True is set, it provides additional functions of downsampling for unbalanced data set. Reset the majority category's size to 1.5 of the minority category's size, by random selection.

unbalance definition:

balance_ratio=(Number of strains in Susceptible)/(Number of strains in Resistance)

balance_ratio > 2 or balance_ratio < 0.5

  • level: 'strict';'loose'.

Output

  • antibiotics: a list of selected antibiotics w.r.t. specified species.
  • ID : matrix of id lists. Each list is the id list for an antibiotic, corresponding to antibiotics list.
  • Y: matrix of phenotye lists. 'Resistant': 1, 'Susceptible': 0. Each list is the binary phenotype list for an antibiotic, corresponding to antibiotics list.

Example usage: Copy the contents of Patric folder to your working directory, then:

import amr_utility.load_data
import numpy as np

antibiotics,ID,Y=Patric_data.load_data.extract_info('Pseudomonas aeruginosa',True,'strict')


print('Check: antibiotics ',antibiotics,len(ID),len(Y))
print(len(antibiotics))
for i in np.arange(len(ID)):
    print('Check number of strains for antibiotics ', antibiotics[i], ': ' ,len(ID[i]),' in ID list, ',len(Y[i]), 'in y list')
    
    
# Output a summary of phenotype distribution w.r.t. each antibiotic
antibiotics_selected=load_data.summary('Pseudomonas aeruginosa','loose')

Clone this wiki locally