-
Notifications
You must be signed in to change notification settings - Fork 10
Dev manta #40
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
Merged
Dev manta #40
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a7b396e
First draft
712ae1d
Merge pull request #34 from UMCUGenetics/refactor-useq
sawibo b5caf2d
Merge pull request #35 from UMCUGenetics/refactor-useq
sawibo e962793
Add BaseRecalibrator, including PrintReads.
rernst a7d04fb
Add optional.
rernst 8db71b5
Add HaplotypeCallerGVCF
rernst ad2b817
Add gvcf tools.
rernst 0513c77
Add CatVariants and GenotypeGVCFs
rernst 27cc98d
Remove GVCFGQBands
rernst ceb588a
Fix modules
rernst c494bd9
Update gvcf
rernst cda8347
Unique names
rernst faa3195
Add FREEC
rernst 05ed063
Update Freec
rernst 6744482
Update freec
rernst d9678ef
Create config in process
rernst ab68a08
Fix config def
rernst c782c51
Add CollectWgsMetrics
rernst 7735672
Multiqc compatibility
rernst c2af633
Add MultiQC 1.9
rernst 1d22468
Update to .gz files
rernst fe1a616
Rename output.
rernst 5733f26
Added controlfreec & manta
4310fbc
Merge pull request #39 from UMCUGenetics/dev-dx
sawibo 1a3439a
Merged Robert's ControlFREEC modules, deleted old ones.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process AssessSignificance { | ||
| tag {"Control Freec AssessSignificance ${sample_id}"} | ||
| label 'ControlFreec_11_5' | ||
| label 'ControlFreec_11_5_AssessSignificance' | ||
| container = 'library://sawibo/default/bioinf-tools:freec11.5' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(sample_id, path(ratio_file), path(cnv_file)) | ||
|
|
||
| output: | ||
| tuple(sample_id, path("${cnv_file.name}.p.value.txt"), emit: cnv_pvalue) | ||
|
|
||
| script: | ||
| """ | ||
| cat /bin/assess_significance.R | R --slave --args ${cnv_file} ${ratio_file} | ||
| """ | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| process Freec { | ||
| tag {"Control Freec ${sample_id}"} | ||
| label 'ControlFreec_11_5' | ||
| label 'ControlFreec_11_5_Freec' | ||
| //TODO: upload to singularity library | ||
| container = 'library://sawibo/default/bioinf-tools:freec11.5' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(sample_id, path(bam_file), path(bai_file)) | ||
|
|
||
| output: | ||
| tuple(sample_id, path("${bam_file.name}_ratio.txt"), path("${bam_file.name}_CNVs"), emit: cnv) | ||
| tuple(sample_id, path("${bam_file.name}_sample.cpn"), path("${bam_file.name}_ratio.BedGraph"), path("${bam_file.name}_info.txt"), emit: other) | ||
|
|
||
| script: | ||
| def config = "${sample_id}.config" | ||
| """ | ||
| touch ${config} | ||
| echo "[general]" >> ${config} | ||
| echo "chrLenFile = ${params.chr_len_file}" >> ${config} | ||
| echo "chrFiles = ${params.chr_files}" >> ${config} | ||
| echo "gemMappabilityFile = ${params.gem_mappability_file}" >> ${config} | ||
| echo "ploidy = ${params.ploidy}" >> ${config} | ||
| echo "window = ${params.window}" >> ${config} | ||
| echo "telocentromeric = ${params.telocentromeric}" >> ${config} | ||
| echo "BedGraphOutput=TRUE" >> ${config} | ||
| echo "maxThreads=${task.cpus}" >> ${config} | ||
|
|
||
| echo "[sample]" >> ${config} | ||
| echo "inputFormat = BAM" >> ${config} | ||
| echo "mateFile = ${bam_file}" >> ${config} | ||
|
|
||
| freec -conf ${config} | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process MakeGraph { | ||
| tag {"Control Freec MakeGraph ${sample_id}"} | ||
| label 'ControlFreec_11_5' | ||
| label 'ControlFreec_11_5_MakeGraph' | ||
| container = 'library://sawibo/default/bioinf-tools:freec11.5' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(sample_id, path(ratio_file), path(cnv_file)) | ||
|
|
||
| output: | ||
| tuple(sample_id, path("${ratio_file.name}.png"), path("${ratio_file.name}.log2.png"), emit: ratio_png) | ||
|
|
||
| script: | ||
| """ | ||
| cat /bin/makeGraph.R | R --slave --args ${params.ploidy} ${ratio_file} | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process MakeKaryotype { | ||
| tag {"Control Freec MakeKaryotype ${sample_id}"} | ||
| label 'ControlFreec_11_5' | ||
| label 'ControlFreec_11_5_MakeKaryotype' | ||
| container = 'library://sawibo/default/bioinf-tools:freec11.5' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(sample_id, path(ratio_file), path(cnv_file)) | ||
|
|
||
| output: | ||
| tuple(sample_id, path("*_karyotype.pdf"), emit: karyotype_pdf) | ||
|
|
||
| script: | ||
| """ | ||
| cat /bin/makeKaryotype.R | R --slave --args ${params.ploidy} ${params.maxlevel} ${params.telocentromeric} ${ratio_file} | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| process BaseRecalibrator { | ||
| tag {"GATK BaseRecalibrator ${sample_id} - ${chr}"} | ||
| label 'GATK_3_8_1_0_gf15c1c3ef' | ||
| label 'GATK_3_8_1_0_gf15c1c3ef_BaseRecalibrator' | ||
| container = 'quay.io/biocontainers/gatk:3.8--py27_1' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(sample_id, path(bam_file), path(bai_file), chr) | ||
|
|
||
| output: | ||
| tuple(sample_id, path("${bam_file.baseName}.bqsr.${chr}.bam"), path("${bam_file.baseName}.bqsr.${chr}.bai"), emit: bam_file) | ||
|
|
||
| script: | ||
| """ | ||
| java -Xmx${task.memory.toGiga()-4}G -jar $params.gatk_path -T BaseRecalibrator \ | ||
| --num_cpu_threads_per_data_thread ${task.cpus} \ | ||
| --reference_sequence ${params.genome} \ | ||
| --input_file ${bam_file} \ | ||
| --intervals ${chr} \ | ||
| --out ${bam_file.baseName}.bqsr.${chr}.table \ | ||
| ${params.optional} | ||
|
|
||
| java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T PrintReads \ | ||
| --num_cpu_threads_per_data_thread ${task.cpus} \ | ||
| --reference_sequence ${params.genome} \ | ||
| --input_file ${bam_file} \ | ||
| --BQSR ${bam_file.baseName}.bqsr.${chr}.table \ | ||
| --intervals ${chr} \ | ||
| --out ${bam_file.baseName}.bqsr.${chr}.bam | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| process CatVariantsGVCF { | ||
| tag {"GATK CatVariantsGVCF ${sample_id}"} | ||
| label 'GATK_3_8_1_0_gf15c1c3ef' | ||
| label 'GATK_3_8_1_0_gf15c1c3ef_CatVariantsGVCF' | ||
| container = 'quay.io/biocontainers/gatk:3.8--py27_1' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(sample_id, path(gvcf_files), path(gvcf_idx_files)) | ||
|
|
||
| output: | ||
| tuple(sample_id, path("${sample_id}.g.vcf.gz"), path("${sample_id}.g.vcf.gz.tbi"), emit:vcf_file) | ||
|
|
||
| script: | ||
| def input_files = gvcf_files.collect{"$it"}.join(" -V ") | ||
| """ | ||
| java -Xmx${task.memory.toGiga()-4}G -cp ${params.gatk_path} org.broadinstitute.gatk.tools.CatVariants --reference ${params.genome} -V ${input_files} --outputFile ${sample_id}.g.vcf.gz ${params.optional} | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| process GenotypeGVCFs { | ||
| tag {"GATK GenotypeGVCFs ${analysis_id}"} | ||
| label 'GATK_3_8_1_0_gf15c1c3ef' | ||
| label 'GATK_3_8_1_0_gf15c1c3ef_GenotypeGVCFs' | ||
| container = 'quay.io/biocontainers/gatk:3.8--py27_1' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(analysis_id, path(gvcf_files), path(gvcf_idx_files), path(interval_file)) | ||
|
|
||
| output: | ||
| tuple(analysis_id, path("${analysis_id}_${interval_file.baseName}.vcf"), path("${analysis_id}_${interval_file.baseName}.vcf.idx"), emit:vcf_file) | ||
|
|
||
| script: | ||
| def input_files = gvcf_files.collect{"$it"}.join(" -V ") | ||
| """ | ||
| java -Xmx${task.memory.toGiga()-4}G -jar ${params.gatk_path} -T GenotypeGVCFs \ | ||
| --reference_sequence ${params.genome} \ | ||
| -V ${input_files} \ | ||
| --out ${analysis_id}_${interval_file.baseName}.vcf \ | ||
| --intervals ${interval_file} \ | ||
| ${params.optional} \ | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| process Manta { | ||
| tag {"Manta ConfigAndRun ${sample_id}"} | ||
| label 'Manta_1_6_0' | ||
| label 'Manta_1_6_0_ConfigAndRun' | ||
| container = 'quay.io/biocontainers/manta:1.6.0--py27_0' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple (sample_id, path(bam_file), path(bai_file)) | ||
|
|
||
| output: | ||
| tuple (sample_id, path("*.candidateSmallIndels.*"),path("*.candidateSV.*"),path("*.diploidSV.*"), emit: sv ) | ||
|
|
||
| script: | ||
| """ | ||
| configManta.py --referenceFasta ${params.genome_fasta} --runDir . --bam $bam_file | ||
| ./runWorkflow.py -m local -j ${task.cpus} | ||
|
|
||
| mv results/variants/candidateSmallIndels.vcf.gz Manta_${sample_id}.candidateSmallIndels.vcf.gz | ||
| mv results/variants/candidateSmallIndels.vcf.gz.tbi Manta_${sample_id}.candidateSmallIndels.vcf.gz.tbi | ||
| mv results/variants/candidateSV.vcf.gz Manta_${sample_id}.candidateSV.vcf.gz | ||
| mv results/variants/candidateSV.vcf.gz.tbi Manta_${sample_id}.candidateSV.vcf.gz.tbi | ||
| mv results/variants/diploidSV.vcf.gz Manta_${sample_id}.diploidSV.vcf.gz | ||
| mv results/variants/diploidSV.vcf.gz.tbi Manta_${sample_id}.diploidSV.vcf.gz.tbi | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process MultiQC { | ||
| tag {"MultiQC"} | ||
| label 'MultiQC_1_9' | ||
| container = 'quay.io/biocontainers/multiqc:1.9--pyh9f0ad1d_0' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| val(analysis_id) | ||
| path(qc_files) | ||
|
|
||
| output: | ||
| tuple(path("${analysis_id}_multiqc_report.html"), path("${analysis_id}_multiqc_report_data"), emit: report) | ||
|
|
||
| script: | ||
| """ | ||
| multiqc ${params.optional} --title ${analysis_id} . | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| process CollectWgsMetrics { | ||
| tag {"PICARD CollectWgsMetrics ${sample_id}"} | ||
| label 'PICARD_2_22_0' | ||
| label 'PICARD_2_22_0_CollectWgsMetrics' | ||
| container = 'quay.io/biocontainers/picard:2.22.0--0' | ||
| shell = ['/bin/bash', '-euo', 'pipefail'] | ||
|
|
||
| input: | ||
| tuple(sample_id, path(bam_file), path(bai_file)) | ||
|
|
||
| output: | ||
| path("${sample_id}.wgs_metrics.txt", emit: txt_file) | ||
|
|
||
| script: | ||
| """ | ||
| picard -Xmx${task.memory.toGiga()-4}G CollectWgsMetrics TMP_DIR=\$TMPDIR R=${params.genome} INPUT=${bam_file} OUTPUT=${sample_id}.wgs_metrics.txt ${params.optional} | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
/binis automatically added to your $PATH env so you dont't have to specify it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you cat a file, it doesn't get automatically added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
cat assess_significance.R | R --slave --args ${cnv_file} ${ratio_file}not work?