-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalling.nf
60 lines (48 loc) · 1.7 KB
/
calling.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env nextflow
// ######################################
// # GATK4
// # snp and indell call from
// # GenomicsDB files
// ######################################
params.help=""
params.exe="slurm"
if (params.help) {
log.info " "
log.info "This is Nextflow pipeline for genotyping SNPS in rice 3k dataset. Most parameters are stored in file call_3k.conf"
log.info " "
log.info "Usage: nextflow run calling.nf -c calling.config --ref --chrom --(other options)"
log.info "Options:"
log.info "--help\t[BOOLEAN]\tShow this help message"
log.info "--ref\t[STRING]\tPath to the indexed referece fasta file [OBLIGATORY]"
log.info "--chrom\t[STRING]\tPath to the file with run IDs and fastq files to be processed [OBLIGATORY]"
// log.info "--out\t[STRING]\tPath to directory where bamfiles will be written [OBLIG ATORY]"
log.info "--exe\t[STRING]\tExecutor mode, -local- or -slurm- [DEFUALT: local]"
log.info " "
exit 1
}
// Initalize Input
CHROM = file("${params.chrom}")
REF = file("${params.ref}")
OUT = file("${params.out}")
CONDA = <your conda>
// Create Input Channel
SampleData = Channel.fromPath("${CHROM}").splitCsv(header: ['CHR'], skip: 0, by:1)
// ########### Genotype GVCF ###############
process genotype {
label 'himem'
conda CONDA
errorStrategy 'terminate'
publishDir OUT, mode: 'move'
executor = 'slurm'
input:
val(GVCF) from SampleData
output:
file({ "${CALLD}" }) into result
script:
CHR = "${GVCF.CHR}"
CALLD = "${GVCF.CHR}.vcf"
DB = "../../../../${GVCF.CHR}_db"
"""
gatk GenotypeGVCFs -V gendb://$DB -R ${REF} -L ${CHR} -O ${CALLD}
"""
}