Commit a5daaac5 authored by amunoz's avatar amunoz Committed by lrodrin
Browse files

Removed scripts from inputs and updated templates

parent 2a9af241
process CODEX_FILTER {
tag "codex filter"
tag { "codex filter" }
input:
path input
......@@ -10,10 +10,10 @@ process CODEX_FILTER {
val min_lratio
output:
path "*.bed", emit: output
path "*.bed"
script:
"""
sh $script $input $samples $min_len $max_len $min_lratio
sh $projectDir/templates/codex_filter.sh $input $samples $min_len $max_len $min_lratio
"""
}
\ No newline at end of file
process EXOMEDEPTH_FILTER {
tag "exomedepth filter"
tag { "exomedepth filter" }
input:
path script
path input
path samples
val max_len
......@@ -10,10 +9,10 @@ process EXOMEDEPTH_FILTER {
val min_bf
output:
path "*.bed", emit: output
path "*.bed"
script:
"""
sh $script $input $sample $min_len $max_len $min_bf
sh $projectDir/templates/exomedepth_filter.sh $input $sample $min_len $max_len $min_bf
"""
}
\ No newline at end of file
......@@ -2,7 +2,6 @@ process MANTA_FILTER {
tag { "manta filter" }
input:
path script
path input
path samples
val max_len
......@@ -10,13 +9,13 @@ process MANTA_FILTER {
val min_q
output:
path "*", emit: output
path "*"
script:
"""
for i in $input
do
sh $script \$i $samples $min_len $max_len $min_q
sh $projectDir/templates/manta_filter.sh \$i $samples $min_len $max_len $min_q
done
"""
}
process MERGE_ALL {
tag "merge all"
tag { "merge all" }
container 'quay.io/biocontainers/bedtools:2.26.0gx--he513fc3_4'
input:
path input
path script
output:
path "*.bed", emit: output
path "*.bed"
script:
"""
sh $script $input
"""
template "merge_all.sh"
}
\ No newline at end of file
......@@ -14,11 +14,10 @@ include {
workflow SUB_FINAL_FILTERING {
take:
cnv_results
merge_all_script
main:
UNION( cnv_results )
MERGE( UNION.out, merge_all_script )
MERGE( UNION.out )
emit:
output = MERGE.out
......
#!/bin/bash
INPUT_FILE=$1
OUTPUT_NAME=${INPUT_FILE/bed/sorted.merged.bed}
OUTPUT_FILE=$(echo "$OUTPUT_NAME" | sed "s/.*\///")
INPUT_FILE=$input
OUTPUT_NAME=\${INPUT_FILE/bed/sorted.merged.bed}
OUTPUT_FILE=\$(echo "\$OUTPUT_NAME" | sed "s/.*\\///")
for i in $(cat $INPUT_FILE | sed -e "s/[[:space:]]\+/\t/g" | cut -f4 | sort -u) # FIXME: remove sed -e "s/[[:space:]]\+/\t/g" try better solution
for i in \$(cat \$INPUT_FILE | sed -e "s/[[:space:]]\\+/\\t/g" | cut -f4 | sort -u)
do
for j in "DEL" "DUP"
do
grep $i $INPUT_FILE | grep $j | sed -e "s/[[:space:]]\+/\t/g" | bedtools sort | bedtools merge -c 6,7 -o collapse | awk -v sample=$i -v type=$j '{ \
print $1,$2,$3,sample,type,$4,$5}' OFS="\t"
done >> ${OUTPUT_FILE}
grep \$i \$INPUT_FILE | grep \$j | sed -e "s/[[:space:]]\\+/\\t/g" | bedtools sort | bedtools merge -c 6,7 -o collapse | awk -v sample=\$i -v type=\$j '{ \\
print \$1,\$2,\$3,sample,type,\$4,\$5}' OFS="\\t"
done >> \${OUTPUT_FILE}
done
\ No newline at end of file
Supports Markdown
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