Commit 2a9af241 authored by amunoz's avatar amunoz Committed by lrodrin
Browse files

Removed gridss_filter and collapse scripts from input

parent b21e4d3d
......@@ -5,14 +5,11 @@ process COLLAPSE {
publishDir "${params.outputDir}", mode: 'copy'
input:
path script
path input
output:
path "*.bed", emit: output
path "*.bed"
script:
"""
sh $script $input
"""
template "collapse.sh"
}
......@@ -2,7 +2,6 @@ process GRIDSS_FILTER {
tag { "gridss filter" }
input:
path script
path input
path sample
val max_len
......@@ -10,13 +9,13 @@ process GRIDSS_FILTER {
val min_q
output:
path "*", emit: output
path "*"
script:
"""
for i in $input
do
sh $script \$i $sample $min_len $max_len $min_q
sh $projectDir/templates/gridss_filter.sh \$i $sample $min_len $max_len $min_q
done
"""
}
......@@ -41,11 +41,11 @@ workflow SUB_CNV_GRIDSS {
indexs,
blacklist)
STRUCTURAL_VARIANTS( GRIDSS.out, structural_variants_script )
GRIDSS_FILTER( gridss_filter_script, STRUCTURAL_VARIANTS.out, samples, max_len, min_len, min_q )
GRIDSS_FILTER( STRUCTURAL_VARIANTS.out, samples, max_len, min_len, min_q )
GRIDSS_UNION( GRIDSS_FILTER.out )
GRIDSS_MERGE( collapse_script, GRIDSS_UNION.out )
GRIDSS_MERGE( GRIDSS_UNION.out )
emit:
output = GRIDSS_MERGE.out
}
}
\ No newline at end of file
#!/bin/bash
INPUT_FILE=$1
OUTPUT_NAME=$(echo "$INPUT_FILE" | sed 's/bed/sorted.merged.bed/g')
OUTPUT_FILE=$(echo "$OUTPUT_NAME" | sed "s/.*\///")
INPUT_FILE=$input
OUTPUT_NAME=\$(echo "\$INPUT_FILE" | sed 's/bed/sorted.merged.bed/g')
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 max,distinct | 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 max,distinct | 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
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