-
Notifications
You must be signed in to change notification settings - Fork 18
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
[New Workflow] AMR-search for neisseria gonorrhoeae samples #743
base: main
Are you sure you want to change the base?
Changes from all commits
8dddc4c
aaa29d1
b7e015e
84b4e35
fe1fef2
6e64915
da52a60
26fd16e
b2c581d
bf73aba
d73b845
6ebbea4
72b313a
d9a6f10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# AMR Search | ||
|
||
## Quick Facts | ||
|
||
| **Workflow Type** | **Applicable Kingdom** | **Last Known Changes** | **Command-line Compatibility** | **Workflow Level** | | ||
|---|---|---|---|---| | ||
| [Standalone](../../workflows_overview/workflows_type.md/#standalone) | [Any Taxa](../../workflows_overview/workflows_kingdom.md/#any-taxa) | vX.X.X | Yes | Sample-level | | ||
|
||
## AMR_Search_PHB | ||
|
||
The AMR_Search workflow is a standalone version of Pathogenwatch's AMR profiling functionality utilizing `AMRsearch` tool from Pathogenwatch. | ||
|
||
A limited number of species are currently supported and are listed below. NCBI codes are needed from this table to select the correct library. | ||
|
||
| Species | NCBI Code | | ||
|------------------------------|-----------| | ||
| _Neisseria gonorrhoeae_ | 485 | | ||
| _Staphylococcus aureus_ | 1280 | | ||
| _Salmonella_ Typhi | 90370 | | ||
| _Streptococcus pneumoniae_ | 1313 | | ||
| _Klebisiella_ | 570 | | ||
| _Escherichia_ | 561 | | ||
| _Mycobacterium tuberculosis_ | 1773 | | ||
| _Candida auris_ | 498019 | | ||
| _Vibrio cholerae_ | 666 | | ||
| _Campylobacter_ | 194 | | ||
|
||
!!! caption "AMR_Search Workflow Diagram" | ||
 | ||
|
||
### Inputs | ||
|
||
Input should be ordered as they appear on Terra | ||
|
||
| **Terra Task Name** | **Variable** | **Type** | **Description** | **Default Value** | **Terra Status** | | ||
|---|---|---|---|---|---| | ||
| amr_search_workflow | **amr_search_database** | String | NCBI taxon code of samples known taxonomy, see above supported species || Required | | ||
| amr_search_workflow | **input_fasta** | File | A microbial assembly file || Required | | ||
| amr_search_workflow | **samplename** | String | Identifier user wants prefixed to output files || Required | | ||
| amr_search | **cpu** | Integer | Number of CPUs to allocate to the task |2| Optional | | ||
| amr_search | **disk_size** | Integer | Amount of storage (in GB) to allocate to the task |50| Optional | | ||
| amr_search | **docker** | String | The docker container to use for the task |us-docker.pkg.dev/general-theiagen/theiagen/amrsearch:0.2.0| Optional | | ||
| amr_search | **memory** | Integer | Amount of memory/RAM (in GB) to allocate to the task |8| Optional | | ||
|
||
### Workflow Tasks | ||
|
||
Description of the workflow tasks | ||
|
||
??? task "`amr_search`: Antimicrobial resistance profiling" | ||
|
||
This task performs *in silico* antimicrobial resistance (AMR) profiling for supported species using **AMRsearch**, the primary tool used by [Pathogenwatch](https://pathogen.watch/) to genotype and infer antimicrobial resistance (AMR) phenotypes from assembled microbial genomes. | ||
|
||
**AMRsearch** screens against Pathogenwatch's library of curated genotypes and inferred phenotypes, developed in collaboration with community experts. Resistance phenotypes are determined based on both **resistance genes** and **mutations**, and the system accounts for interactions between multiple SNPs, genes, and suppressors. Predictions follow **S/I/R classification** (*Sensitive, Intermediate, Resistant*). | ||
|
||
**Outputs:** | ||
|
||
- **JSON Output:** Contains the complete AMR profile, including detailed **resistance state**, detected **resistance genes/mutations**, and supporting **BLAST results**. | ||
|
||
- **CSV & PNG Tables:** An incorprated Python script, `parse_amr_json.py`, extracts and formats results into a **CSV file** and **PNG summary table** for easier visualization. | ||
|
||
!!! techdetails "amr_search Technical Details" | ||
|
||
| | Links | | ||
| --- | --- | | ||
| Task | [task_amr_search.wdl](https://github.com/theiagen/public_health_bioinformatics/blob/fc-amr-search-dev/tasks/gene_typing/drug_resistance/task_amr_search.wdl) | | ||
| Software Source Code | [AMRsearch](https://github.com/pathogenwatch-oss/amr-search) | | ||
| Software Documentation | [Pathogenwatch](https://cgps.gitbook.io/pathogenwatch) | | ||
| Original Publication(s) | [PAARSNP: *rapid genotypic resistance prediction for *Neisseria gonorrhoeae*](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7545138/) | | ||
|
||
### Outputs | ||
|
||
| **Variable** | **Type** | **Description** | | ||
|---|---|---| | ||
| amr_results_csv | File | CSV formatted AMR profile | | ||
| amr_results_png | File | PNG formatted AMR profile | | ||
| amr_search_results | File | JSON formatted AMR profile including BLAST results | | ||
| amr_search_docker | String | Docker image used to run AMR_Search | | ||
| amr_search_version | String | Version of AMR_Search libraries used | | ||
|
||
## References | ||
|
||
> [Pathogenwatch AMRsearch](https://github.com/pathogenwatch-oss/amr-search) | ||
<!-- --> | ||
> [PAARSNP](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7545138/) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
version 1.0 | ||
|
||
task amr_search { | ||
input { | ||
File input_fasta | ||
String samplename | ||
String amr_search_database = "485" | ||
String docker = "us-docker.pkg.dev/general-theiagen/theiagen/amrsearch:0.2.0" | ||
Int cpu = 2 | ||
Int disk_size = 50 | ||
Int memory = 8 | ||
} | ||
command <<< | ||
# Extract base name without path or extension | ||
input_base=$(basename ~{input_fasta}) | ||
input_base=${input_base%.*} | ||
echo "DEBUG: input_base = $input_base" | ||
|
||
# Run the tool | ||
java -jar /paarsnp/paarsnp.jar \ | ||
-i ~{input_fasta} \ | ||
-s ~{amr_search_database} | ||
|
||
# Move the output file from the input directory to the working directory | ||
mv $(dirname ~{input_fasta})/${input_base}_paarsnp.jsn ./~{samplename}_paarsnp_results.jsn | ||
|
||
# Script housed within the image; https://github.com/theiagen/theiagen_docker_builds/tree/awh-amrsearch-image/amrsearch/0.0.20 | ||
python3 /scripts/parse_amr_json.py \ | ||
./~{samplename}_paarsnp_results.jsn \ | ||
~{samplename} | ||
>>> | ||
output { | ||
File json_output = "~{samplename}_paarsnp_results.jsn" | ||
File output_csv = "~{samplename}_amr_results.csv" | ||
File output_png = "~{samplename}_amr_results.png" | ||
File output_version = "output_amr_version.txt" | ||
String amr_search_docker = docker | ||
} | ||
|
||
runtime { | ||
memory: "~{memory} GB" | ||
cpu: cpu | ||
docker: docker | ||
disks: "local-disk " + disk_size + " SSD" | ||
maxRetries: 1 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version 1.0 | ||
|
||
import "../../tasks/gene_typing/drug_resistance/task_amr_search.wdl" as run_amr_search | ||
|
||
workflow amr_search_workflow { | ||
input { | ||
File input_fasta | ||
String amr_search_database | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please consider changing this as the user doesn't need to pass in a DB, only the taxon code that then references the correct DB to use. Taxon/taxon_of_interest/taxon_code might make more sense. Some of this will depend on how we do the mapping when we plug into TheiaProk, but just dropping this as a note for future work when we implement that integration upstream. |
||
String samplename | ||
} | ||
|
||
# Call amr_search task to perform the analysis | ||
call run_amr_search.amr_search { | ||
input: | ||
input_fasta = input_fasta, | ||
samplename = samplename, | ||
amr_search_database = amr_search_database | ||
} | ||
|
||
output { | ||
File amr_search_results = amr_search.json_output | ||
File amr_results_csv = amr_search.output_csv | ||
File amr_results_png = amr_search.output_png | ||
String amr_search_docker = amr_search.amr_search_docker | ||
String amr_search_version = read_string(amr_search.output_version) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe worth a comment here with a link to the location of this script, for posterity's sake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! Ill put the link to the current dev branch of the docker builds repo and will update it when it gets merged.