src/utils/qa/getChromFieldName.csh 1.3

1.3 2009/05/11 03:44:41 kuhn
added support for split tables
Index: src/utils/qa/getChromFieldName.csh
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/qa/getChromFieldName.csh,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 4 -r1.2 -r1.3
--- src/utils/qa/getChromFieldName.csh	11 Apr 2009 00:37:03 -0000	1.2
+++ src/utils/qa/getChromFieldName.csh	11 May 2009 03:44:41 -0000	1.3
@@ -15,9 +15,9 @@
 if ( $#argv != 2 ) then
   echo
   echo '  Finds the proper column names if "chrom", "tName" or "genoName".'
   echo
-  echo "    usage:  database, table"
+  echo "    usage:  database table"
   echo
   exit
 else
   set db=$argv[1]
@@ -28,10 +28,18 @@
  echo "\n error: you must run this script on dev!\n"
  exit 1
 endif
 
+set split=`getSplit.csh $db $table`
+if ( $status ) then
+  echo "problem in getSplit.csh"
+endif
+if ( $split != "unsplit" ) then
+  set table="${split}_$table"
+endif
+
 set chr=`hgsql -N -e "DESC $table" $db | gawk '{print $1}' | egrep -w "chrom|tName|genoName"`
-if ($status) then
+if ( $status ) then
   echo '\n  '$db.$table' has no "chrom", "tName" or "genoName" fields.\n'
   echo ${0}:
   $0
   exit 1