|
| 1 | +#!/usr/bin/env nextflow |
| 2 | + |
| 3 | +/* |
| 4 | + Copyright (c) 2021, ICGC ARGO |
| 5 | +
|
| 6 | + Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + of this software and associated documentation files (the "Software"), to deal |
| 8 | + in the Software without restriction, including without limitation the rights |
| 9 | + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | + copies of the Software, and to permit persons to whom the Software is |
| 11 | + furnished to do so, subject to the following conditions: |
| 12 | +
|
| 13 | + The above copyright notice and this permission notice shall be included in all |
| 14 | + copies or substantial portions of the Software. |
| 15 | +
|
| 16 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | + SOFTWARE. |
| 23 | +
|
| 24 | + Authors: |
| 25 | + Desiree Schnidrig |
| 26 | +*/ |
| 27 | + |
| 28 | +/********************************************************************/ |
| 29 | +/* this block is auto-generated based on info from pkg.json where */ |
| 30 | +/* changes can be made if needed, do NOT modify this block manually */ |
| 31 | +nextflow.enable.dsl = 2 |
| 32 | +version = '0.2.0' // package version |
| 33 | + |
| 34 | +container = [ |
| 35 | + 'ghcr.io': 'ghcr.io/icgc-argo-structural-variation-cn-wg/wfpm-demo.seqz-preprocess' |
| 36 | +] |
| 37 | +default_container_registry = 'ghcr.io' |
| 38 | +/********************************************************************/ |
| 39 | + |
| 40 | + |
| 41 | +// universal params go here |
| 42 | +params.container_registry = "" |
| 43 | +params.container_version = "" |
| 44 | +params.container = "" |
| 45 | + |
| 46 | +params.cpus = 1 |
| 47 | +params.mem = 1 // GB |
| 48 | +params.publish_dir = "output_dir/" // set to empty string will disable publishDir |
| 49 | + |
| 50 | + |
| 51 | +// tool specific parmas go here, add / change as needed |
| 52 | +params.tumor_bam = "" |
| 53 | +params.normal_bam = "" |
| 54 | +params.fasta = "" |
| 55 | +params.gcwiggle = "${baseDir}/resources/hg38.gc50Base.wig.gz" |
| 56 | +params.output_pattern = "*bin50.seqz.gz" // output file name pattern |
| 57 | + |
| 58 | +process seqzPreprocess { |
| 59 | + container "${params.container ?: container[params.container_registry ?: default_container_registry]}:${params.container_version ?: version}" |
| 60 | + publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", mode: "copy", enabled: params.publish_dir |
| 61 | + |
| 62 | + cpus params.cpus |
| 63 | + memory "${params.mem} GB" |
| 64 | + |
| 65 | + input: // input, make update as needed |
| 66 | + path tumor_bam |
| 67 | + path normal_bam |
| 68 | + path fasta |
| 69 | + path gcwiggle |
| 70 | + |
| 71 | + output: // output, make update as needed |
| 72 | + path "${params.output_pattern}", emit: seqz |
| 73 | + |
| 74 | + script: |
| 75 | + // add and initialize variables here as needed |
| 76 | + |
| 77 | + """ |
| 78 | + sequenza-utils bam2seqz --normal ${normal_bam} --tumor ${tumor_bam} --fasta ${fasta} -gc ${gcwiggle} --output sample.seqz.gz; |
| 79 | + sequenza-utils seqz_binning --seqz sample.seqz.gz --window 50 -o sample_bin50.seqz.gz |
| 80 | + """ |
| 81 | +} |
| 82 | + |
| 83 | + |
| 84 | +// this provides an entry point for this main script, so it can be run directly without clone the repo |
| 85 | +// using this command: nextflow run <git_acc>/<repo>/<pkg_name>/<main_script>.nf -r <pkg_name>.v<pkg_version> --params-file xxx |
| 86 | +workflow { |
| 87 | + seqzPreprocess( |
| 88 | + file(params.tumor_bam), |
| 89 | + file(params.normal_bam), |
| 90 | + file(params.fasta), |
| 91 | + file(params.gcwiggle) |
| 92 | + ) |
| 93 | +} |
0 commit comments