Skip to content

Commit 5c5041c

Browse files
authored
Merge pull request #10 from TRON-Bioinformatics/one-sample-input
add support to providing an individual sample through CLI params
2 parents e6a5305 + eda1d47 commit 5c5041c

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ test:
2222
bash tests/test_06.sh
2323
bash tests/test_08.sh
2424
bash tests/test_09.sh
25+
bash tests/test_10.sh

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ Input:
5353
* reference: path to the FASTA genome reference (indexes expected *.fai, *.dict)
5454
5555
Optional input:
56+
* input_name: sample name (alternative to --input_files)
57+
* input_tumor_bam: comma separated list of tumor BAMs (alternative to --input_files)
58+
* input_normal_bam: comma separated list of normal BAMs (alternative to --input_files)
5659
* gnomad: path to the gnomad VCF or other germline resource (recommended). If not provided the contamination will
5760
not be estimated and the filter of common germline variants will be disabled
5861
* intervals: path to a BED file containing the regions to analyse

main.nf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ include { FUNCOTATOR } from './modules/06_annotate'
1111

1212
params.help= false
1313
params.input_files = false
14+
params.input_name = false
15+
params.input_tumor_bam = false
16+
params.input_normal_bam = false
1417
params.reference = false
1518
params.gnomad = false
1619
params.output = 'output'
@@ -36,6 +39,10 @@ if (params.input_files) {
3639
.splitCsv(header: ['name', 'tumor_bam', 'normal_bam'], sep: "\t")
3740
.map{ row-> tuple(row.name, row.tumor_bam, row.normal_bam) }
3841
.set { input_files }
42+
} else if (params.input_name && params.input_tumor_bam && params.input_normal_bam) {
43+
Channel
44+
.fromList([tuple(params.input_name, params.input_tumor_bam, params.input_normal_bam)])
45+
.set { input_files }
3946
} else {
4047
exit 1, "Input file not specified!"
4148
}

nextflow.config

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ env {
3737
// Capture exit codes from upstream processes when piping
3838
process.shell = ['/bin/bash', '-euo', 'pipefail']
3939

40-
VERSION = '1.7.0'
40+
VERSION = '1.8.0'
4141
DOI = 'https://zenodo.org/badge/latestdoi/355860788'
4242

4343
manifest {
@@ -68,6 +68,9 @@ Input:
6868
* reference: path to the FASTA genome reference (indexes expected *.fai, *.dict)
6969
7070
Optional input:
71+
* input_name: sample name (alternative to --input_files)
72+
* input_tumor_bam: comma separated list of tumor BAMs (alternative to --input_files)
73+
* input_normal_bam: comma separated list of normal BAMs (alternative to --input_files)
7174
* gnomad: path to the gnomad VCF or other germline resource (recommended). If not provided the contamination will
7275
not be estimated and the filter of common germline variants will be disabled
7376
* intervals: path to a BED file containing the regions to analyse

tests/test_10.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
4+
source bin/assert.sh
5+
output=output/test10
6+
7+
nextflow main.nf -profile test,conda --output $output \
8+
--input_name sample_name \
9+
--input_tumor_bam `pwd`/test_data/SRR8244887.preprocessed.downsampled.bam \
10+
--input_normal_bam `pwd`/test_data/SRR8244836.preprocessed.downsampled.bam
11+
12+
test -s $output/sample_name/sample_name.mutect2.vcf || { echo "Missing output VCF file!"; exit 1; }

0 commit comments

Comments
 (0)