Skip to content

Commit

Permalink
Merge pull request #10 from TRON-Bioinformatics/one-sample-input
Browse files Browse the repository at this point in the history
add support to providing an individual sample through CLI params
  • Loading branch information
priesgo committed May 30, 2022
2 parents e6a5305 + eda1d47 commit 5c5041c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ test:
bash tests/test_06.sh
bash tests/test_08.sh
bash tests/test_09.sh
bash tests/test_10.sh
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Input:
* reference: path to the FASTA genome reference (indexes expected *.fai, *.dict)
Optional input:
* input_name: sample name (alternative to --input_files)
* input_tumor_bam: comma separated list of tumor BAMs (alternative to --input_files)
* input_normal_bam: comma separated list of normal BAMs (alternative to --input_files)
* gnomad: path to the gnomad VCF or other germline resource (recommended). If not provided the contamination will
not be estimated and the filter of common germline variants will be disabled
* intervals: path to a BED file containing the regions to analyse
Expand Down
7 changes: 7 additions & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ include { FUNCOTATOR } from './modules/06_annotate'

params.help= false
params.input_files = false
params.input_name = false
params.input_tumor_bam = false
params.input_normal_bam = false
params.reference = false
params.gnomad = false
params.output = 'output'
Expand All @@ -36,6 +39,10 @@ if (params.input_files) {
.splitCsv(header: ['name', 'tumor_bam', 'normal_bam'], sep: "\t")
.map{ row-> tuple(row.name, row.tumor_bam, row.normal_bam) }
.set { input_files }
} else if (params.input_name && params.input_tumor_bam && params.input_normal_bam) {
Channel
.fromList([tuple(params.input_name, params.input_tumor_bam, params.input_normal_bam)])
.set { input_files }
} else {
exit 1, "Input file not specified!"
}
Expand Down
5 changes: 4 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ env {
// Capture exit codes from upstream processes when piping
process.shell = ['/bin/bash', '-euo', 'pipefail']

VERSION = '1.7.0'
VERSION = '1.8.0'
DOI = 'https://zenodo.org/badge/latestdoi/355860788'

manifest {
Expand Down Expand Up @@ -68,6 +68,9 @@ Input:
* reference: path to the FASTA genome reference (indexes expected *.fai, *.dict)
Optional input:
* input_name: sample name (alternative to --input_files)
* input_tumor_bam: comma separated list of tumor BAMs (alternative to --input_files)
* input_normal_bam: comma separated list of normal BAMs (alternative to --input_files)
* gnomad: path to the gnomad VCF or other germline resource (recommended). If not provided the contamination will
not be estimated and the filter of common germline variants will be disabled
* intervals: path to a BED file containing the regions to analyse
Expand Down
12 changes: 12 additions & 0 deletions tests/test_10.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash


source bin/assert.sh
output=output/test10

nextflow main.nf -profile test,conda --output $output \
--input_name sample_name \
--input_tumor_bam `pwd`/test_data/SRR8244887.preprocessed.downsampled.bam \
--input_normal_bam `pwd`/test_data/SRR8244836.preprocessed.downsampled.bam

test -s $output/sample_name/sample_name.mutect2.vcf || { echo "Missing output VCF file!"; exit 1; }

0 comments on commit 5c5041c

Please sign in to comment.