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

1.27 2010/02/05 23:52:29 hiram
handle chrom names for chromInfo that are longer than 16 chars
Index: src/hg/utils/automation/makeGenomeDb.pl
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/utils/automation/makeGenomeDb.pl,v
retrieving revision 1.26
retrieving revision 1.27
diff -b -B -U 4 -r1.26 -r1.27
--- src/hg/utils/automation/makeGenomeDb.pl	4 Feb 2010 18:33:19 -0000	1.26
+++ src/hg/utils/automation/makeGenomeDb.pl	5 Feb 2010 23:52:29 -0000	1.27
@@ -668,9 +668,13 @@
   $bossScript->add (<<_EOF_
 hgsql '' -e 'create database $db'
 df -h /var/lib/mysql
 hgsql $db < \${HOME}/kent/src/hg/lib/grp.sql
-hgLoadSqlTab $db chromInfo \${HOME}/kent/src/hg/lib/chromInfo.sql \\
+cut -f1 $HgAutomate::trackBuild/chromInfo/chromInfo.tab | awk '{print length(\$0)}' | sort -nr > $HgAutomate::trackBuild/chromInfo/t.chrSize
+set chrSize = `head -1 $HgAutomate::trackBuild/chromInfo/t.chrSize`
+sed -e "s/chrom(16)/chrom(\$chrSize)/" \${HOME}/kent/src/hg/lib/chromInfo.sql > $HgAutomate::trackBuild/chromInfo/chromInfo.sql
+rm -f $HgAutomate::trackBuild/chromInfo/t.chrSize
+hgLoadSqlTab $db chromInfo $HgAutomate::trackBuild/chromInfo/chromInfo.sql \\
   $HgAutomate::trackBuild/chromInfo/chromInfo.tab
 _EOF_
   );