-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
385 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,83 @@ | ||
|
||
process GRIDSS_GRIDSS { | ||
tag "$meta.id" | ||
label 'process_medium' | ||
|
||
conda "bioconda::gridss=2.13.2" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/gridss:2.13.2--h270b39a_0': | ||
'biocontainers/gridss:2.13.2--h270b39a_0' }" | ||
|
||
|
||
input: | ||
tuple val(meta), path(normalbam), path(normalbai), path(tumorbam), path(tumorbai) // required: [meta, normal_cram, normal_crai, tumor_cram, tumor_crai] | ||
path(fasta) // required: reference fasta | ||
path(fasta_fai) | ||
path(bwa_index) // required: bwa index folder | ||
path(blacklist_gridss) // optional: gridss blacklist bed file based on genome | ||
|
||
|
||
output: | ||
tuple val(meta), path("*.vcf.gz") , emit: vcf, optional:true | ||
tuple val(meta), path("*.vcf.gz.tbi") , emit: vcf_index, optional:true | ||
tuple val(meta), path("*.assembly.bam") , emit: assembly, optional:true | ||
path "versions.yml" , emit: versions | ||
|
||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
def VERSION = '2.13.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. | ||
def assembly_bam = "--assembly ${meta.id}.assembly.bam" | ||
def bwa = bwa_index ? "cp -s ${bwa_index}/* ." : "" | ||
def blacklist = blacklist_gridss ? "--blacklist ${blacklist_gridss}" : "" | ||
|
||
""" | ||
${bwa} | ||
gridss \\ | ||
--output ${prefix}.vcf.gz \\ | ||
--reference ${fasta} \\ | ||
--threads ${task.cpus} \\ | ||
$assembly_bam \\ | ||
$blacklist \\ | ||
--picardoptions VALIDATION_STRINGENCY=LENIENT \\ | ||
--jvmheap ${task.memory.toGiga() - 1}g \\ | ||
--otherjvmheap ${task.memory.toGiga() - 1}g \\ | ||
${normalbam} \\ | ||
${tumorbam} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
gridss: ${VERSION} | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
def VERSION = '2.13.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. | ||
|
||
def steps = args.contains("-s ") ? args.split('-s ')[-1].split(" ")[0] : | ||
args.contains("--steps ") ? args.split('--steps ')[-1].split(" ")[0] : | ||
"all" | ||
def vcf = steps.contains("call") || steps.contains("all") ? "touch ${prefix}.vcf*" : "" | ||
def assembly_bam = steps.contains("assembly") || steps.contains("all") ? "touch ${meta.id}.assembly.bam" : "" | ||
""" | ||
${vcf} | ||
${assembly_bam} | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
gridss: ${VERSION} | ||
END_VERSIONS | ||
""" | ||
} | ||
|
||
|
||
|
||
|
This file contains 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,62 @@ | ||
process GRIDSS_SOMATIC { | ||
tag "$meta.id" | ||
label 'process_medium' | ||
|
||
conda "bioconda::gridss=2.13.2" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/gridss:2.13.2--h270b39a_0': | ||
'biocontainers/gridss:2.13.2--h270b39a_0' }" | ||
|
||
|
||
input: | ||
tuple val(meta), path(gridss_output) | ||
path(pondir_gridss) | ||
|
||
output: | ||
tuple val(meta), path("*high_confidence_somatic.vcf.gz") , emit: somatic_high_vcf, optional:true | ||
tuple val(meta), path("*high_and_low_confidence_somatic.vcf.gz") , emit: somatic_all_vcf, optional:true | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
def VERSION = '2.13.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. | ||
def output1 = "${meta.id}.high_confidence_somatic.vcf.gz" | ||
def output2 = "${meta.id}.high_and_low_confidence_somatic.vcf.gz" | ||
//def pon = pondir_gridss ? "cp -s ${pondir_gridss}/* ." : "" | ||
//def scriptDir = "dirname \$(which gridss_somatic_filter)".execute().text.trim() | ||
""" | ||
gridss_somatic_filter \\ | ||
--pondir ${pondir_gridss} \\ | ||
--input ${gridss_output} \\ | ||
--output $output1 \\ | ||
--fulloutput $output2 \\ | ||
-n 1 \\ | ||
-t 2 | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
gridss: ${VERSION} | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
def VERSION = '2.13.2' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. | ||
""" | ||
touch ${prefix}.high_confidence_somatic.vcf.bgz | ||
touch ${prefix}.high_and_low_confidence_somatic.vcf.bgz | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
gridss: ${VERSION} | ||
END_VERSIONS | ||
""" | ||
} | ||
|
This file contains 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 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 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 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,80 @@ | ||
// | ||
// GRIDSS SV CALLING | ||
// | ||
// | ||
// | ||
|
||
include { GRIDSS_GRIDSS } from '../../../modules/local/gridss/gridss/main.nf' | ||
include { GRIDSS_SOMATIC } from '../../../modules/local/gridss/somaticFilter/main.nf' | ||
|
||
workflow BAM_SVCALLING_GRIDSS { | ||
take: | ||
cram // channel: [mandatory] [ meta, normalcram, normalcrai, tumorcram, tumorcrai ] | ||
fasta // channel: [mandatory] reference fasta | ||
fasta_fai // channel: [mandatory] reference fasta index | ||
bwa_index // channel: [mandatory] bwa index path | ||
blacklist_gridss // optional: blacklist bed file for gridss | ||
|
||
|
||
main: | ||
versions = Channel.empty() | ||
vcf = Channel.empty() | ||
vcf_index = Channel.empty() | ||
assembly_bam = Channel.empty() | ||
|
||
GRIDSS_GRIDSS(cram, fasta, fasta_fai, bwa_index, blacklist_gridss) | ||
|
||
vcf = GRIDSS_GRIDSS.out.vcf | ||
vcf_index = GRIDSS_GRIDSS.out.vcf_index | ||
assembly_bam = GRIDSS_GRIDSS.out.assembly | ||
|
||
|
||
versions = versions.mix(GRIDSS_GRIDSS.out.versions) | ||
|
||
emit: | ||
vcf | ||
vcf_index | ||
assembly_bam | ||
|
||
|
||
versions | ||
|
||
} | ||
|
||
|
||
workflow BAM_SVCALLING_GRIDSS_SOMATIC { | ||
take: | ||
vcf | ||
pondir_gridss | ||
|
||
main: | ||
versions = Channel.empty() | ||
somatic_all = Channel.empty() | ||
somatic_high_confidence = Channel.empty() | ||
|
||
GRIDSS_SOMATIC(vcf, pondir_gridss) | ||
|
||
somatic_all = GRIDSS_SOMATIC.out.somatic_all_vcf | ||
somatic_high_confidence = GRIDSS_SOMATIC.out.somatic_high_vcf | ||
|
||
versions = GRIDSS_SOMATIC.out.versions | ||
|
||
all_vcf = Channel.empty().mix(somatic_all, somatic_high_confidence) | ||
|
||
emit: | ||
somatic_all | ||
somatic_high_confidence | ||
all_vcf | ||
|
||
versions | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.