Skip to content

Instantly share code, notes, and snippets.

@armish
Created July 15, 2016 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armish/1d8561171ca4447f6d1d24275da92b29 to your computer and use it in GitHub Desktop.
Save armish/1d8561171ca4447f6d1d24275da92b29 to your computer and use it in GitHub Desktop.
A script to summarize FASTQC results to be included in an email.
#!/bin/bash
# Usage:
# $ bash fastqc_to_email.sh REPORT_HEADER /path/to/file1.html /path/to/file2.html ...
#
# requires the unzipped folder containing the summaries to be present in the same folder
# with the HTML report!
JOB_NAME=$1
echo "# FASTQC ran for $JOB_NAME"
shift
# Convert html paths into their summary counter-parts
SUMMARY_FILES=$(echo "$@" |sed -e 's/\.html/\/summary.txt/g')
for qcsummary in $SUMMARY_FILES
do
NUM_OF_PASSES=$(cat ${qcsummary} |grep PASS |wc -l |awk '{ print $1 }')
NUM_OF_CHECKS=$(cat ${qcsummary} |wc -l |awk '{ print $1 }')
echo "## File: $qcsummary"
echo "## Result: $NUM_OF_PASSES/$NUM_OF_CHECKS passed"
echo "## Issues: "
cat ${qcsummary} |grep -v "PASS" |cut -f1,2 |sed -e 's/^/ - /g'
echo -en "\n"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment