From 471c32e0ba50968dc3ec70d3230e2b9bcc1a844d Mon Sep 17 00:00:00 2001 From: Jinlong Ru Date: Thu, 13 Apr 2023 12:15:04 +0200 Subject: [PATCH] add default cpu and memory resources --- .github/workflows/docker.yml | 2 +- conf/test.config | 3 +- custom.config | 2 +- nextflow.config | 170 +++++++++++++++++++++++++++++++++-- nextflow_schema.json | 43 ++++++++- 5 files changed, 208 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 16f9ccc..2e357c2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -3,7 +3,7 @@ name: Docker on: push: tags: - - 'v*' + # - 'v*' - 'docker*' jobs: diff --git a/conf/test.config b/conf/test.config index fcd8223..aa21c72 100644 --- a/conf/test.config +++ b/conf/test.config @@ -20,8 +20,7 @@ params { max_time = '24.h' // Input data for minimal test - // input = "https://raw.githubusercontent.com/deng-lab/viroprofiler/main/assets/samplesheet.csv" - input = "https://raw.githubusercontent.com/deng-lab/viroprofiler/dev2/assets/samplesheet.csv" + input = "https://raw.githubusercontent.com/deng-lab/viroprofiler/main/assets/samplesheet.csv" outdir = "output" mode = "all" diff --git a/custom.config b/custom.config index e537db1..fd6d427 100644 --- a/custom.config +++ b/custom.config @@ -162,7 +162,7 @@ process { } withName: SPADES { - cpu = { check_max( 4 * task.attempt, 'cpus') } + cpus = { check_max( 4 * task.attempt, 'cpus') } memory = { check_max( 20.GB * task.attempt, 'memory') } } diff --git a/nextflow.config b/nextflow.config index b7cee62..e36bb8d 100644 --- a/nextflow.config +++ b/nextflow.config @@ -14,13 +14,16 @@ params { input = null db = "${HOME}/viroprofiler" mode = 'all' // ["setup", "all"] + input_contigs = null + decontam = null + reads_type = "raw" // ["raw", "clean"] // ViroProfiler modules use_abricate = false use_decontam = false use_eggnog = false - use_dram = false - use_iphop = false + use_dram = true + use_iphop = true use_kraken2 = false use_phamb = false @@ -169,28 +172,185 @@ env { process { withLabel: setup { - cpus = 1 - memory = "1 GB" + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + time = { check_max( 12.h * task.attempt, 'time') } } - + + withName: ABRICATE { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 2.GB * task.attempt, 'memory') } + } + + withName: ABUNDANCE { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 1.GB * task.attempt, 'memory') } + } + withName: BACPHLIP { ext.args = "--multi_fasta" + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 4.GB * task.attempt, 'memory') } + } + + withName: CHECKV { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 20.GB * task.attempt, 'memory') } + } + + withName: CONTIGLIB { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 2.GB * task.attempt, 'memory') } + } + + withName: CONTIGLIB_CLUSTER { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 4.GB * task.attempt, 'memory') } + } + + withName: DB_DRAM { + cpus ={ check_max( 8 * task.attempt, 'cpus') } + memory = { check_max( 30.GB * task.attempt, 'memory') } + } + + withName: DB_KRAKEN2 { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 1.GB * task.attempt, 'memory') } + } + + withName: DB_VIBRANT { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + } + + withName: DB_VIRSORTER2 { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + } + + withName: DB_VREFSEQ { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } } withName: DECONTAM { ext.args = 'maxindel=1 bwr=0.16 bw=12 quickmatch fast minhits=2 qtrim=rl trimq=10 pigz=True untrim' + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 2.GB * task.attempt, 'memory') } + } + + withName: DRAMV { + cpus = { check_max( 8 * task.attempt, 'cpus') } + memory = { check_max( 50.GB * task.attempt, 'memory') } + } + + withName: DVF { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 4.GB * task.attempt, 'memory') } + } + + withName: EMAPPER { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 20.GB * task.attempt, 'memory') } } withName: FASTQC { ext.args = '--quiet' + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 2.GB * task.attempt, 'memory') } + } + + withName: FASTP { + ext.args = "-f 15 -t 1 -F 15 -T 1 --detect_adapter_for_pe -p -n 1 -l 30 -5 -W 4 -M 20 -r -c -g -x" + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 2.GB * task.attempt, 'memory') } + } + + withName: GENEPRED { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 2.GB * task.attempt, 'memory') } + } + + withName: MAPPING2CONTIGS { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 4.GB * task.attempt, 'memory') } + } + + withName: MICOMPLETEDB { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + } + + withName: MULTIQC { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 1.GB * task.attempt, 'memory') } + } + + withName: NRSEQS { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + } + + withName: PHAMB_RF { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + } + + withName: REPLIDEC { + cpus = { check_max( 2 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } } withName: SPADES { ext.args = "--meta" + cpus = { check_max( 4 * task.attempt, 'cpus') } + memory = { check_max( 20.GB * task.attempt, 'memory') } + } + + withName: TAXONOMY_MERGE { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 1.GB * task.attempt, 'memory') } + } + + withName: TAXONOMY_MMSEQS { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 20.GB * task.attempt, 'memory') } + } + + withName: TAXONOMY_VCONTACT { + cpus = { check_max( 8 * task.attempt, 'cpus') } + memory = { check_max( 20.GB * task.attempt, 'memory') } + } + + withName: VAMB { + cpus = { check_max( 4 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + } + + withName: VIBRANT { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + } + + withName: VIRALHOST_IPHOP { + cpus = { check_max( 12 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + } + + withName: VIRSORTER2 { + cpus = { check_max( 8 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + } + + withName: VOGDB { + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } } withName: VRHYME { ext.args = "--method longest" + cpus = { check_max( 1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } } } diff --git a/nextflow_schema.json b/nextflow_schema.json index 24912a0..a8dace9 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -126,10 +126,10 @@ } } }, - "gene_library_parameters": { - "title": "Gene library parameters", + "prot_library_parameters": { + "title": "Protein library parameters", "type": "object", - "description": "Parameters for creating gene library", + "description": "Parameters for creating protein library", "default": "", "properties": { "prot_cluster_min_similarity": { @@ -144,6 +144,24 @@ } } }, + "gene_library_parameters": { + "title": "Gene library parameters", + "type": "object", + "description": "Parameters for creating gene library", + "default": "", + "properties": { + "gene_cluster_min_similarity": { + "type": "number", + "description": "Minimum similarity of genes in a gene cluster", + "default": 0.9 + }, + "gene_cluster_min_coverage": { + "type": "number", + "description": "Minimum coverage of the shorter gene in a gene cluster", + "default": 0.9 + } + } + }, "binning_parameters": { "title": "Binning parameters", "type": "object", @@ -270,6 +288,25 @@ "type": "boolean", "description": "Use DRAM for metabolic reconstruction", "default": false + }, + "input_contigs": { + "type": "string", + "description": "Input contigs file", + "default": null + }, + "decontam": { + "type": "string", + "description": "Input contigs file", + "default": null + }, + "reads_type": { + "type": "string", + "description": "Type of reads", + "default": "raw", + "enum": [ + "raw", + "clean" + ] } } },