-
Notifications
You must be signed in to change notification settings - Fork 955
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 10 commits
75f95ec
42bf5c7
77ec4ba
fe0039c
6252f12
738ffc3
47300b4
c95108c
e90b13c
8db0574
fdf2574
cd2faf4
c167336
6efbbe3
668cf72
b1f3cae
8903429
a63bb29
6647bb8
60c83c3
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,101 @@ | ||||||
| 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) | ||||||
| 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 | ||||||
| env RGI_VERSION, emit: tool_version | ||||||
| env DB_VERSION, emit: db_version | ||||||
| path "versions.yml", emit: versions | ||||||
|
|
||||||
| when: | ||||||
| task.ext.when == null || task.ext.when | ||||||
|
|
||||||
| script: | ||||||
| def args = task.ext.args ?: '' | ||||||
vinisalazar marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| def use_local = task.ext.local == null ? true : task.ext.local as boolean | ||||||
vinisalazar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| // Add this to nextflow.config if not using local: | ||||||
| // withName: RGI_BWT { | ||||||
| // ext.local = false | ||||||
| // } | ||||||
| def local_flag = use_local ? '--local' : '' | ||||||
| // This customizes the command: rgi bwt | ||||||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
| def read_one = reads instanceof List ? reads[0] : reads | ||||||
| def read_two = reads instanceof List && reads.size() > 1 ? reads[1] : null | ||||||
|
||||||
| input = meta.single_end ? "in=${fastq.join(',')}" : "in=${fastq[0]} in2=${fastq[1]}" |
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.
Don't rush on that one, let me discuss with James ;)
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.
I think the general consensus was to use meta.single_end for this as James said.
vinisalazar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
vinisalazar marked this conversation as resolved.
Show resolved
Hide resolved
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.
| ${args} \\ | |
| ${args2} \\ |
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.
Sorry, where exactly would this args2 come from?
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.
So the ext.args variables are defined in pipelines' modules.config file. You need one args variable for each command/section of a piped command 1, so you don't duplicate the same argument for two diffren tools/subcommands
Footnotes
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.
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 :)
vinisalazar marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| 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: Nucleotide sequences in FASTQ or FASTA format | ||
vinisalazar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pattern: "*.{fastq,fastq.gz,fq,fq.gz,fasta,fasta.gz,fa,fa.gz,fna,fna.gz,faa,faa.gz}" | ||
| ontologies: [] | ||
| - 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/" | ||
| tool_version: | ||
| - RGI_VERSION: | ||
| type: string | ||
| description: The version of the tool in string format (useful for | ||
| downstream tools such as hAMRronization) | ||
| db_version: | ||
| - DB_VERSION: | ||
| type: string | ||
| description: The version of the used database in string format (useful for | ||
| downstream tools such as hAMRronization) | ||
| versions: | ||
| - versions.yml: | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3750 # YAML | ||
| 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.