changeset 1:ce6806e0539f draft

Uploaded
author jshay
date Thu, 15 Aug 2019 16:18:59 -0400
parents e40ccd3eab44
children f1ee529ae710
files filterinfo/filterinfo.sh filterinfo/test
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/filterinfo/filterinfo.sh	Tue Aug 13 15:34:03 2019 -0400
+++ b/filterinfo/filterinfo.sh	Thu Aug 15 16:18:59 2019 -0400
@@ -37,13 +37,13 @@
 		divideby=4
 	fi
 	# print % reads passing filter to an outfile
-	if [[ $FILTERED == *.gz ]]; then
+	if [ $(file $FILTERED | awk '{print $2}') == "gzip" ]; then
 		pass=$(gunzip -c $FILTERED | wc -l | awk '{print $1}')
 	else
 		pass=$(wc -l $FILTERED | awk '{print $1}')
 	fi
 	pass=$(expr $pass / $divideby)
-	if [[ $FULL == *.gz ]]; then
+	if [ $(file $FULL | awk '{print $2}') == "gzip" ]; then
 		total=$(gunzip -c $FULL | wc -l | awk '{print $1}')
 	else
 		total=$(wc -l $FULL | awk '{print $1}')
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filterinfo/test	Thu Aug 15 16:18:59 2019 -0400
@@ -0,0 +1,2 @@
+Input Reads	Reads Passing Filter	Fraction Reads Passing Filter
+100000	100000	1.00000