Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use drug class instead of gene name to query for high level class #278

Merged
merged 6 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions workflows/amr/run.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,15 @@ task RunResultsPerSample {
return([i for i in set_list if i == i])

ontology = json.load(open("~{card_ontology}"))
def get_high_level_classes(gene_name):
if gene_name not in ontology:
return []
if 'highLevelDrugClasses' not in ontology[gene_name]:
return []
return ontology[gene_name]['highLevelDrugClasses']
def get_high_level_classes(drug_class_string_list):
drug_classes = set()
for drug_class_string in drug_class_string_list:
drug_classes |= set(drug_class_string.split('; '))
high_level_classes = set()
for drug_class in drug_classes:
if drug_class in ontology:
high_level_classes |= set(ontology[drug_class].get('highLevelDrugClasses', []))
return high_level_classes

this_list = list(set(df['ARO_overall']))
result_df = {}
Expand All @@ -305,7 +308,7 @@ task RunResultsPerSample {
dc = remove_na(set(sub_df['Drug Class_contig_amr']).union(set(sub_df['Drug Class_kma_amr'])))
result['drug_class'] = ';'.join(dc) if len(dc) > 0 else None

hldc = get_high_level_classes(index)
hldc = get_high_level_classes(dc)
# Join classes with a semicolon and a space since we have a python list instead of a nice pandas union
result['high_level_drug_class'] = '; '.join(hldc) if len(hldc) > 0 else None

Expand Down
234 changes: 233 additions & 1 deletion workflows/amr/test/RunResultsPerSample/ontology.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@
"geneFamily": "pmr phosphoethanolamine transferase",
"drugClass": "peptide antibiotic"
},
"peptide antibiotic":
{
"label": "peptide antibiotic",
"accession": "3000053",
"description": "Peptide antibiotics have a wide range of antibacterial mechanisms, depending on the amino acids that make up the antibiotic, although most act to disrupt the cell membrane in some manner. Subclasses of peptide antibiotics can include additional sidechains of other types, such as lipids in the case of the lipopeptide antibiotics.",
"parentAccessions":
[
"1000003"
],
"childrenAccessions":
[
"dummy"
],
"highLevelDrugClasses":
[
"peptide antibiotic"
],
"synonyms":
[]
},
"Staphylococcus aureus LmrS":
{
"label": "Staphylococcus aureus LmrS",
Expand Down Expand Up @@ -65,6 +85,115 @@
"geneFamily": "major facilitator superfamily (MFS) antibiotic efflux pump",
"drugClass": "aminoglycoside antibiotic;diaminopyrimidine antibiotic;macrolide antibiotic;oxazolidinone antibiotic;phenicol antibiotic"
},
"phenicol antibiotic":
{
"label": "phenicol antibiotic",
"accession": "3000387",
"description": "Phenicols are broad spectrum bacteriostatic antibiotics acting on bacterial protein synthesis. More specifically, the phenicols block peptide elongation by binding to the peptidyltansferase centre of the 70S ribosome.",
"parentAccessions":
[
"1000003"
],
"childrenAccessions":
[
""
],
"highLevelDrugClasses":
[
"phenicol antibiotic"
],
"synonyms":
[
"phenicol"
]
},
"oxazolidinone antibiotic":
{
"label": "oxazolidinone antibiotic",
"accession": "3000079",
"description": "Oxazolidinones are a class of synthetic antibiotics discovered the the 1980s. They inhibit protein synthesis by binding to domain V of the 23S rRNA of the 50S subunit of bacterial ribosomes. Linezolid is the only member of this class currently in clinical use.",
"parentAccessions":
[
"1000003"
],
"childrenAccessions":
[
"dummy"
],
"highLevelDrugClasses":
[
"oxazolidinone antibiotic"
],
"synonyms":
[]
},
"macrolide antibiotic":
{
"label": "macrolide antibiotic",
"accession": "0000000",
"description": "Macrolides are a group of drugs (typically antibiotics) that have a large macrocyclic lactone ring of 12-16 carbons to which one or more deoxy sugars, usually cladinose and desosamine, may be attached. Macrolides bind to the 50S-subunit of bacterial ribosomes, inhibiting the synthesis of vital proteins.",
"parentAccessions":
[
"1000003"
],
"childrenAccessions":
[
"dummy"
],
"highLevelDrugClasses":
[
"macrolide antibiotic"
],
"synonyms":
[]
},
"aminoglycoside antibiotic":
{
"label": "aminoglycoside antibiotic",
"accession": "0000016",
"description": "Aminoglycosides are a group of antibiotics that are mostly effective against Gram-negative bacteria. These molecules consist of aminated sugars attached to a dibasic cyclitol. Aminoglycosides work by binding to the bacterial 30S ribosomal subunit (some work by binding to the 50S subunit), inhibiting the translocation of the peptidyl-tRNA from the A-site to the P-site and also causing misreading of mRNA, leaving the bacterium unable to synthesize proteins vital to its growth.",
"parentAccessions":
[
"1000003"
],
"childrenAccessions":
[
"dummy"
],
"highLevelDrugClasses":
[
"aminoglycoside antibiotic"
],
"synonyms":
[]
},
"diaminopyrimidine antibiotic":
{
"label": "diaminopyrimidine antibiotic",
"accession": "3000171",
"description": "Diaminopyrimidines are a class of organic compounds containing a pyrimidine ring substituted by two amine groups. They are inhibitors of dihydrofolate reductase, an enzyme critical for DNA synthesis.",
"parentAccessions":
[
"1000003"
],
"childrenAccessions":
[
"3000188",
"3000269",
"3000284",
"3000337",
"3000745",
"3001218"
],
"highLevelDrugClasses":
[
"diaminopyrimidine antibiotic"
],
"synonyms":
[
"diaminopyrimidine"
]
},
"fosA5":
{
"label": "fosA5",
Expand Down Expand Up @@ -93,6 +222,49 @@
"geneFamily": "fosfomycin thiol transferase",
"drugClass": "aminoglycoside antibiotic;fluoroquinolone antibiotic;phosphonic acid antibiotic"
},
"fluoroquinolone antibiotic":
{
"label": "fluoroquinolone antibiotic",
"accession": "0000001",
"description": "The fluoroquinolones are a family of synthetic broad-spectrum antibiotics that are 4-quinolone-3-carboxylates. These compounds interact with topoisomerase II (DNA gyrase) to disrupt bacterial DNA replication, damage DNA, and cause cell death.",
"parentAccessions":
[
"1000003"
],
"childrenAccessions":
[
"dummy"
],
"highLevelDrugClasses":
[
"fluoroquinolone antibiotic"
],
"synonyms":
[
"fluoroquinolone",
"quinolone"
]
},
"phosphonic acid antibiotic":
{
"label": "phosphonic acid antibiotic",
"accession": "3007149",
"description": "A group of antibiotics derived from phosphonic acids.",
"parentAccessions":
[
"1000003"
],
"childrenAccessions":
[
"dummy"
],
"highLevelDrugClasses":
[
"phosphonic acid antibiotic"
],
"synonyms":
[]
},
"norC":
{
"label": "norC",
Expand All @@ -119,7 +291,7 @@
"geneFamily": "major facilitator superfamily (MFS) antibiotic efflux pump",
"drugClass": "disinfecting agents and antiseptics;fluoroquinolone antibiotic"
},
"smeB should not be found":
"smeB":
{
"label": "smeB",
"accession": "3003052",
Expand All @@ -144,5 +316,65 @@
"proteinAccession": "AAD51345.1",
"geneFamily": "resistance-nodulation-cell division (RND) antibiotic efflux pump",
"drugClass": "aminoglycoside antibiotic;cephalosporin;cephamycin;penam"
},
"cephalosporin":
{
"label": "cephalosporin",
"accession": "0000032",
"description": "Cephalosporins are a class of beta-lactam antibiotics, containing the beta-lactam ring fused with a dihydrothiazolidine ring. Together with cephamycins they belong to a sub-group called cephems. Cephalosporin are bactericidal, and act by inhibiting the synthesis of the peptidoglycan layer of bacterial cell walls. The peptidoglycan layer is important for cell wall structural integrity, especially in Gram-positive organisms.",
"parentAccessions":
[
"3000276"
],
"childrenAccessions":
[
"dummy"
],
"highLevelDrugClasses":
[
"beta-lactam antibiotic"
],
"synonyms":
[]
},
"cephamycin":
{
"label": "cephamycin",
"accession": "0000044",
"description": "Cephamycins are a group of beta-lactam antibiotics, very similar to cephalosporins. Together with cephalosporins, they form a sub-group of antibiotics known as cephems. Cephamycins are bactericidal, and act by inhibiting the synthesis of the peptidoglycan layer of bacterial cell walls. The peptidoglycan layer is important for cell wall structural integrity, especially in Gram-positive organisms. The 7-alpha-methoxy group increases resistance to beta-lactamases.",
"parentAccessions":
[
"3000276"
],
"childrenAccessions":
[
"dummy"
],
"highLevelDrugClasses":
[
"beta-lactam antibiotic"
],
"synonyms":
[]
},
"penam is missing for some reason":
{
"label": "penam",
"accession": "3000008",
"description": "Penams are a group of antibiotics derived from Penicillium fungi that share a skeleton beta-lactam moiety fused with a thiazolidine ring. This is the most defining feature of penicillins. Penicillin antibiotics are historically significant because they are the first drugs that were effective against many previously serious diseases such as syphilis and Staphylococcus infections. Penicillins are still widely used today, though many types of bacteria are now resistant. All penicillins are beta-lactam antibiotics in the penam sub-group, and are used in the treatment of bacterial infections caused by susceptible, usually Gram-positive, organisms.",
"parentAccessions":
[
"3000007"
],
"childrenAccessions":
[
"dummy"
],
"highLevelDrugClasses":
[
"beta-lactam antibiotic"
],
"synonyms":
[]
}
}
Loading