Skip to content

Commit

Permalink
The $somatic_functional_indel_vcf has a header that was counted, resu…
Browse files Browse the repository at this point in the history
…lting in a wrong branch choice for PDF creation. Furthermore, a branch for no functional variants was added.
  • Loading branch information
vinjana committed Nov 4, 2019
1 parent 34699b6 commit 7078229
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions resources/analysisTools/indelCallingWorkflow/filter_vcf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ ${PERL_BINARY} ${TOOL_PLATYPUS_INDEL_EXTRACTOR} --bgzip=${BGZIP_BINARY} --tabix=

[[ ! -d ${screenshot_dir} ]] && mkdir ${screenshot_dir} && cd ${screenshot_dir}

functional_var_count=`cat ${somatic_functional_indel_vcf} | wc -l | cut -f1 -d " "`
functional_var_count=`cat ${somatic_functional_indel_vcf} | tail -n +2 | wc -l | cut -f1 -d " "`

if [[ $functional_var_count -le $MAX_VARIANT_SCREENSHOTS ]]
then
if [[ $functional_var_count -eq 0 ]]; then
printf "WARNING: No functional variants present in ${somatic_functional_indel_vcf}\n"
$RSCRIPT_BINARY "$TOOL_TEXT_PDF" "WARNING: No functional variants." \
> "$combined_screen_shots"

elif [[ $functional_var_count -le $MAX_VARIANT_SCREENSHOTS ]]; then

if [[ "${isControlWorkflow}" == true ]]; then
${PYTHON_BINARY} ${TOOL_SCREENSHOT} \
Expand Down Expand Up @@ -105,8 +109,8 @@ then

${GHOSTSCRIPT_BINARY} -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=${combined_screen_shots} ${sorted}
else
printf "WARNINGS: No screenshots done, more than $MAX_VARIANT_SCREENSHOTS (cvalue - MAX_VARIANT_SCREENSHOTS) functional variants present in ${somatic_functional_indel_vcf}\n"
$RSCRIPT_BINARY "$TOOL_TEXT_PDF" "WARNING\nNo screenshots done. More than $MAX_VARIANT_SCREENSHOTS functional variants." \
printf "WARNING: No screenshots done, more than $MAX_VARIANT_SCREENSHOTS (cvalue - MAX_VARIANT_SCREENSHOTS) functional variants present in ${somatic_functional_indel_vcf}\n"
$RSCRIPT_BINARY "$TOOL_TEXT_PDF" "WARNING: No screenshots done. More than $MAX_VARIANT_SCREENSHOTS functional variants." \
> "$combined_screen_shots"
fi

Expand Down

0 comments on commit 7078229

Please sign in to comment.