File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -275,7 +275,19 @@ task FilterLargePESRCallsWithoutRawDepthSupport {
275275 cat large_dels_without_raw_depth_support.list large_dups_without_raw_depth_support.list > large_pesr_without_raw_depth_support.list
276276
277277 cat \
278- <(gzip -cd ~{pesr_vcf } | grep -v '^#' | grep -w -f large_pesr_without_raw_depth_support.list | sed -e 's/SVTYPE=DEL/SVTYPE=BND/' -e 's/SVTYPE=DUP/SVTYPE=BND/' -e 's/<DEL>/<BND>/' -e 's/<DUP>/<BND>/' ) \
278+ <(gzip -cd ~{pesr_vcf } | grep -v '^#' | grep -w -f large_pesr_without_raw_depth_support.list | sed -e 's/SVTYPE=DEL/SVTYPE=BND/' -e 's/SVTYPE=DUP/SVTYPE=BND/' -e 's/<DEL>/<BND>/' -e 's/<DUP>/<BND>/' \
279+ | awk -F '\t' '
280+ BEGIN { OFS="\t" }
281+ {
282+ end="";
283+ if (match($8, /(^|;)END=([0-9]+)/, m)) { end=m[2]; }
284+ if ($8 !~ /(^|;)CHR2=/) { $8 = $8 ";CHR2=" $1; }
285+ if (end != "" && $8 !~ /(^|;)END2=/) { $8 = $8 ";END2=" end; }
286+ if ($8 ~ /(^|;)END=[0-9]+/) { gsub(/END=[0-9]+/, "END=" $2, $8); }
287+ else { $8 = $8 ";END=" $2; }
288+ print $0;
289+ }'
290+ ) \
279291 <(gzip -cd ~{pesr_vcf } | grep -v '^#' | grep -v -w -f large_pesr_without_raw_depth_support.list ) \
280292 | cat <(sed -n -e '/^#/p' <(zcat ~{pesr_vcf })) - \
281293 | vcf-sort -c \
You can’t perform that action at this time.
0 commit comments