Skip to content

Commit

Permalink
add default cpu and memory resources
Browse files Browse the repository at this point in the history
  • Loading branch information
rujinlong committed Apr 13, 2023
1 parent bd4387d commit 471c32e
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker
on:
push:
tags:
- 'v*'
# - 'v*'
- 'docker*'

jobs:
Expand Down
3 changes: 1 addition & 2 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion custom.config
Original file line number Diff line number Diff line change
Expand Up @@ -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') }
}

Expand Down
170 changes: 165 additions & 5 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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') }
}
}

Expand Down
43 changes: 40 additions & 3 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand Down Expand Up @@ -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"
]
}
}
},
Expand Down

0 comments on commit 471c32e

Please sign in to comment.