Commit b3f96121 authored by amunoz's avatar amunoz
Browse files
parents d349f9ae b87577af
process BEDOPS_UNION {
tag "bedops union"
tag { "bedops union" }
container 'quay.io/biocontainers/bedops:2.4.39--h7d875b9_1'
input:
path input
output:
path "${input[0].simpleName}.all.filtered.bed"
path "${input[0].baseName.tokenize('.')[1]}.all.filtered.bed"
script:
"""
bedops -u $input > ${input[0].simpleName}.all.filtered.bed
bedops -u $input > ${input[0].baseName.tokenize('.')[1]}.all.filtered.bed
"""
}
process COLLAPSE {
tag "collapse"
tag { "collapse "}
container 'quay.io/biocontainers/bedtools:2.26.0gx--he513fc3_4'
publishDir "${params.outputDir}", mode: 'copy'
input:
path script
path input
output:
path "*.bed", emit: output
script:
"""
sh $script $input
"""
}
\ No newline at end of file
}
......@@ -3,22 +3,23 @@ process MANTA {
container 'quay.io/biocontainers/manta:1.6.0--py27_0'
input:
tuple path(input), path(bai)
tuple path(bams), path(bais)
path reference_genome
path indexs
path regions
path tbi
path bed
path bed_tbi
val exome
output:
tuple path("*.manta.raw.vcf.gz"), emit: output
script:
def exomeArgument = params.manta_exome ? "--exome" : ""
def exomeArgument = exome ? "--exome" : ""
"""
for i in $input
for i in $bams
do
srr=\$(echo \$i | cut -f 1 -d '.')
configManta.py --bam \$i --referenceFasta $reference_genome --runDir generated\$(echo \$srr) --callRegions $regions $exomeArgument
configManta.py --bam \$i --referenceFasta $reference_genome --runDir generated\$(echo \$srr) --callRegions $bed $exomeArgument
python generated\$(echo \$srr)/runWorkflow.py
cp generated\$(echo \$srr)/results/variants/diploidSV.vcf.gz ./\$(echo \$srr).manta.raw.vcf.gz
done
......
......@@ -4,11 +4,11 @@ process MANTA_FILTER {
input:
path script
path input
path sample
path samples
val max_len
val min_len
val min_q
output:
path "*", emit: output
......@@ -16,7 +16,7 @@ process MANTA_FILTER {
"""
for i in $input
do
sh $script \$i $sample $min_len $max_len $min_q
sh $script \$i $samples $min_len $max_len $min_q
done
"""
}
\ No newline at end of file
}
process SVTOOLS {
tag { "svtools" }
container 'quay.io/biocontainers/svtools:0.5.1--py_0'
input:
path input
......@@ -15,4 +15,4 @@ process SVTOOLS {
svtools vcftobedpe -i \$i -o \$(echo \${i%.*} | sed 's/vcf/bed/g')
done
"""
}
\ No newline at end of file
}
/*
/*
* Include for cnv_manta
*/
include {
......@@ -23,25 +23,27 @@ include {
workflow SUB_CNV_MANTA {
take:
bams
bais
samples
reference_genome
indexs
bed
bed_tbi
exome
manta_filter_script
collapse_script
tbi
max_len
min_len
min_q
main:
MANTA(bams,
reference_genome,
indexs,
bed,
tbi)
SVTOOLS( MANTA.out )
MANTA_FILTER( manta_filter_script, SVTOOLS.out, samples )
MANTA_UNION( MANTA_FILTER.out )
MANTA_MERGE( collapse_script, MANTA_UNION.out )
MANTA(bams, bais, reference_genome, indexs, bed, bed_tbi, exome)
SVTOOLS(MANTA.out)
MANTA_FILTER(manta_filter_script, SVTOOLS.out, samples, max_len, min_len, min_q)
MANTA_UNION(MANTA_FILTER.out)
MANTA_MERGE(collapse_script, MANTA_UNION.out)
emit:
output = MANTA_MERGE.out
}
\ No newline at end of file
output = MANTA_MERGE.out
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment