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 { process CODEX_FILTER {
tag "codex filter" tag { "codex filter" }
input: input:
path input path input
...@@ -10,10 +10,10 @@ process CODEX_FILTER { ...@@ -10,10 +10,10 @@ process CODEX_FILTER {
val min_lratio val min_lratio
output: output:
path "*.bed", emit: output path "*.bed"
script: 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 { process EXOMEDEPTH_FILTER {
tag "exomedepth filter" tag { "exomedepth filter" }
input: input:
path script
path input path input
path samples path samples
val max_len val max_len
...@@ -10,10 +9,10 @@ process EXOMEDEPTH_FILTER { ...@@ -10,10 +9,10 @@ process EXOMEDEPTH_FILTER {
val min_bf val min_bf
output: output:
path "*.bed", emit: output path "*.bed"
script: 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 { ...@@ -2,7 +2,6 @@ process MANTA_FILTER {
tag { "manta filter" } tag { "manta filter" }
input: input:
path script
path input path input
path samples path samples
val max_len val max_len
...@@ -10,13 +9,13 @@ process MANTA_FILTER { ...@@ -10,13 +9,13 @@ process MANTA_FILTER {
val min_q val min_q
output: output:
path "*", emit: output path "*"
script: script:
""" """
for i in $input for i in $input
do 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 done
""" """
} }
process MERGE_ALL { process MERGE_ALL {
tag "merge all" tag { "merge all" }
container 'quay.io/biocontainers/bedtools:2.26.0gx--he513fc3_4' container 'quay.io/biocontainers/bedtools:2.26.0gx--he513fc3_4'
input: input:
path input path input
path script
output: output:
path "*.bed", emit: output path "*.bed"
script: script:
""" template "merge_all.sh"
sh $script $input
"""
} }
\ No newline at end of file
...@@ -14,11 +14,10 @@ include { ...@@ -14,11 +14,10 @@ include {
workflow SUB_FINAL_FILTERING { workflow SUB_FINAL_FILTERING {
take: take:
cnv_results cnv_results
merge_all_script
main: main:
UNION( cnv_results ) UNION( cnv_results )
MERGE( UNION.out, merge_all_script ) MERGE( UNION.out )
emit: emit:
output = MERGE.out output = MERGE.out
......
#!/bin/bash #!/bin/bash
INPUT_FILE=$1 INPUT_FILE=$input
OUTPUT_NAME=${INPUT_FILE/bed/sorted.merged.bed} OUTPUT_NAME=\${INPUT_FILE/bed/sorted.merged.bed}
OUTPUT_FILE=$(echo "$OUTPUT_NAME" | sed "s/.*\///") 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 do
for j in "DEL" "DUP" for j in "DEL" "DUP"
do 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 '{ \ 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" print \$1,\$2,\$3,sample,type,\$4,\$5}' OFS="\\t"
done >> ${OUTPUT_FILE} done >> \${OUTPUT_FILE}
done 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