|
| 1 | +// Global default params, used in configs |
| 2 | +profiles { |
| 3 | + slurm { |
| 4 | + process.executor = 'slurm' |
| 5 | + process.clusterOptions = { "-A production --qos high" } |
| 6 | + process.time = '1h' |
| 7 | + process.memory = '16 GB' |
| 8 | + process.cpus = 4 |
| 9 | + process.errorStrategy = 'retry' |
| 10 | + process.maxRetries = 2 |
| 11 | + } |
| 12 | +} |
| 13 | +process { |
| 14 | + withLabel: largecpu { |
| 15 | + cpus = 6 |
| 16 | + } |
| 17 | + withLabel: largemem { |
| 18 | + memory = '48 GB' |
| 19 | + } |
| 20 | +} |
| 21 | + |
| 22 | +// Load base.config by default for all pipelines |
| 23 | +includeConfig "$baseDir/conf/base.config" |
| 24 | + |
| 25 | +params { |
| 26 | + // Workflow flags |
| 27 | + outdir = 'results' |
| 28 | + // Boilerplate options |
| 29 | + help = false |
| 30 | + tracedir = "${params.outdir}/pipeline_info" |
| 31 | + // cache option makes it a bit easier to set conda or singularity cacheDir |
| 32 | + cache = "/home/proj/production/mutant/nf-cache/" |
| 33 | + // gff file |
| 34 | + gff = "$baseDir/typing/MN908947.3.gff" |
| 35 | + // SARS-CoV-2 VOC |
| 36 | + yaml = "$baseDir/typing/SARS-CoV-2.types.yaml" |
| 37 | +} |
| 38 | + |
| 39 | +if ( params.illumina ) { |
| 40 | + includeConfig "$baseDir/conf/illumina.config" |
| 41 | + // Clinical genomics override |
| 42 | + params { |
| 43 | + // Allow reads that don't have primer sequence? Ligation prep = false, nextera = true |
| 44 | + allowNoprimer = true |
| 45 | + // Length of illumina reads to keep after primer trimming |
| 46 | + illuminaKeepLen = 30 |
| 47 | + // Sliding window quality threshold for keeping reads after primer trimming (illumina) |
| 48 | + illuminaQualThreshold = 20 |
| 49 | + // Mpileup depth for ivar (although undocumented in mpileup, setting to zero removes limit) |
| 50 | + mpileupDepth = 100000 |
| 51 | + // iVar frequency threshold for consensus variant (ivar consensus: -t) |
| 52 | + ivarFreqThreshold = 0.75 |
| 53 | + // Minimum coverage depth to call variant (ivar consensus: -m; ivar variants -m) |
| 54 | + ivarMinDepth = 10 |
| 55 | + // iVar frequency threshold to call variant (ivar variants: -t ) |
| 56 | + ivarMinFreqThreshold = 0.25 |
| 57 | + // iVar minimum mapQ to call variant (ivar variants: -q) |
| 58 | + ivarMinVariantQuality = 20 |
| 59 | + // Typing frequency threshold to call aa consequences of variant. Set to ivarFreqThreshold for consistency with consensus |
| 60 | + csqAfThreshold = 0.75 |
| 61 | + // Minimum coverage depth to call aa consequences of variant. Set to ivarMinDepth for consistency with consensus |
| 62 | + csqDpThreshold = 10 |
| 63 | + // Java settings for picard tools. The "-Xmx" setting is useful if running into java memory issues |
| 64 | + picardJavaSettings = "-Xmx10g" |
| 65 | + // Options for picard CollectWgsMetrics |
| 66 | + wgsMetricsOptions = "--COVERAGE_CAP 1000000 --LOCUS_ACCUMULATION_CAP 1000000" |
| 67 | + // Customization of multiQC report |
| 68 | + multiqcOptions = '--cl_config "picard_config: { general_stats_target_coverage: [10,30,50,100] }" --module cutadapt --module fastqc --module ivar --module picard' |
| 69 | + // Repo to download your primer scheme from |
| 70 | + schemeRepoURL = 'https://github.com/artic-network/primer-schemes.git' |
| 71 | + // Directory within schemeRepoURL that contains primer schemes |
| 72 | + schemeDir = 'primer-schemes' |
| 73 | + // Scheme name |
| 74 | + scheme = 'nCoV-2019' |
| 75 | + // Scheme version |
| 76 | + schemeVersion = 'V3' |
| 77 | + } |
| 78 | +} |
| 79 | + |
| 80 | +// LESS RELEVANT PARAMETERS TO ALTER FROM THIS POINT ONWARD. |
| 81 | + |
| 82 | +profiles { |
| 83 | + conda { |
| 84 | + if ( params.medaka || params.nanopolish ) { |
| 85 | + process.conda = "$baseDir/environments/nanopore/environment.yml" |
| 86 | + } |
| 87 | + else if (params.illumina) { |
| 88 | + process.conda = "$baseDir/environments/illumina/environment.yml" |
| 89 | + } |
| 90 | + if (params.cache){ |
| 91 | + conda.cacheDir = params.cache |
| 92 | + } |
| 93 | + includeConfig "$baseDir/conf/conda.config" |
| 94 | + } |
| 95 | + docker { |
| 96 | + docker.enabled = true |
| 97 | + fixOwnership = true |
| 98 | + runOptions = "-u \$(id -u):\$(id -g)" |
| 99 | + } |
| 100 | + singularity { |
| 101 | + singularity.enabled = true |
| 102 | + singularity.autoMounts = true |
| 103 | + // Container |
| 104 | + if ( params.medaka || params.nanopolish ) { |
| 105 | + process { |
| 106 | + withName:articDownloadScheme { |
| 107 | + container = "file:///${baseDir}/artic-ncov2019-nanopore.sif" |
| 108 | + } |
| 109 | + withName:articGuppyPlex { |
| 110 | + container = "file:///${baseDir}/artic-ncov2019-nanopore.sif" |
| 111 | + } |
| 112 | + withName:articMinIONMedaka { |
| 113 | + container = "file:///${baseDir}/artic-ncov2019-nanopore.sif" |
| 114 | + } |
| 115 | + withName:articRemoveUnmappedReads { |
| 116 | + container = "file:///${baseDir}/artic-ncov2019-nanopore.sif" |
| 117 | + } |
| 118 | + withName:makeQCCSV { |
| 119 | + container = "file:///${baseDir}/artic-ncov2019-nanopore.sif" |
| 120 | + } |
| 121 | + withName:writeQCSummaryCSV { |
| 122 | + container = "file:///${baseDir}/artic-ncov2019-nanopore.sif" |
| 123 | + } |
| 124 | + withName:collateSamples { |
| 125 | + container = "file:///${baseDir}/artic-ncov2019-nanopore.sif" |
| 126 | + } |
| 127 | + withName:pangolinTyping { |
| 128 | + container = "file:///${baseDir}/artic-ncov2019-pangolin.sif" |
| 129 | + } |
| 130 | + withName:typeVariants { |
| 131 | + container = "file:///${baseDir}/artic-ncov2019-nanopore.sif" |
| 132 | + } |
| 133 | + withName:mergeTypingCSVs { |
| 134 | + container = "file:///${baseDir}/artic-ncov2019-nanopore.sif" |
| 135 | + } |
| 136 | + } |
| 137 | + } |
| 138 | + else if (params.illumina) { |
| 139 | + process.container = "file:///${baseDir}/artic-ncov2019-illumina.sif" |
| 140 | + } |
| 141 | + // Temporary directories |
| 142 | + if (params.cache) { |
| 143 | + singularity.cacheDir = params.cache |
| 144 | + env.NXF_TEMP="${params.cache}" |
| 145 | + env.NXF_SINGULARITY_LOCALCACHEDIR="${params.cache}" |
| 146 | + env.NXF_SINGULARITY_CACHEDIR="${params.cache}" |
| 147 | + env.NXF_SINGULARITY_TMPDIR="${params.cache}" |
| 148 | + env.SINGULARITY_LOCALCACHEDIR="${params.cache}" |
| 149 | + env.SINGULARITY_CACHEDIR="${params.cache}" |
| 150 | + env.SINGULARITY_TMPDIR="${params.cache}" |
| 151 | + env.SINGULARITY_ROOTFS="${params.cache}" |
| 152 | + env.TMPDIR="${params.cache}" |
| 153 | + env.TEMPDIR="${params.cache}" |
| 154 | + } |
| 155 | + } |
| 156 | +} |
| 157 | +// Capture exit codes from upstream processes when piping |
| 158 | +process.shell = ['/bin/bash', '-euo', 'pipefail'] |
| 159 | +timeline { |
| 160 | + enabled = true |
| 161 | + file = "${params.tracedir}/execution_timeline.html" |
| 162 | +} |
| 163 | +report { |
| 164 | + enabled = true |
| 165 | + file = "${params.tracedir}/execution_report.html" |
| 166 | +} |
| 167 | +trace { |
| 168 | + enabled = true |
| 169 | + file = "${params.tracedir}/execution_trace.txt" |
| 170 | +} |
| 171 | +dag { |
| 172 | + enabled = true |
| 173 | + file = "${params.tracedir}/pipeline_dag.svg" |
| 174 | +} |
| 175 | +manifest { |
| 176 | + author = 'Mikrobgruppen' |
| 177 | + description = 'Nextflow for running the Artic ncov2019 pipeline on hasta' |
| 178 | + mainScript = 'main.nf' |
| 179 | + nextflowVersion = '>=20.01.0' |
| 180 | + version = '1.0.0' |
| 181 | +} |
0 commit comments