Commit 9f6f3a6f authored by amunoz's avatar amunoz
Browse files
parents b3f96121 aef7ba2b
process BWA_INDEX {
tag "bwa index"
tag { "bwa index" }
container 'quay.io/biocontainers/bwa:0.7.17--h84994c4_5'
input:
path input
......@@ -12,10 +12,6 @@ process BWA_INDEX {
script:
def algoType = params.algoType ? "-a $params.algoType" : ""
"""
if [ "${input.extension}" == "gz" ];then
gunzip -c $input >> ${input.simpleName}.fa
fi
bwa index $algoType ${input.simpleName}.fa
bwa index $algoType $input
"""
}
\ No newline at end of file
process GRIDSS {
tag "gridss"
tag { "gridss" }
container 'quay.io/biocontainers/gridss:2.9.3--0'
input:
tuple path(input), path(bai)
tuple path(reference_genome), path(index_files), path(fai)
path reference_genome
path indexs
path blacklist
output:
......@@ -13,12 +14,17 @@ process GRIDSS {
script:
def threadsArgument = params.threads_gridss ? "--threads $params.threads_gridss" : ""
"""
gridss --reference $reference_genome \\
--output ${input.simpleName}.gridss.raw.vcf.gz \\
--assembly "$params.assemblyFilename" \\
$threadsArgument \\
--jar "/usr/local/share/gridss-2.9.3-0/gridss.jar" \\
--blacklist $blacklist \\
$input
for i in $input
do
srr=\$(echo \$i | cut -f 1 -d '.')
gridss --reference $reference_genome \\
--output \$(echo \${i%%.*}).gridss.raw.vcf.gz \\
--assembly "\$(echo \$srr).$params.assemblyFilename" \\
$threadsArgument \\
--jar "/usr/local/share/gridss-2.9.3-0/gridss.jar" \\
--blacklist $blacklist \\
\$i
done
"""
}
process GRIDSS_FILTER {
tag "gridss filter"
tag { "gridss filter" }
input:
path script
......@@ -14,6 +14,9 @@ process GRIDSS_FILTER {
script:
"""
sh $script $input $sample $min_len $max_len $min_q
for i in $input
do
sh $script \$i $sample $min_len $max_len $min_q
done
"""
}
process GUNZIP {
tag { "gunzip "}
container 'ubuntu:xenial'
input:
path input_fasta
output:
path "${input_fasta.simpleName}.fa"
script:
"""
reference_fasta=\$(echo $input_fasta | sed 's/.gz//g')
if [ "${input_fasta.extension}" == "gz" ];then
gunzip -c $input_fasta >> \$reference_fasta
fi
"""
}
\ No newline at end of file
process STRUCTURAL_VARIANTS {
tag "structural variants"
tag { "structural variants" }
container 'quay.io/biocontainers/bioconductor-structuralvariantannotation:1.6.0--r40_0'
input:
......@@ -11,6 +11,9 @@ process STRUCTURAL_VARIANTS {
script:
"""
Rscript $script $input
for i in $input
do
Rscript $script \$i
done
"""
}
\ No newline at end of file
......@@ -7,6 +7,9 @@ include {
include {
SAMTOOLS_FAIDX
} from "../modules/samtools_faidx"
include {
GUNZIP
} from "../modules/gunzip"
/*
* Subworkflow bwa_index
......@@ -16,7 +19,11 @@ workflow SUB_BWA_INDEX {
reference_fasta
main:
BWA_INDEX(reference_fasta)
GUNZIP(reference_fasta)
uncompressed = GUNZIP.out
BWA_INDEX(uncompressed)
SAMTOOLS_FAIDX(BWA_INDEX.out.reference_fasta)
emit:
......
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