-
Notifications
You must be signed in to change notification settings - Fork 953
Add rgi/bwt #9585
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
base: master
Are you sure you want to change the base?
Add rgi/bwt #9585
Changes from all commits
75f95ec
42bf5c7
77ec4ba
fe0039c
6252f12
738ffc3
47300b4
c95108c
e90b13c
8db0574
fdf2574
cd2faf4
c167336
6efbbe3
668cf72
b1f3cae
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,7 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - bioconda::rgi=6.0.5 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,82 @@ | ||||||
| process RGI_BWT { | ||||||
| tag "${meta.id}" | ||||||
| label 'process_medium' | ||||||
|
|
||||||
| conda "${moduleDir}/environment.yml" | ||||||
| container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container | ||||||
| ? 'https://depot.galaxyproject.org/singularity/rgi:6.0.5--pyh05cac1d_0' | ||||||
| : 'biocontainers/rgi:6.0.5--pyh05cac1d_0'}" | ||||||
|
|
||||||
| input: | ||||||
| tuple val(meta), path(reads, arity: '1..2') | ||||||
| path card | ||||||
| path wildcard | ||||||
|
|
||||||
| output: | ||||||
| tuple val(meta), path("*.json"), emit: json | ||||||
| tuple val(meta), path("*.txt"), emit: tsv | ||||||
| tuple val(meta), path("temp/"), emit: tmp | ||||||
| tuple val("${task.process}"), val('rgi') , eval('rgi main --version') , emit: versions_rgi, topic: versions | ||||||
| tuple val("${task.process}"), val('rgi-database'), eval('echo $DB_VERSION') , emit: versions_db , topic: versions | ||||||
|
|
||||||
| when: | ||||||
| task.ext.when == null || task.ext.when | ||||||
|
|
||||||
| script: | ||||||
| // This customizes the command: rgi load | ||||||
| def args = task.ext.args ?: '' | ||||||
| // This customizes the command: rgi main | ||||||
| def args2 = task.ext.args2 ?: '' | ||||||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
| def read_one = reads[0] | ||||||
| def read_two = reads.size() > 1 ? reads[1] : null | ||||||
| def load_wildcard = "" | ||||||
|
|
||||||
| if (wildcard) { | ||||||
| load_wildcard = """ \\ | ||||||
| --wildcard_annotation ${wildcard}/wildcard_database_v\$DB_VERSION.fasta \\ | ||||||
| --wildcard_annotation_all_models ${wildcard}/wildcard_database_v\$DB_VERSION\\_all.fasta \\ | ||||||
| --wildcard_index ${wildcard}/wildcard/index-for-model-sequences.txt \\ | ||||||
| --amr_kmers ${wildcard}/wildcard/all_amr_61mers.txt \\ | ||||||
| --kmer_database ${wildcard}/wildcard/61_kmer_db.json \\ | ||||||
| --kmer_size 61 | ||||||
| """ | ||||||
| } | ||||||
vinisalazar marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| """ | ||||||
| DB_VERSION=\$(ls ${card}/card_database_*_all.fasta | sed "s/${card}\\/card_database_v\\([0-9].*[0-9]\\).*/\\1/") | ||||||
|
|
||||||
| rgi \\ | ||||||
| load \\ | ||||||
| ${args} \\ | ||||||
| --local \\ | ||||||
| --card_json ${card}/card.json \\ | ||||||
| --debug \\ | ||||||
| --card_annotation ${card}/card_database_v\$DB_VERSION.fasta \\ | ||||||
| --card_annotation_all_models ${card}/card_database_v\$DB_VERSION\\_all.fasta \\ | ||||||
| ${load_wildcard} | ||||||
|
|
||||||
| rgi \\ | ||||||
| bwt \\ | ||||||
| ${args} \\ | ||||||
|
Member
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.
Suggested change
Contributor
Author
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. Sorry, where exactly would this
Member
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. So the Footnotes
Member
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. i.e., in this case you don't use it for anything (even if it has to be there) but it would be defined in the pipeline logic :) |
||||||
| --local \\ | ||||||
| --threads ${task.cpus} \\ | ||||||
| --output_file ${prefix} \\ | ||||||
| --read_one ${read_one} \\ | ||||||
| ${ read_two ? "--read_two ${read_two}" : "" } | ||||||
|
|
||||||
|
|
||||||
| mkdir temp/ | ||||||
| for FILE in *.xml *.fsa *.{nhr,nin,nsq} *.draft *.potentialGenes *{variant,rrna,protein,predictedGenes,overexpression,homolog}.json; do [[ -e \$FILE ]] && mv \$FILE temp/; done | ||||||
vinisalazar marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| """ | ||||||
|
|
||||||
| stub: | ||||||
| """ | ||||||
| mkdir -p temp | ||||||
| touch test.json | ||||||
| touch test.txt | ||||||
|
|
||||||
| DB_VERSION=stub_version | ||||||
| """ | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| name: rgi_bwt | ||
| description: Predict antibiotic resistance from protein or nucleotide data | ||
| keywords: | ||
| - bacteria | ||
| - fasta | ||
| - antibiotic resistance | ||
| tools: | ||
| - rgi: | ||
| description: This tool provides a preliminary annotation of your DNA | ||
| sequence(s) based upon the data available in The Comprehensive Antibiotic | ||
| Resistance Database (CARD). Hits to genes tagged with Antibiotic | ||
| Resistance ontology terms will be highlighted. As CARD expands to include | ||
| more pathogens, genomes, plasmids, and ontology terms this tool will grow | ||
| increasingly powerful in providing first-pass detection of antibiotic | ||
| resistance associated genes. See license at CARD website. | ||
| homepage: https://card.mcmaster.ca | ||
| documentation: https://github.com/arpcard/rgi | ||
| tool_dev_url: https://github.com/arpcard/rgi | ||
| doi: "10.1093/nar/gkz935" | ||
| licence: ["https://card.mcmaster.ca/about"] | ||
| identifier: "" | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| - reads: | ||
| type: file | ||
| description: Single-end or paired-end nucleotide sequences in FASTQ or FASTA format | ||
| pattern: "*.{fastq,fastq.gz,fq,fq.gz,fasta,fasta.gz,fa,fa.gz,fna,fna.gz,faa,faa.gz}" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_1930 # FASTQ | ||
| - card: | ||
| type: directory | ||
| description: Directory containing the CARD database. This is expected to be | ||
| the unarchived but otherwise unaltered download folder (see RGI | ||
| documentation for download instructions). | ||
| pattern: "*/" | ||
| - wildcard: | ||
| type: directory | ||
| description: Directory containing the WildCARD database (optional). This is | ||
| expected to be the unarchived but otherwise unaltered download folder (see | ||
| RGI documentation for download instructions). | ||
| pattern: "*/" | ||
| output: | ||
| json: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| - "*.json": | ||
| type: file | ||
| description: JSON formatted file with RGI results | ||
| pattern: "*.{json}" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3464 # JSON | ||
| tsv: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| - "*.txt": | ||
| type: file | ||
| description: Tab-delimited file with RGI results | ||
| pattern: "*.{txt}" | ||
| ontologies: [] | ||
| tmp: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| - temp/: | ||
| type: directory | ||
| description: Directory containing various intermediate files | ||
| pattern: "temp/" | ||
| versions_rgi: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - rgi: | ||
| type: string | ||
| description: The tool name | ||
| - rgi main --version: | ||
| type: string | ||
| description: The version string returned by the command | ||
| versions_db: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - rgi-database: | ||
| type: string | ||
| description: The tool name | ||
| - echo $DB_VERSION: | ||
| type: string | ||
| description: The CARD database version string | ||
|
|
||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - rgi: | ||
| type: string | ||
| description: The tool name | ||
| - rgi main --version: | ||
| type: string | ||
| description: The command used to generate the version of the tool | ||
|
|
||
| authors: | ||
| - "@vinisalazar" | ||
| maintainers: | ||
| - "@nickp60" | ||
| - "@vinisalazar" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process RGI_BWT" | ||
| script "../main.nf" | ||
| process "RGI_BWT" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "rgi" | ||
| tag "rgi/bwt" | ||
| tag "rgi/cardannotation" | ||
| tag "untar" | ||
|
|
||
| setup { | ||
| run("UNTAR") { | ||
| script "modules/nf-core/untar/main.nf" | ||
| process { | ||
| """ | ||
| file('https://card.mcmaster.ca/latest/data', checkIfExists: true).copyTo('card-data.tar.bz2') | ||
|
|
||
| input[0] = [ | ||
| [ ], | ||
| file("card-data.tar.bz2") | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| run("RGI_CARDANNOTATION") { | ||
| script "modules/nf-core/rgi/cardannotation" | ||
| process { | ||
| """ | ||
| input[0] = UNTAR.out.untar.map{ it[1] } | ||
| """ | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("rgi/bwt - homo_sapiens - test_fastq_gz") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false ], // meta map | ||
| [ | ||
| file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), | ||
| file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), | ||
| ] | ||
| ] | ||
| input[1] = RGI_CARDANNOTATION.out.db | ||
| input[2] = [] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out.versions, | ||
| file(process.out.tmp.get(0).get(1)).list().sort(), | ||
| process.out.tool_version, | ||
| process.out.db_version, | ||
| ).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("rgi/bwt - homo_sapiens - test_fastq_gz - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:false ], // meta map | ||
| [ | ||
| file(params.test_data['homo_sapiens']['illumina']['test_1_fastq_gz'], checkIfExists: true), | ||
| file(params.test_data['homo_sapiens']['illumina']['test_2_fastq_gz'], checkIfExists: true), | ||
| ] | ||
| ] | ||
| input[1] = RGI_CARDANNOTATION.out.db | ||
| input[2] = [] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.