Skip to content

Commit

Permalink
Update ampcombi 2.0.1 (#7142)
Browse files Browse the repository at this point in the history
* update ampcombi to 2.0.1

* update the rest of the submodules to 2.0.1

* add dir_path as input in parsetables

* Nextflow format document

* add code review

* fix harshil alignment

* remove binary files emmition

* add interpro optional input

* format document

* fix container versions

* add minor code review

* add more code reviews :)
  • Loading branch information
Darcy220606 authored Dec 11, 2024
1 parent 784b3a3 commit 993865f
Show file tree
Hide file tree
Showing 12 changed files with 213 additions and 140 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/ampcombi2/cluster/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::ampcombi=0.2.2"
- "bioconda::ampcombi=2.0.1"
4 changes: 2 additions & 2 deletions modules/nf-core/ampcombi2/cluster/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process AMPCOMBI2_CLUSTER {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ampcombi:0.2.2--pyhdfd78af_0':
'biocontainers/ampcombi:0.2.2--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/ampcombi:2.0.1--pyhdfd78af_0':
'biocontainers/ampcombi:2.0.1--pyhdfd78af_0' }"

input:
path(summary_file)
Expand Down
18 changes: 9 additions & 9 deletions modules/nf-core/ampcombi2/cluster/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
true,
true,
[
"versions.yml:md5,4e9aa3812bfee6ec22a1b6ccb62de2ca"
"versions.yml:md5,b629089d44775078dce5e664a455422b"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-04-24T12:11:40.928513749"
"timestamp": "2024-12-03T07:57:01.869983435"
},
"ampcombi2_cluster - metagenome - stub": {
"content": [
Expand All @@ -26,7 +26,7 @@
"Ampcombi_cluster.log:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"3": [
"versions.yml:md5,4e9aa3812bfee6ec22a1b6ccb62de2ca"
"versions.yml:md5,b629089d44775078dce5e664a455422b"
],
"cluster_tsv": [
"Ampcombi_summary_cluster.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
Expand All @@ -38,14 +38,14 @@
"Ampcombi_summary_cluster_representative_seq.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"versions": [
"versions.yml:md5,4e9aa3812bfee6ec22a1b6ccb62de2ca"
"versions.yml:md5,b629089d44775078dce5e664a455422b"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-04-24T12:12:08.780718892"
"timestamp": "2024-12-03T07:57:23.939137628"
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/ampcombi2/complete/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::ampcombi=0.2.2"
- "bioconda::ampcombi=2.0.1"
4 changes: 2 additions & 2 deletions modules/nf-core/ampcombi2/complete/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process AMPCOMBI2_COMPLETE {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/ampcombi:0.2.2--pyhdfd78af_0':
'biocontainers/ampcombi:0.2.2--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/ampcombi:2.0.1--pyhdfd78af_0':
'biocontainers/ampcombi:2.0.1--pyhdfd78af_0' }"

input:
path(summaries)
Expand Down
24 changes: 12 additions & 12 deletions modules/nf-core/ampcombi2/complete/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@
"Ampcombi_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"1": [

],
"2": [
"versions.yml:md5,0aa35e86761a6c160482b8b8dbfc5440"
"versions.yml:md5,bfba0046e0cfa7b0b6d79663823f94c0"
],
"log": [

],
"tsv": [
"Ampcombi_summary.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
],
"versions": [
"versions.yml:md5,0aa35e86761a6c160482b8b8dbfc5440"
"versions.yml:md5,bfba0046e0cfa7b0b6d79663823f94c0"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-04-29T11:55:16.030399422"
"timestamp": "2024-12-03T07:57:53.385349848"
},
"ampcombi2_complete - contigs": {
"content": [
true,
[
"versions.yml:md5,0aa35e86761a6c160482b8b8dbfc5440"
"versions.yml:md5,bfba0046e0cfa7b0b6d79663823f94c0"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2024-04-29T11:54:54.334224301"
"timestamp": "2024-12-03T07:57:40.263912946"
}
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/ampcombi2/parsetables/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::ampcombi=0.2.2"
- "bioconda::ampcombi=2.0.1"
80 changes: 48 additions & 32 deletions modules/nf-core/ampcombi2/parsetables/main.nf
Original file line number Diff line number Diff line change
@@ -1,48 +1,54 @@
process AMPCOMBI2_PARSETABLES {
tag "$meta.id"
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/ampcombi:0.2.2--pyhdfd78af_0':
'biocontainers/ampcombi:0.2.2--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/ampcombi:2.0.1--pyhdfd78af_0':
'biocontainers/ampcombi:2.0.1--pyhdfd78af_0' }"

input:
tuple val(meta), path(amp_input)
path(faa_input)
path(gbk_input)
path(opt_amp_db)
path faa_input
path gbk_input
val opt_amp_db
path opt_amp_db_dir
path opt_interproscan

output:
tuple val(meta), path("${meta.id}/") , emit: sample_dir
tuple val(meta), path("${meta.id}/contig_gbks/") , emit: contig_gbks
tuple val(meta), path("${meta.id}/${meta.id}_diamond_matches.txt"), emit: txt
tuple val(meta), path("${meta.id}/${meta.id}_ampcombi.tsv") , emit: tsv
tuple val(meta), path("${meta.id}/${meta.id}_amp.faa") , emit: faa
tuple val(meta), path("${meta.id}/${meta.id}_ampcombi.log") , emit: sample_log, optional:true
tuple val(meta), path("Ampcombi_parse_tables.log") , emit: full_log, optional:true
tuple val(meta), path("amp_ref_database/") , emit: results_db, optional:true
tuple val(meta), path("amp_ref_database/*.dmnd") , emit: results_db_dmnd, optional:true
tuple val(meta), path("amp_ref_database/*.clean.fasta") , emit: results_db_fasta, optional:true
tuple val(meta), path("amp_ref_database/*.tsv") , emit: results_db_tsv, optional:true
path "versions.yml" , emit: versions
tuple val(meta), path("${meta.id}/") , emit: sample_dir
tuple val(meta), path("${meta.id}/contig_gbks/") , emit: contig_gbks
tuple val(meta), path("${meta.id}/${meta.id}_mmseqs_matches.tsv") , emit: db_tsv
tuple val(meta), path("${meta.id}/${meta.id}_ampcombi.tsv") , emit: tsv
tuple val(meta), path("${meta.id}/${meta.id}_amp.faa") , emit: faa
tuple val(meta), path("${meta.id}/${meta.id}_ampcombi.log") , emit: sample_log , optional:true
tuple val(meta), path("Ampcombi_parse_tables.log") , emit: full_log , optional:true
tuple val(meta), path("amp_${opt_amp_db}_database/") , emit: db , optional:true
tuple val(meta), path("amp_${opt_amp_db}_database/*.txt") , emit: db_txt , optional:true
tuple val(meta), path("amp_${opt_amp_db}_database/*.fasta") , emit: db_fasta , optional:true
tuple val(meta), path("amp_${opt_amp_db}_database/mmseqs2/") , emit: db_mmseqs , optional:true
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def db = opt_amp_db? "--amp_database $opt_amp_db": ""
def db_dir = opt_amp_db_dir ? "--amp_database_dir ${opt_amp_db_dir}" : ""
def interpro = opt_interproscan ? "--interproscan_output ${opt_interproscan}" : ""

"""
ampcombi parse_tables \\
--path_list '${amp_input.collect{"$it"}.join("' '")}' \\
--faa ${faa_input} \\
--gbk ${gbk_input} \\
--sample_list ${prefix} \\
${db} \\
$args \\
--threads ${task.cpus}
--path_list '${amp_input.collect { "${it}" }.join("' '")}' \\
--faa ${faa_input} \\
--gbk ${gbk_input} \\
--sample_list ${prefix} \\
--amp_database ${opt_amp_db} \\
${db_dir} \\
${interpro} \\
${args} \\
--threads ${task.cpus}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -53,20 +59,30 @@ process AMPCOMBI2_PARSETABLES {
stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def db = opt_amp_db? "--amp_database $opt_amp_db": ""
def db_dir = opt_amp_db_dir ? "--amp_database_dir ${opt_amp_db_dir}" : ""
def interpro = opt_interproscan ? "--interproscan_output ${opt_interproscan}" : ""

"""
mkdir -p ${prefix}
mkdir -p ${prefix}/contig_gbks
touch ${prefix}/${meta.id}_diamond_matches.txt
touch ${prefix}/${meta.id}_mmseqs_matches.tsv
touch ${prefix}/${meta.id}_ampcombi.tsv
touch ${prefix}/${meta.id}_amp.faa
touch ${prefix}/${meta.id}_ampcombi.log
touch Ampcombi_parse_tables.log
mkdir -p amp_ref_database
touch amp_ref_database/*.dmnd
touch amp_ref_database/*.clean.fasta
touch amp_ref_database/*.tsv
mkdir -p amp_${opt_amp_db}_database
mkdir -p amp_${opt_amp_db}_database/mmseqs2
touch amp_${opt_amp_db}_database/*.fasta
touch amp_${opt_amp_db}_database/*.txt
touch amp_${opt_amp_db}_database/mmseqs2/ref_DB
touch amp_${opt_amp_db}_database/mmseqs2/ref_DB.dbtype
touch amp_${opt_amp_db}_database/mmseqs2/ref_DB_h
touch amp_${opt_amp_db}_database/mmseqs2/ref_DB_h.dbtype
touch amp_${opt_amp_db}_database/mmseqs2/ref_DB_h.index
touch amp_${opt_amp_db}_database/mmseqs2/ref_DB.index
touch amp_${opt_amp_db}_database/mmseqs2/ref_DB.lookup
touch amp_${opt_amp_db}_database/mmseqs2/ref_DB.source
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
59 changes: 35 additions & 24 deletions modules/nf-core/ampcombi2/parsetables/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ keywords:
- ampgram
- amptransformer
- DRAMP
- MMseqs2
- InterProScan
tools:
- ampcombi2/parsetables:
description: "A parsing tool to convert and summarise the outputs from multiple
AMP detection tools in a standardized format."
homepage: "https://github.com/Darcy220606/AMPcombi"
documentation: "https://github.com/Darcy220606/AMPcombi"
documentation: "https://ampcombi.readthedocs.io/en/main/"
tool_dev_url: "https://github.com/Darcy220606/AMPcombi/tree/dev"
licence: ["MIT"]
identifier: ""
Expand Down Expand Up @@ -52,9 +54,17 @@ input:
name.
pattern: "*.gbk"
- - opt_amp_db:
type: string
description: The name of the database to download and set up. This can either be 'DRAMP', 'APD' or 'UniRef100'.
pattern: "DRAMP|APD|UniRef100"
- - opt_amp_db_dir:
type: directory
description: The path to the folder containing the fasta and tsv database files.
pattern: "*/"
pattern: "path/to/amp_*_database"
- - opt_interproscan:
type: directory
description: A path to a file corresponding to the respective tsv files containing protein classifications of the annotated CDSs. The file must be the raw output from InterProScan.
pattern: "*.tsv"
output:
- sample_dir:
- meta:
Expand All @@ -78,17 +88,17 @@ output:
description: The output subdirectory that contains the gbk files containing
the AMP hits for each sample.
pattern: "/*/contig_gbks"
- txt:
- db_tsv:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- ${meta.id}/${meta.id}_diamond_matches.txt:
- ${meta.id}/${meta.id}_mmseqs_matches.tsv:
type: file
description: An alignment file containing the results from the DIAMOND alignment
description: An alignment file containing the results from the MMseqs2 alignment
step done on all AMP hits.
pattern: "/*/*_diamond_matches.txt"
pattern: "/*/*_mmseqs_matches.tsv"
- tsv:
- meta:
type: map
Expand Down Expand Up @@ -134,50 +144,51 @@ output:
description: A log file that captures the standard output for the entire process
in a log file. Can be activated by `--log`.
pattern: "Ampcombi_parse_tables.log"
- results_db:
- db:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- amp_ref_database/:
- amp_${opt_amp_db}_database/:
type: directory
description: If the AMP reference database is not provided by the user using
description: If the AMP reference database ID is not provided by the user using
the flag `--amp_database', by default the DRAMP database will be downloaded,
filtered and stored in this folder.
pattern: "/amp_ref_database"
- results_db_dmnd:
pattern: "/amp_*_database"
- db_txt:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- amp_ref_database/*.dmnd:
- amp_${opt_amp_db}_database/*.txt:
type: file
description: AMP reference database converted to DIAMOND database format.
pattern: "/amp_ref_database/*.dmnd"
- results_db_fasta:
description: AMP reference database in tsv-format with two columns containing
header and sequence.
pattern: "/amp_*_database/*.txt"
- db_fasta:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- amp_ref_database/*.clean.fasta:
- amp_${opt_amp_db}_database/*.fasta:
type: file
description: AMP reference database fasta file, cleaned of diamond-uncompatible
description: AMP reference database fasta file in clean format.
characters.
pattern: "/amp_ref_database/*.clean.fasta"
- results_db_tsv:
pattern: "/amp_*_database/*.fasta"
- db_mmseqs:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- amp_ref_database/*.tsv:
type: file
description: AMP reference database in tsv-format with two columns containing
header and sequence.
pattern: "/amp_ref_database/*.tsv"
- amp_${opt_amp_db}_database/mmseqs2/:
type: directory
description: As alignment to the reference database is carried out by MMseqs2, this directory
contains all the files generated by MMseqs2 on the fasta file of the database.
pattern: "/amp_*_database/mmseqs2"
- versions:
- versions.yml:
type: file
Expand Down
Loading

0 comments on commit 993865f

Please sign in to comment.