Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds bwa -k 23 and GenomeChronicler as tool #16

Merged
merged 2 commits into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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