src/utils/qa/compareTableToFile.csh 1.2

1.2 2009/04/27 16:43:59 ann
if the file is of type wiggle, then call checkWigFiles script
Index: src/utils/qa/compareTableToFile.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/qa/compareTableToFile.csh,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 4 -r1.1 -r1.2
--- src/utils/qa/compareTableToFile.csh	24 Apr 2009 22:44:57 -0000	1.1
+++ src/utils/qa/compareTableToFile.csh	27 Apr 2009 16:43:59 -0000	1.2
@@ -15,20 +15,21 @@
 
 set db=""
 set table=""
 set file=""
+set wig="F"
 set verb="F"
 
 # usage statement
-if ( $#argv < 3 || $#argv > 4 ) then
+if ( $#argv < 3 || $#argv > 5 ) then
  echo
  echo " Ensures that a table correlates with its associated file."
  echo " Only prints results if there is a diff between table and file."
  echo " Works for these file types: narrowPeak, broadPeak, gappedPeak,"
  echo "                             bedGraph, NRE, BiP, gcf"
- echo " (for wiggle files use: checkWigFiles.csh)"
+ echo " For wiggle files, you must specify [wig] parameter."
  echo
- echo "  usage:  database tableName fileName [verbose]"
+ echo "  usage:  database tableName fileName [wig] [verbose]"
  echo "   fileName includes path of download file "
  echo "   e.g. /goldenPath/<db>/fileName.gz"
  echo
  echo "   use verbose for more details"
@@ -39,12 +40,21 @@
 set db=$argv[1]
 set table=$argv[2]
 set file=$argv[3]
 
-if ( $#argv == 4 ) then
+if ( 5 == $#argv ) then
+ set wig="T"
  set verb="T"
 endif
 
+if ( 4 == $#argv ) then
+ if ( "wig" == $argv[4] ) then
+  set wig="T"
+ else
+  set verb="T"
+ endif
+endif
+
 if ( "$HOST" != "hgwdev" ) then
  echo "\nERROR: this script must be run from hgwdev."
  exit 1
 endif
@@ -53,8 +63,14 @@
  echo " \nERROR: sorry I can't find the original file here: ~$file\n"
  exit 1
 endif
 
+# if this is a wiggle file, call checkWigFiles script
+if ( "T" == $wig ) then
+ checkWigFiles.csh $db $table $file rm
+ exit 0
+endif
+
 # get count and size (sum(chromEnd-chromStart))from $file
 set numF=`zcat $file | egrep -v "track" | gawk '{++n} END {print n}'`
 set sizeF=`zcat $file | gawk '{size+=$3-$2} END {print size}'`