Skip to content

Commit

Permalink
Adds bwa -k 23 and GenomeChronicler as tool (#16)
Browse files Browse the repository at this point in the history
- [x] Adds -k 23 (bwa mem seed length)
- [x] Exposes as params bwa_cpus, sort_cpus
- [x] Adds GenomeChronicler in tools (sarek logic)
  • Loading branch information
cgpu authored Jan 10, 2020
1 parent bd2c4bb commit d1e60c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 10 additions & 8 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def helpMessage() {
Available: Mapping, Recalibrate, VariantCalling, Annotate
Default: Mapping
--tools Specify tools to use for variant calling:
Available: ASCAT, ControlFREEC, FreeBayes, HaplotypeCaller
Available: ASCAT, ControlFREEC, FreeBayes, HaplotypeCaller, GenomeChronicler
Manta, mpileup, Mutect2, Strelka, TIDDIT
and/or for annotation:
snpEff, VEP, merge
Expand Down Expand Up @@ -797,13 +797,13 @@ process MapReads {
input = hasExtension(inputFile1, "bam") ? "-p /dev/stdin - 2> >(tee ${inputFile1}.bwa.stderr.log >&2)" : "${inputFile1} ${inputFile2}"
// Pseudo-code: Add soft-coded memory allocation to the two tools, bwa mem | smatools sort
// Request only one from the user, the other is implicit: 1 - defined
bwa_cpus = Math.floor ( params.bwa_cpus_fraction * task.cpus) as Integer
sort_cpus = task.cpus - bwa_cpus
bwa_cpus = params.bwa_cpus ? params.bwa_cpus : Math.floor ( params.bwa_cpus_fraction * task.cpus) as Integer
sort_cpus = params.sort_cpus ? params.sort_cpus : task.cpus - bwa_cpus
"""
${convertToFastq}
bwa mem -K 100000000 -R \"${readGroup}\" ${extra} -t ${task.cpus} -M ${fasta} ${input} > tmp.sam
samtools view --threads ${task.cpus} -S -b tmp.sam > unsorted.bam && rm tmp.sam
samtools sort --threads ${task.cpus} unsorted.bam -o ${idSample}_${idRun}.bam && rm unsorted.bam
bwa mem -k 23 -K 100000000 -R \"${readGroup}\" ${extra} -t ${bwa_cpus} -M ${fasta} \
${input} | \
samtools sort --threads ${sort_cpus} - > ${idSample}_${idRun}.bam
"""
}

Expand Down Expand Up @@ -1056,7 +1056,6 @@ process BaseRecalibrator {
label 'med_resources'

tag {idPatient + "-" + idSample + "-" + intervalBed.baseName}
echo true

input:
set idPatient, idSample, file(bam), file(bai), file(intervalBed) from bamBaseRecalibrator
Expand Down Expand Up @@ -1345,6 +1344,8 @@ process RunGenomeChronicler {
output:
file("results_${bam.simpleName}") into chronicler_results

when: 'genomechronicler' in tools

script:

optional_argument = vep.endsWith("no_vepFile.txt") ? '' : "--vepFile ${vep}"
Expand Down Expand Up @@ -3351,7 +3352,8 @@ def defineToolList() {
'strelka',
'tiddit',
'tnscope',
'vep'
'vep',
'genomechronicler'
]
}

Expand Down
2 changes: 2 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ params {
med_resources_fraction = 0.50
singleCPUMem = 7.GB
bwa_cpus_fraction = 0.6
bwa_cpus = null
sort_cpus = null

// Deprecated params
annotateVCF = null
Expand Down

0 comments on commit d1e60c2

Please sign in to comment.