src/hg/utils/automation/makeGenomeDb.pl 1.30

1.30 2010/04/13 23:18:44 hiram
verify no dots in chrom names
Index: src/hg/utils/automation/makeGenomeDb.pl
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/utils/automation/makeGenomeDb.pl,v
retrieving revision 1.29
retrieving revision 1.30
diff -b -B -U 4 -r1.29 -r1.30
--- src/hg/utils/automation/makeGenomeDb.pl	2 Mar 2010 19:13:54 -0000	1.29
+++ src/hg/utils/automation/makeGenomeDb.pl	13 Apr 2010 23:18:44 -0000	1.30
@@ -466,12 +466,29 @@
     );
   }
 
   # Having made the unmasked .2bit, make chrom.sizes and chromInfo.tab:
+  # verify no dots allowed in chrom names
   $bossScript->add(<<_EOF_
 
 twoBitInfo $db.unmasked.2bit stdout | sort -k2nr > chrom.sizes
 
+# if no dots in chrom names, should have only one kind of field size:
+set noDots = `cut -f 1 chrom.sizes | awk -F'.' '{print NF}' | sort -u | wc -l`
+
+if ( \$noDots != 1 ) then
+  echo "ERROR: no dots allowed in chrom names !  e.g.:"
+  grep "\." chrom.sizes | head -3
+  exit 1
+endif
+# only one kind of field size and it must be simply a one:
+set dotCount = `cut -f 1 chrom.sizes | awk -F'.' '{print NF}' | sort -u`
+if ( \$dotCount != 1 ) then
+  echo "ERROR: no dots allowed in chrom names !  e.g.:"
+  grep "\." chrom.sizes | head -3
+  exit 1
+endif
+
 rm -rf $HgAutomate::trackBuild/chromInfo
 mkdir $HgAutomate::trackBuild/chromInfo
 awk '{print \$1 "\t" \$2 "\t$HgAutomate::gbdb/$db/$db.2bit";}' chrom.sizes \\
   > $HgAutomate::trackBuild/chromInfo/chromInfo.tab