src/utils/qa/checkScaffoldGaps.csh 1.3
1.3 2009/04/11 00:37:02 rhead
Sourced new qaConfig file at the top. Changed -h hgwbeta lines to look for sql host stored in a variable, specified in the new qaConfig file.
Index: src/utils/qa/checkScaffoldGaps.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/qa/checkScaffoldGaps.csh,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 1000000 -r1.2 -r1.3
--- src/utils/qa/checkScaffoldGaps.csh 13 Dec 2004 18:36:20 -0000 1.2
+++ src/utils/qa/checkScaffoldGaps.csh 11 Apr 2009 00:37:02 -0000 1.3
@@ -1,55 +1,56 @@
#!/bin/tcsh
+source `which qaConfig.csh`
###############################################
#
# 12-01-04
# Robert Kuhn
#
# Checks that gaps and gold add up to size for scaffold-based assemblies.
#
###############################################
set db=""
set table=""
set column=""
if ($#argv != 1) then
# no command line args
echo
echo " checks that gaps and gold add up to size for scaffold-based assemblies."
echo
echo " usage: database"
echo
exit
else
set db=$argv[1]
endif
# --------------------------------------------
set count=0
set errFlag="0"
hgsql -N -e "SELECT chrom FROM chromInfo" $db | sort > $db.chromInfo.dev
foreach chrom (`cat $db.chromInfo.dev`)
set count=`echo $count | gawk '{print $1 + 1}'`
set size=`hgsql -N -e 'SELECT size FROM chromInfo WHERE chrom = "'$chrom'"' $db`
set gaps=`hgsql -N -e 'SELECT SUM(chromEnd) - SUM(chromStart) FROM gap WHERE chrom = "'$chrom'"' $db`
set gold=`hgsql -N -e 'SELECT SUM(chromEnd) - SUM(chromStart) FROM gold \
WHERE chrom = "'$chrom'"' $db`
set totalsize=`echo "$gaps $gold" | gawk '{print $1 + $2}'`
if ($totalsize != $size) then
echo "gap + gold not equal to size for $chrom"
echo "gap + gold not equal to size for $chrom" >> $db.gapGoldWrong
set errFlag="1"
else
echo $count $chrom
endif
end
if ($errFlag == "0") then
echo "gap + gold = chromInfo.size for all chroms."
else
echo cat $db.gapGoldWrong
endif
# rm -f $db.chromInfo.dev