75343bb8e3633b0b942731a7649c6b009c2bb769
hiram
  Wed Sep 11 08:49:49 2019 -0700
beginning next Rat refs #21579

diff --git src/hg/makeDb/doc/regenRn1/initialBuild.txt src/hg/makeDb/doc/regenRn1/initialBuild.txt
new file mode 100644
index 0000000..d10a4db
--- /dev/null
+++ src/hg/makeDb/doc/regenRn1/initialBuild.txt
@@ -0,0 +1,928 @@
+# for emacs: -*- mode: sh; -*-
+
+# This file describes browser build for the regenRn1
+
+#  Can use existing photograph (otherwise find one before starting here)
+
+#########################################################################
+#  Initial steps, use existing photograph (DONE - 2019-09-08 - Hiram)
+
+# To start this initialBuild.txt document, from a previous assembly document:
+
+mkdir ~/kent/src/hg/makeDb/doc/regenRn1
+cd ~/kent/src/hg/makeDb/doc/regenRn1
+
+sed -e 's/Rn0/Rn1/g; s/DONE/TBD/g;' \
+    ../regenRn0/initialBuild.txt > initialBuild.txt
+
+mkdir -p /hive/data/genomes/regenRn1/regeneron
+# sequences were obtained via email instructions from Regeneron
+# downloaded from a URl for their secure situation
+# -rw-r--r-- 1  643996250 Sep  8 08:26 DarkAgouti_chromosomes.tgz
+
+# their file is very odd. it is not a tgz, it requires two:
+# unzip
+# unzip
+# then it is a tar file, which makes a directory:
+
+-rw-r--r-- 1 2395238400 Sep  8 08:26 file.tar
+
+tar xvf file.tat
+
+drwxrwxr-x 2       4096 Sep  7 17:39 DA_annotated_chromosomes
+
+# examples:
+-rw-rw-r-- 1 115245581 Sep  3 12:06 chr1.fasta
+-rw-rw-r-- 1  41589339 Sep  3 13:00 chr12.fasta
+
+#  Can use existing photograph
+cp -p ../regenRn0/photoReference.txt .
+cat photoReference.txt
+photoCreditURL  http://www.genome.gov/dmd/img.cfm?node=Photos/Animals/Rat%20(brown%20norway)&id=79111
+photoCreditName NHGRI press photos
+
+# check assembly size for later reference:
+
+faSize DA_annotated_chromosomes/*.fasta
+
+2395213054 bases (112730866 N's 2282482188 real 2276778425 upper 5703763 lower)
+    in 23 sequences in 23 files
+Total size: mean 104139698.0 sd 52890062.5 min 2246 (chrM)
+    max 236134952 (chr2) median 102991095
+
+# this assembly just has the 23 chromosome sequences
+
+#############################################################################
+# establish config.ra file (DONE - Hiram - 2019-09-08)
+    cd /hive/data/genomes/regenRn1
+    # copy the rn6 file and edit:
+
+    cat regenRn9.config.ra
+# Config parameters for makeGenomeDb.pl:
+db regenRn1
+clade mammal
+scientificName Rattus norvegicus
+commonName Rat
+assemblyDate May. 2019
+assemblyLabel Regeneron rat
+assemblyShortLabel Regen Rn1
+orderKey 18021
+mitoAcc none
+fastaFiles /hive/data/genomes/regenRn1/ucsc/*.fa.gz
+agpFiles /hive/data/genomes/regenRn1/ucsc/fake.agp
+# qualFiles none
+dbDbSpeciesDir rat
+photoCreditURL http://www.genome.gov/10005141
+photoCreditName NHGRI Press Photos
+ncbiGenomeId 73
+ncbiAssemblyId 382928
+ncbiAssemblyName RegenRn1
+ncbiBioProject 10629
+ncbiBioSample SAMN02808228
+genBankAccessionID GCA_000001895.4
+taxId 10116
+
+    # compare with previous version to see if it is sane:
+    diff regenRn1.config.ra ../regenRn0/regenRn0.config.ra
+
+#############################################################################
+# setup UCSC named files (DONE - 2019-09-08 - Hiram)
+
+    # copy the *.fasta files from ../regeneron/DA_annotated_chromosomes/
+    # to here, renaming to .fa, then gzip
+
+    mkdir /hive/data/genomes/regenRn1/ucsc
+    cd /hive/data/genomes/regenRn1/regeneron/DA_annotated_chromosomes
+
+    ls *.fasta | sed -e 's/.fasta//;' | while read C
+do
+  cp -p $C.fasta ../../ucsc/$C.fa
+  gzip ../../ucsc/$C.fa &
+done
+wait
+
+    cd /hive/data/genomes/regenRn1/ucsc
+
+    # construct a fakeAgp:
+    faToTwoBit *.fa.gz test.2bit
+    twoBitDup test.2bit
+    twoBitToFa test.2bit stdout | hgFakeAgp -minContigGap=1 \
+      -minScaffoldGap=100 stdin fake.agp
+
+    checkAgpAndFa fake.agp test.2bit 2>&1 | tail -4
+    # All AGP and FASTA entries agree - both files are valid
+
+    twoBitToFa test.2bit stdout | faSize stdin
+# 2395213054 bases (112730866 N's 2282482188 real 2276778425 upper
+#	5703763 lower) in 23 sequences in 1 files
+# Total size: mean 104139698.0 sd 52890062.5 min 2246 (chrM)
+#	max 236134952 (chr2) median 102991095
+# %0.24 masked total, %0.25 masked real
+
+    # no longer need the temporary 2bit file
+    rm test.2bit
+
+#############################################################################
+#  Initial database build (DONE - 2019-09-08 - Hiram)
+
+    # create the database
+    time (makeGenomeDb.pl -stop=db regenRn1.config.ra -workhorse=hgwdev) \
+       > db.log 2>&1
+    # real    14m41.734s
+
+    # finish it off
+    time (makeGenomeDb.pl -continue=dbDb regenRn1.config.ra -workhorse=hgwdev) \
+       > dbDb.log 2>&1
+    # real    0m11.683s
+
+    # check in the trackDb files created in TemporaryTrackDbCheckout/
+    #    and add regenRn1 to trackDb/makefile
+
+    # temporary symlink until masked sequence is available
+    cd /hive/data/genomes/regenRn1
+    ln -s `pwd`/regenRn1.unmasked.2bit /gbdb/regenRn1/regenRn1.2bit
+
+##############################################################################
+# cpgIslands on UNMASKED sequence (DONE - 2019-09-08 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/cpgIslandsUnmasked
+    cd /hive/data/genomes/regenRn1/bed/cpgIslandsUnmasked
+
+    time (doCpgIslands.pl -dbHost=hgwdev -bigClusterHub=ku -buildDir=`pwd` \
+       -tableName=cpgIslandExtUnmasked \
+          -maskedSeq=/hive/data/genomes/regenRn1/regenRn1.unmasked.2bit \
+             -workhorse=hgwdev -smallClusterHub=ku regenRn1) > do.log 2>&1
+    # real    3m16.335s
+
+    cat fb.regenRn1.cpgIslandExtUnmasked.txt
+    # 10642803 bases of 2282482188 (0.466%) in intersection
+
+#############################################################################
+# cytoBandIdeo - (DONE - 2019-09-08 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/cytoBand
+    cd /hive/data/genomes/regenRn1/bed/cytoBand
+    makeCytoBandIdeo.csh regenRn1
+
+#############################################################################
+# run up idKeys files for chromAlias/ncbiRefSeq (TBD - 2019-09-08 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/idKeys
+    cd /hive/data/genomes/regenRn1/bed/idKeys
+
+    time (doIdKeys.pl \
+        -twoBit=/hive/data/genomes/regenRn1/regenRn1.unmasked.2bit \
+        -buildDir=`pwd` regenRn1) > do.log 2>&1 &
+    # real    0m47.105s
+
+    cat regenRn1.keySignature.txt
+    #  7850e2d5dabb6134fdc9d7083f1a3a54
+
+#############################################################################
+# gapOverlap (DONE - 2019-09-08 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/gapOverlap
+    cd /hive/data/genomes/regenRn1/bed/gapOverlap
+    time (doGapOverlap.pl \
+        -twoBit=/hive/data/genomes/regenRn1/regenRn1.unmasked.2bit regenRn1 ) \
+        > do.log 2>&1 &
+XXX - running - Sun Sep  8 17:26:16 PDT 2019
+    # real    1m51.246s
+
+    # there are 7 items found:
+    wc -l bed.tab
+    # 7 bed.tab
+
+    cat fb.regenRn1.gapOverlap.txt
+    # 5912 bases of 2762428432 (0.000%) in intersection
+
+#############################################################################
+# tandemDups (DONE - 2019-09-08 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/tandemDups
+    cd /hive/data/genomes/regenRn1/bed/tandemDups
+    time (~/kent/src/hg/utils/automation/doTandemDup.pl \
+  -twoBit=/hive/data/genomes/regenRn1/regenRn1.unmasked.2bit regenRn1) \
+        > do.log 2>&1 &
+XXX - running - Sun Sep  8 17:26:47 PDT 2019
+    # real    369m58.055s
+
+    cat fb.regenRn1.tandemDups.txt
+    # 86298981 bases of 2762428432 (3.124%) in intersection
+
+    bigBedInfo regenRn1.tandemDups.bb | sed -e 's/^/#  /;'
+#  version: 4
+#  fieldCount: 13
+#  hasHeaderExtension: yes
+#  isCompressed: yes
+#  isSwapped: 0
+#  extraIndexCount: 0
+#  itemCount: 1,039,087
+#  primaryDataSize: 27,356,255
+#  primaryIndexSize: 178,160
+#  zoomLevels: 9
+#  chromCount: 3504
+#  basesCovered: 1,365,621,612
+#  meanDepth (of bases covered): 6.439341
+#  minDepth: 1.000000
+#  maxDepth: 307.000000
+#  std of depth: 12.663540
+
+#########################################################################
+# ucscToINSDC and ucscToRefSeq table/track (TBD - 2019-09-08 - Hiram)
+    # construct idKeys for the refseq sequence
+    mkdir /hive/data/genomes/regenRn1/refseq/idKeys
+    cd /hive/data/genomes/regenRn1/refseq/idKeys
+    faToTwoBit ../GCF_000002315.5_GRCg6a_genomic.fna.gz regenRn1.refSeq.2bit
+
+    time (doIdKeys.pl -buildDir=`pwd` \
+        -twoBit=`pwd`/regenRn1.refSeq.2bit refseqRegenRn1)  > do.log 2>&1 &
+    # real    0m48.786s
+
+    cat refseqRegenRn1.keySignature.txt
+    #  7850e2d5dabb6134fdc9d7083f1a3a54
+
+    # and the genbank sequence needs keys too:
+    mkdir /hive/data/genomes/regenRn1/refseq/idKeysGenbank
+    cd /hive/data/genomes/regenRn1/refseq/idKeysGenbank
+    faToTwoBit /hive/data/outside/ncbi/genomes/genbank/vertebrate_other/Gallus_gallus/all_assembly_versions/GCA_000002315.5_GRCg6a/GCA_000002315.5_GRCg6a_genomic.fna.gz regenRn1.genbank.2bit
+
+    time (doIdKeys.pl -buildDir=`pwd` \
+        -twoBit=`pwd`/regenRn1.genbank.2bit genbankRegenRn1)  > do.log 2>&1 &
+
+    cat genbankRegenRn1.keySignature.txt
+    #  a20fdad3318d371fcb34fcc66bab3752
+
+    mkdir /hive/data/genomes/regenRn1/bed/chromAlias
+
+    join -t$'\t' ../idKeys/regenRn1.idKeys.txt \
+        ../../refseq/idKeysGenbank/genbankRegenRn1.idKeys.txt | cut -f2- \
+          | sort -k1,1 | join -t$'\t' <(sort -k1,1 ../../chrom.sizes) - \
+            | awk '{printf "%s\t0\t%d\t%s\n", $1, $2, $3}' \
+               | sort -k1,1 -k2,2n > ucscToINSDC.bed
+
+    join -t$'\t' ../idKeys/regenRn1.idKeys.txt \
+        ../../refseq/idKeys/refseqRegenRn1.idKeys.txt | cut -f2- \
+          | sort -k1,1 | join -t$'\t' <(sort -k1,1 ../../chrom.sizes) - \
+            | awk '{printf "%s\t0\t%d\t%s\n", $1, $2, $3}' \
+               | sort -k1,1 -k2,2n > ucscToRefSeq.bed
+
+    # should be same line counts throughout:
+    wc -l * ../../chrom.sizes
+    #	463 ucscToINSDC.bed
+    #	464 ucscToRefSeq.bed
+    #	464 ../../chrom.sizes
+
+    # need to find the accession for the INSDC equivalent to chrM:
+    egrep chrM *
+# ucscToRefSeq.bed:chrM   0       16775   NC_001323.1
+    # lookup that accession at NCBI Entrez: X52392.1
+    # and add to ucscToINSDC.bed:
+    printf "chrM\t0\t16775\tX52392.1\n" >> ucscToINSDC.bed
+    # verify:
+    grep chrM *
+# ucsc.genbank.tab:chrM   X52392.1
+# ucsc.refseq.tab:chrM    NC_001323.1
+# ucscToINSDC.bed:chrM    0       16775   X52392.1
+# ucscToRefSeq.bed:chrM   0       16775   NC_001323.1
+
+    export chrSize=`cut -f1 ucscToINSDC.bed | awk '{print length($0)}' | sort -n | tail -1`
+    echo $chrSize
+    # 27
+    # use the $chrSize in this sed
+    sed -e "s/21/$chrSize/" $HOME/kent/src/hg/lib/ucscToINSDC.sql \
+         | hgLoadSqlTab regenRn1 ucscToINSDC stdin ucscToINSDC.bed
+     # should be the same for ucscToRefSeq:
+    export chrSize=`cut -f1 ucscToRefSeq.bed | awk '{print length($0)}' | sort -n | tail -1`
+    echo $chrSize
+    # 27
+    sed -e "s/21/$chrSize/" $HOME/kent/src/hg/lib/ucscToINSDC.sql \
+       | sed -e 's/INSDC/RefSeq/g;' \
+         | hgLoadSqlTab regenRn1 ucscToRefSeq stdin ucscToRefSeq.bed
+
+    # should be quiet for all OK
+    checkTableCoords regenRn1
+
+    # should cover %100 entirely:
+    featureBits -countGaps regenRn1 ucscToINSDC
+    # 1065365425 bases of 1065365425 (100.000%) in intersection
+    featureBits -countGaps regenRn1 ucscToRefSeq
+    # 1065365425 bases of 1065365425 (100.000%) in intersection
+
+#########################################################################
+# add chromAlias table (TBD - 2019-09-08 - Hiram)
+
+    mkdir /hive/data/genomes/regenRn1/bed/chromAlias
+    cd /hive/data/genomes/regenRn1/bed/chromAlias
+
+    ln -s ../../ucsc/ucsc.regeneron.name.translate regen.tab
+    ~/kent/src/hg/utils/automation/chromAlias.pl regen.tab \
+	> regenRn1.chromAlias.tab
+
+    join regen.tab <(sort -k1,1 ../../chrom.sizes) \
+      | awk '{printf "%s\t0\t%d\t%s\n", $1, $3, $2}' > regen.alias.bed
+
+     wc -l *
+#	6846 regen.alias.bed
+#	6846 regen.tab
+#	6846 regenRn1.chromAlias.tab
+
+    hgLoadSqlTab regenRn1 chromAlias ~/kent/src/hg/lib/chromAlias.sql \
+        regenRn1.chromAlias.tab
+
+    # display the Regeneron AGP file as a track:
+
+    ln -s ../../ucsc/ucsc.agp ./translatedRegen.agp
+
+    grep -v "^#" translatedRegen.agp | grep -w scaffold \
+      | awk '{printf "%s\t%d\t%d\tgap\t0\t.\n", $1, $2-1, $3}' > regen.gaps.bed
+
+    grep -v "^#" translatedRegen.agp | grep -v -w scaffold \
+      | awk '{printf "%s\t%d\t%d\t%s\t0\t%s\n", $1, $2-1, $3, $6, $9}' \
+        > regen.contigs.bed
+
+    sort -k1,1 -k2,2n regen.gaps.bed regen.contigs.bed > regen.agp.bed
+
+    hgLoadBed regenRn1 regenAGP regen.agp.bed
+    # Read 17962 elements of size 6 from regen.agp.bed
+
+    cut -f1-4 regen.gaps.bed | hgLoadBed regenRn1 regenAGPGap stdin
+    # Read 5558 elements of size 4 from stdin
+
+#########################################################################
+# fixup search rule for assembly track/gold table (TBD - 2019-09-08 - Hiram)
+    cd ~/kent/src/hg/makeDb/trackDb/rat/regenRn1
+    # preview prefixes and suffixes:
+    hgsql -N -e "select frag from gold;" regenRn1 \
+      | sed -e 's/[0-9_FR]\+//;' | sort | uniq -c 
+   6725 pi
+     67 pisub
+  47725 ss
+
+    # implies a rule: '[ps][is](sub)?[0-9]+(_[0-9FR]+)?'
+
+    # verify this rule will find them all and eliminate them all:
+    hgsql -N -e "select frag from gold;" regenRn1 | wc -l
+    # 54517
+
+    hgsql -N -e "select frag from gold;" regenRn1 \
+       | egrep -e '[ps][is](sub)?[0-9]+(_[0-9FR]+)?' | wc -l
+    # 54517
+
+    hgsql -N -e "select frag from gold;" regenRn1 \
+       | egrep -v -e '[ps][is](sub)?[0-9]+(_[0-9FR]+)?' | wc -l
+    # 0
+
+    # hence, add to trackDb/chicken/regenRn1/trackDb.ra
+searchTable gold
+shortCircuit 1
+termRegex [ps][is](sub)?[0-9]+(_[0-9FR]+)?
+query select chrom,chromStart,chromEnd,frag from %s where frag like '%s%%'
+searchPriority 8
+
+    # verify searches work in the position box
+
+##########################################################################
+# running repeat masker (DONE - 2019-09-08 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/repeatMasker
+    cd /hive/data/genomes/regenRn1/bed/repeatMasker
+    time  (doRepeatMasker.pl -buildDir=`pwd` \
+        -bigClusterHub=ku -dbHost=hgwdev -workhorse=hgwdev \
+        -smallClusterHub=ku regenRn1) > do.log 2>&1 &
+    # real    343m22.076s
+
+    cat faSize.rmsk.txt
+# 2395213054 bases (112730866 N's 2282482188 real 1288908568 upper
+#	993573620 lower) in 23 sequences in 1 files
+# Total size: mean 104139698.0 sd 52890062.5 min 2246 (chrM)
+#	max 236134952 (chr2) median 102991095
+# %41.48 masked total, %43.53 masked real
+
+    egrep -i "versi|relea" do.log
+# RepeatMasker version development-$Id: RepeatMasker,v 1.332 2017/04/17 19:01:11 rhubley Exp $
+#    February 01 2017 (open-4-0-8) 1.332 version of RepeatMasker
+# grep RELEASE /hive/data/staging/data/RepeatMasker/Libraries/RepeatMaskerLib.embl
+# CC    Dfam_Consensus RELEASE 20181026;                            *
+
+    time featureBits -countGaps regenRn1 rmsk
+    # 993577605 bases of 2395213054 (41.482%) in intersection
+    # real    0m31.877s
+
+    # why is it different than the faSize above ?
+    # because rmsk masks out some N's as well as bases, the faSize count above
+    #   separates out the N's from the bases, it doesn't show lower case N's
+
+    # faster way to get the same result on high contig count assemblies:
+    time hgsql -N -e 'select genoName,genoStart,genoEnd from rmsk;' regenRn1 \
+        | bedSingleCover.pl stdin | ave -col=4 stdin | grep "^total"
+    # total 993577605.000000
+    # real    0m19.017s
+
+##########################################################################
+# running simple repeat (DONE - 2019-09-08 - Hiram)
+
+    # The '-trf409 4' is a bit smaller than human which is 6
+
+    mkdir /hive/data/genomes/regenRn1/bed/simpleRepeat
+    cd /hive/data/genomes/regenRn1/bed/simpleRepeat
+    time (doSimpleRepeat.pl -buildDir=`pwd` -bigClusterHub=ku \
+        -dbHost=hgwdev -workhorse=hgwdev -smallClusterHub=ku \
+        -trf409=4 regenRn1) > do.log 2>&1 &
+    # real    14m43.287s
+
+    cat fb.simpleRepeat
+    # 77526109 bases of 2282482188 (3.397%) in intersection
+
+    cd /hive/data/genomes/regenRn1
+    # when using the Window Masker result:
+    cd /hive/data/genomes/regenRn1
+#    twoBitMask bed/windowMasker/regenRn1.cleanWMSdust.2bit \
+#       -add bed/simpleRepeat/trfMask.bed  regenRn1.2bit
+    #   you can safely ignore the warning about fields >= 13
+
+    # or using the rmsk result after it is done:
+    twoBitMask regenRn1.rmsk.2bit \
+        -add bed/simpleRepeat/trfMask.bed regenRn1.2bit
+    #   you can safely ignore the warning about fields >= 13
+    twoBitToFa regenRn1.2bit stdout | faSize stdin > faSize.regenRn1.2bit.txt
+    cat faSize.regenRn1.2bit.txt
+# 2395213054 bases (112730866 N's 2282482188 real 1285490790 upper
+#	996991398 lower) in 23 sequences in 1 files
+# Total size: mean 104139698.0 sd 52890062.5 min 2246 (chrM)
+#	max 236134952 (chr2) median 102991095
+# %41.62 masked total, %43.68 masked real
+
+    rm /gbdb/regenRn1/regenRn1.2bit
+    ln -s `pwd`/regenRn1.2bit /gbdb/regenRn1/regenRn1.2bit
+
+#########################################################################
+# CREATE MICROSAT TRACK (DONE - 2019-09-09 - Hiram)
+    ssh hgwdev
+    mkdir /cluster/data/regenRn1/bed/microsat
+    cd /cluster/data/regenRn1/bed/microsat
+
+    awk '($5==2 || $5==3) && $6 >= 15 && $8 == 100 && $9 == 0 {printf("%s\t%s\t%s\t%dx%s\n", $1, $2, $3, $6, $16);}' \
+       ../simpleRepeat/simpleRepeat.bed > microsat.bed
+
+    hgLoadBed regenRn1 microsat microsat.bed
+    # Read 208104 elements of size 4 from microsat.bed
+
+    featureBits regenRn1 microsat
+    # 9627095 bases of 2282482188 (0.422%) in intersection
+
+##########################################################################
+## WINDOWMASKER (DONE - 2019-09-09 - Hiram)
+    # wait for RepeatMasker to finish before this, since this is going
+    # to compare itself with the rmsk result
+
+    mkdir /hive/data/genomes/regenRn1/bed/windowMasker
+    cd /hive/data/genomes/regenRn1/bed/windowMasker
+    time (doWindowMasker.pl -buildDir=`pwd` -workhorse=hgwdev \
+        -dbHost=hgwdev regenRn1) > do.log 2>&1
+    # real    26m58.753s
+
+    # Masking statistics
+    cat faSize.regenRn1.cleanWMSdust.txt
+# 2762428432 bases (227617579 N's 2534810853 real 1629368138 upper
+#	905442715 lower) in 6846 sequences in 1 files
+# Total size: mean 403509.8 sd 6476189.8 min 101 (pi012238F)
+#	max 248247500 (ss100001) median 10668
+# %32.78 masked total, %35.72 masked real
+
+    cat fb.regenRn1.rmsk.windowmaskerSdust.txt
+    # 696560115 bases of 2762428432 (25.215%) in intersection
+
+##########################################################################
+# cpgIslands - (DONE - 2019-09-09 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/cpgIslands
+    cd /hive/data/genomes/regenRn1/bed/cpgIslands
+    time (doCpgIslands.pl -dbHost=hgwdev -bigClusterHub=ku \
+      -workhorse=hgwdev -smallClusterHub=ku regenRn1) > do.log 2>&1
+    # real    3m12.993s
+
+    cat fb.regenRn1.cpgIslandExt.txt
+    # 9240105 bases of 2282482188 (0.405%) in intersection
+
+##############################################################################
+# genscan - (DONE - 2019-09-09 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/genscan
+    cd /hive/data/genomes/regenRn1/bed/genscan
+    time (doGenscan.pl -buildDir=`pwd` -workhorse=hgwdev -dbHost=hgwdev \
+      -bigClusterHub=ku regenRn1) > do.log 2>&1
+XXX - running - Mon Sep  9 07:20:08 PDT 2019
+    # real    126m0.077s
+
+    cat fb.regenRn1.genscan.txt
+    # 54712419 bases of 2534810853 (2.158%) in intersection
+
+    cat fb.regenRn1.genscanSubopt.txt
+    # 56830306 bases of 2534810853 (2.242%) in intersection
+
+#########################################################################
+# Create kluster run files (TBD - 2019-06-29 - Hiram)
+
+    # numerator is regenRn1 gapless bases "real" as reported by:
+    featureBits -noRandom -noHap regenRn1 gap
+    # 112730866 bases of 2282482188 (4.939%) in intersection
+    #                       ^^^
+    # denominator is hg19 gapless bases as reported by:
+    #   featureBits -noRandom -noHap hg19 gap
+    #     234344806 bases of 2861349177 (8.190%) in intersection
+    # 1024 is threshold used for human -repMatch:
+    calc \( 2282482188 / 2861349177 \) \* 1024
+    #  ( 2282482188 / 2861349177 ) * 1024 = 816.839056
+
+XXX
+    # ==> use -repMatch=350 according to size scaled down from 1024 for human.
+    #   and rounded down to nearest 50
+    cd /hive/data/genomes/regenRn1
+    blat regenRn1.2bit \
+         /dev/null /dev/null -tileSize=11 -makeOoc=jkStuff/regenRn1.11.ooc \
+        -repMatch=800
+    #   Wrote 30001 overused 11-mers to jkStuff/regenRn1.11.ooc
+    # regenRn0 was repMatch 900 and:
+    #   Wrote 29409 overused 11-mers to jkStuff/regenRn1.11.ooc
+    # rn6 was repMatch 1000 and:
+    #   Wrote 27021 overused 11-mers to jkStuff/rn6.11.ooc
+    #   rn5 at repMatch 950 and:
+    #   Wrote 34513 overused 11-mers to jkStuff/rn5.11.ooc
+
+    #   check non-bridged gaps to see what the typical size is:
+    hgsql -N \
+        -e 'select * from gap where bridge="no" order by size;' regenRn1 \
+        | sort -k7,7nr | ave -col=7 stdin
+    # min 100.000000
+    # max 136961.000000
+
+    gapToLift -verbose=2 -minGap=100 regenRn1 jkStuff/nonBridged.lift \
+        -bedFile=jkStuff/nonBridged.bed
+### kent source version 387 ###
+#       chrom count: 23
+#       found 23482 gaps of size >= 100
+#       bed output requested to jkStuff/nonBridged.bed
+#       no gaps on chrom: chr11, size: 83994014
+#       no gaps on chrom: chr2, size: 236134952
+#       no gaps on chrom: chr8, size: 119798696
+#       no gaps on chrom: chrM, size: 2246
+
+    wc -l jkStuff/nonBri*
+
+    #   23505 jkStuff/nonBridged.bed
+    #   23505 jkStuff/nonBridged.lift
+
+########################################################################
+# lastz/chain/net swap human/hg38 (TBD - 2019-09-08 - Hiram)
+    # original alignment
+    cd /hive/data/genomes/hg38/bed/lastzRegenRn1.2019-09-08
+
+    cat fb.hg38.chainRegenRn1Link.txt
+    # 154079940 bases of 3095998939 (4.977%) in intersection
+    cat fb.hg38.chainSynRegenRn1Link.txt
+    # 95877644 bases of 3095998939 (3.097%) in intersection
+    cat fb.hg38.chainRBest.RegenRn1.txt
+    # 106665747 bases of 3095998939 (3.445%) in intersection
+
+    # and for the swap:
+    mkdir /hive/data/genomes/regenRn1/bed/blastz.hg38.swap
+    cd /hive/data/genomes/regenRn1/bed/blastz.hg38.swap
+
+    time (doBlastzChainNet.pl -verbose=2 \
+      /hive/data/genomes/hg38/bed/lastzRegenRn1.2019-09-08/DEF \
+        -swap -chainMinScore=5000 -chainLinearGap=loose \
+          -workhorse=hgwdev -smallClusterHub=ku -bigClusterHub=ku \
+            -syntenicNet) > swap.log 2>&1
+    #  real    9m45.514s
+
+    cat fb.regenRn1.chainHg38Link.txt
+    # 120955955 bases of 1055588482 (11.459%) in intersection
+
+    cat fb.regenRn1.chainSynHg38Link.txt
+    # 92597630 bases of 1055588482 (8.772%) in intersection
+
+    time (doRecipBest.pl -load -workhorse=hgwdev -buildDir=`pwd` regenRn1 hg38) > rbest.log 2>&1 &
+    # real    139m24.408s
+
+    cat fb.regenRn1.chainRBest.Hg38.txt
+    # 106294585 bases of 1055588482 (10.070%) in intersection
+
+#########################################################################
+# lastz/chain/net swap mouse/mm10 (TBD - 2019-09-08 - Hiram)
+
+    # original alignment
+    cd /hive/data/genomes/mm10/bed/lastzRegenRn1.2019-09-08
+    cat fb.mm10.chainRegenRn1Link.txt
+    # 101151132 bases of 2652783500 (3.813%) in intersection
+    cat fb.mm10.chainSynRegenRn1Link.txt
+    # 70707720 bases of 2652783500 (2.665%) in intersection
+    cat fb.mm10.chainRBest.RegenRn1.txt 
+    # 79649474 bases of 2652783500 (3.002%) in intersection
+
+    # and for the swap:
+    mkdir /hive/data/genomes/regenRn1/bed/blastz.mm10.swap
+    cd /hive/data/genomes/regenRn1/bed/blastz.mm10.swap
+
+    time (doBlastzChainNet.pl -verbose=2 \
+      /hive/data/genomes/mm10/bed/lastzRegenRn1.2019-09-08/DEF \
+        -swap -chainMinScore=5000 -chainLinearGap=loose \
+          -workhorse=hgwdev -smallClusterHub=ku -bigClusterHub=ku \
+            -syntenicNet) > swap.log 2>&1
+    #  real    6m41.043s
+
+    cat fb.regenRn1.chainMm10Link.txt
+    # 88539346 bases of 1055588482 (8.388%) in intersection
+
+    time (doRecipBest.pl -load -workhorse=hgwdev -buildDir=`pwd` regenRn1 mm10) > rbest.log 2>&1 &
+    # real    94m11.007s
+
+    cat fb.regenRn1.chainRBest.Mm10.txt
+    # 79474812 bases of 1055588482 (7.529%) in intersection
+
+#########################################################################
+# GENBANK AUTO UPDATE (TBD - 2019-06-29 - Hiram)
+    ssh hgwdev
+    cd $HOME/kent/src/hg/makeDb/genbank
+    git pull
+    # /cluster/data/genbank/data/organism.lst shows:
+    # #organism       mrnaCnt estCnt  refSeqCnt
+    # Rattus norvegicus       130197  1103594 17642
+
+    # edit etc/genbank.conf to add regenRn1 just before galGal5
+
+# regenRn1 (Regeneron rat assembly)
+regenRn1.serverGenome = /hive/data/genomes/regenRn1/regenRn1.2bit
+regenRn1.ooc = /hive/data/genomes/regenRn1/jkStuff/regenRn1.11.ooc
+regenRn1.lift = /hive/data/genomes/regenRn1/jkStuff/nonBridged.lift
+regenRn1.refseq.mrna.native.pslCDnaFilter  = ${finished.refseq.mrna.native.pslCDnaFilter}
+regenRn1.refseq.mrna.xeno.pslCDnaFilter    = ${finished.refseq.mrna.xeno.pslCDnaFilter}
+regenRn1.genbank.mrna.native.pslCDnaFilter = ${finished.genbank.mrna.native.pslCDnaFilter}
+regenRn1.genbank.mrna.xeno.pslCDnaFilter   = ${finished.genbank.mrna.xeno.pslCDnaFilter}
+regenRn1.genbank.est.native.pslCDnaFilter  = ${finished.genbank.est.native.pslCDnaFilter}
+regenRn1.downloadDir = regenRn1
+regenRn1.refseq.mrna.xeno.load  = yes
+regenRn1.refseq.mrna.xeno.loadDesc = yes
+regenRn1.genbank.mrna.xeno.load  = yes
+regenRn1.perChromTables = no
+regenRn1.mgc = yes
+# regenRn1.upstreamGeneTbl = ensGene
+# regenRn1.upstreamMaf = multiz13way /hive/data/genomes/regenRn1/bed/multiz13way/species.list.txt
+
+    # verify the files specified exist before checking in the file:
+  grep ^regenRn1 etc/genbank.conf | grep hive | awk '{print $NF}' | xargs ls -og
+# -rw-rw-r-- 1    247657 Jun 29 17:16 /hive/data/genomes/regenRn1/jkStuff/nonBridged.lift
+# -rw-rw-r-- 1    117644 Jun 29 17:13 /hive/data/genomes/regenRn1/jkStuff/regenRn1.11.ooc
+# -rw-rw-r-- 1 720490674 Jun 29 16:59 /hive/data/genomes/regenRn1/regenRn1.2bit
+
+    git commit -m "Added regenRn1 - Regeneron rat refs #21579" etc/genbank.conf
+    git push
+    # update /cluster/data/genbank/:
+    make etc-update
+
+    # enable daily alignment and update of hgwdev
+    cd ~/kent/src/hg/makeDb/genbank
+    git pull
+    # add regenRn1 to:
+    #   etc/align.dbs etc/hgwdev.dbs
+    git add etc/align.dbs etc/hgwdev.dbs
+    git commit -m "Added regenRn1 - Regeneron rat refs #21579" etc/hgwdev.dbs
+    git push
+    make etc-update
+
+    # wait a few days for genbank magic to take place, the tracks will
+    # appear
+
+#############################################################################
+# augustus gene track (TBD - 2019-06-29 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/augustus
+    cd /hive/data/genomes/regenRn1/bed/augustus
+    time (doAugustus.pl -buildDir=`pwd` -bigClusterHub=ku \
+        -species=human -dbHost=hgwdev \
+           -workhorse=hgwdev regenRn1) > do.log 2>&1
+    # real    194m56.414s
+
+    cat fb.regenRn1.augustusGene.txt
+    # 48867584 bases of 2534810853 (1.928%) in intersection
+
+#########################################################################
+# ncbiRefSeq (TBD - 2019-09-08 - Hiram)
+
+    mkdir /hive/data/genomes/regenRn1/bed/ncbiRefSeq
+    cd /hive/data/genomes/regenRn1/bed/ncbiRefSeq
+    # running step wise just to be careful
+    time (~/kent/src/hg/utils/automation/doNcbiRefSeq.pl -buildDir=`pwd` \
+      -bigClusterHub=ku -dbHost=hgwdev \
+      -stop=download -fileServer=hgwdev -smallClusterHub=ku -workhorse=hgwdev \
+      refseq vertebrate_other Gallus_gallus \
+      GCF_000002315.5_GRCg6a regenRn1) > download.log 2>&1
+    # real    1m19.029s
+
+    time (~/kent/src/hg/utils/automation/doNcbiRefSeq.pl -buildDir=`pwd` \
+      -continue=process -bigClusterHub=ku -dbHost=hgwdev \
+      -stop=process -fileServer=hgwdev -smallClusterHub=ku -workhorse=hgwdev \
+      refseq vertebrate_other Gallus_gallus \
+      GCF_000002315.5_GRCg6a regenRn1) > process.log 2>&1
+    # real    2m6.030s
+
+    time (~/kent/src/hg/utils/automation/doNcbiRefSeq.pl -buildDir=`pwd` \
+      -continue=load -bigClusterHub=ku -dbHost=hgwdev \
+      -stop=load -fileServer=hgwdev -smallClusterHub=ku -workhorse=hgwdev \
+      refseq vertebrate_other Gallus_gallus \
+      GCF_000002315.5_GRCg6a regenRn1) > load.log 2>&1
+    # real    0m22.312s
+
+    cat fb.ncbiRefSeq.regenRn1.txt
+    #  88641893 bases of 1055588482 (8.397%) in intersection
+
+    # need to add: include ../../refSeqComposite.ra alpha
+    # to the chicken/regenRn1/trackDb.ra to turn on the track in the browser
+
+    # there was one gene that claimed to have a protein, but the
+    # protein sequence was not included in the protein.faa file
+    # discovered from joinerCheck
+    # manual fix to blank out this one protein, to see the entry
+    hgsql -e 'select * from ncbiRefSeqLink where protAcc="NP_989875.1";' regenRn1
+    hgsql -e 'update ncbiRefSeqLink set protAcc="" where protAcc="NP_989875.1";' regenRn1
+    # this makes the 'protein' link disappear from the gene details page
+    # curious that this gene is marked as a non-coding gene anyway ?
+    # gene: FET1 at chr4:63,102,774-63,105,516-
+
+    featureBits -enrichment regenRn1 refGene ncbiRefSeq 
+ # refGene 1.374%, ncbiRefSeq 8.397%, both 1.370%, cover 99.73%, enrich 11.88x
+    featureBits -enrichment regenRn1 ncbiRefSeq refGene
+ # ncbiRefSeq 8.397%, refGene 1.374%, both 1.370%, cover 16.32%, enrich 11.88x
+
+    featureBits -enrichment regenRn1 ncbiRefSeqCurated refGene
+ # ncbiRefSeqCurated 1.368%, refGene 1.374%, both 1.364%, cover 99.71%, enrich 72.59x
+    featureBits -enrichment regenRn1 refGene ncbiRefSeqCurated
+ # refGene 1.374%, ncbiRefSeqCurated 1.368%, both 1.364%, cover 99.32%, enrich 72.59x
+
+#########################################################################
+# LIFTOVER TO rn6 (DONE - 2019-09-09 - Hiram)
+    ssh hgwdev
+    mkdir /hive/data/genomes/regenRn1/bed/blat.rn6.2019-09-09
+    cd /hive/data/genomes/regenRn1/bed/blat.rn6.2019-09-09
+    doSameSpeciesLiftOver.pl -verbose=2 \
+        -debug -bigClusterHub=ku -dbHost=hgwdev -workhorse=hgwdev \
+        -ooc=/hive/data/genomes/regenRn1/jkStuff/regenRn1.11.ooc \
+         regenRn1 rn6
+    time (doSameSpeciesLiftOver.pl -verbose=2 \
+        -bigClusterHub=ku -dbHost=hgwdev -workhorse=hgwdev \
+        -ooc=/hive/data/genomes/regenRn1/jkStuff/regenRn1.11.ooc \
+         regenRn1 rn6) > doLiftOverToRn6.log 2>&1
+    # real    171m37.650s
+
+    # see if the liftOver menus function in the browser from regenRn1 to rn6
+
+    # would like to see this as a track:
+    time (chainToPsl regenRn1ToRn6.over.chain.gz ../../chrom.sizes \
+   /hive/data/genomes/rn6/chrom.sizes ../../regenRn1.2bit \
+   /hive/data/genomes/rn6/rn6.2bit regenRn1ToRn6.psl) > chainToPsl.log 2>&1
+XXX - running - Tue Sep 10 13:49:46 PDT 2019
+
+#########################################################################
+# LIFTOVER TO regenRn0 (DONE - 2019-09-09 - Hiram)
+    ssh hgwdev
+    mkdir /hive/data/genomes/regenRn1/bed/blat.regenRn0.2019-09-09
+    cd /hive/data/genomes/regenRn1/bed/blat.regenRn0.2019-09-09
+    doSameSpeciesLiftOver.pl -verbose=2 \
+        -debug -bigClusterHub=ku -dbHost=hgwdev -workhorse=hgwdev \
+        -ooc=/hive/data/genomes/regenRn1/jkStuff/regenRn1.11.ooc \
+         regenRn1 regenRn0
+    time (doSameSpeciesLiftOver.pl -verbose=2 \
+        -bigClusterHub=ku -dbHost=hgwdev -workhorse=hgwdev \
+        -ooc=/hive/data/genomes/regenRn1/jkStuff/regenRn1.11.ooc \
+         regenRn1 regenRn0) > doLiftOverToRegenRn0.log 2>&1
+    # real    176m49.811s
+
+    # see if the liftOver menus function in the browser from regenRn1 to galGal5
+
+    # would like to see this as a track:
+    time (chainToPsl regenRn1ToRegenRn0.over.chain.gz ../../chrom.sizes \
+   /hive/data/genomes/regenRn0/chrom.sizes ../../regenRn1.2bit \
+   /hive/data/genomes/regenRn0/regenRn0.2bit regenRn1ToRegenRn0.psl) > chainToPsl.log 2>&1
+   # real    0m24.740s
+
+#########################################################################
+#  BLATSERVERS ENTRY (TBD - 2019-09-08 - Hiram)
+#	After getting a blat server assigned by the Blat Server Gods,
+    ssh hgwdev
+
+    hgsql -e 'INSERT INTO blatServers (db, host, port, isTrans, canPcr) \
+	VALUES ("regenRn1", "blat1a", "17892", "1", "0"); \
+	INSERT INTO blatServers (db, host, port, isTrans, canPcr) \
+	VALUES ("regenRn1", "blat1a", "17893", "0", "1");' \
+	    hgcentraltest
+    #	test it with some sequence
+
+############################################################################
+## reset default position to MEPE gene (egg shell protein)
+##  (TBD - 2019-09-08 - Hiram)
+
+    # as found from the galGal5 to regenRn1 liftOver
+    ssh hgwdev
+    hgsql -e 'update dbDb set defaultPos="chr4:45667017-45672928"
+	where name="regenRn1";' hgcentraltest
+
+#########################################################################
+# crispr whole genome (WORKING - 2019-07-02 - Hiram)
+    mkdir /hive/data/genomes/regenRn1/bed/crisprAll
+    cd /hive/data/genomes/regenRn1/bed/crisprAll
+
+    # working on this script, adding the indexFa step:
+    time (~/kent/src/hg/utils/automation/doCrispr.pl \
+   -stop=indexFa -buildDir=`pwd` -smallClusterHub=ku regenRn1 augustusGene) \
+	> indexFa.log 2>&1
+XXX - running - Tue Jul  2 11:09:39 PDT 2019
+    # real    23m26.694s
+
+    # the large shoulder argument will cause the entire genome to be scanned
+~/kent/src/hg/utils/automation/doCrispr.pl -verbose=2 -stop=ranges \
+    hg19 knownGene -shoulder=250000000 -tableName=crisprAll -fileServer=hgwdev \
+    -buildDir=`pwd` -smallClusterHub=hgwdev-101 -bigClusterHub=ku \
+      -workhorse=hgwdev
+
+
+    time (~/kent/src/hg/utils/automation/doCrispr.pl \
+       -continue=ranges -stop=guides -buildDir=`pwd` -smallClusterHub=ku \
+           regenRn1 ncbiRefSeq) > guides.log 2>&1
+    # real    2m50.758s
+
+    # adding the /dev/shm/ setup rsync for the indexed Fa
+    # performed manually to work out the procedure
+    time (~/kent/src/hg/utils/automation/doCrispr.pl \
+        -continue=specScores -stop=specScores -buildDir=`pwd` \
+           -smallClusterHub=ku regenRn1 ncbiRefSeq) > specScores.log
+
+    # had about half of ku for about half this time:
+# Completed: 884922 of 884922 jobs
+# CPU time in finished jobs:  35872791s  597879.85m  9964.66h  415.19d  1.138 y
+# IO & Wait Time:               899261s   14987.69m   249.79h   10.41d  0.029 y
+# Average job time:                 42s       0.69m     0.01h    0.00d
+# Longest finished job:             88s       1.47m     0.02h    0.00d
+# Submission to last job:        48045s     800.75m    13.35h    0.56d
+
+
+    time find tmp/outGuides -type f | xargs cut -f3-6 > ../specScores.tab
+    # real    236m17.220s
+    wc -l specScores.tab
+    # 66451712 specScores.tab
+
+    time (~/kent/src/hg/utils/automation/doCrispr.pl \
+	-continue=effScores -stop=load \
+	    -buildDir=`pwd` -smallClusterHub=ku regenRn1 ncbiRefSeq) \
+	> load.log
+    # real    307m41.143s
+
+#########################################################################
+# all.joiner update, downloads and in pushQ - (TBD - 2018-10-17 - Hiram)
+xyz
+    cd $HOME/kent/src/hg/makeDb/schema
+    # verify all the business is done for release
+    ~/kent/src/hg/utils/automation/verifyBrowser.pl regenRn1
+
+    # fixup all.joiner until this is a clean output
+    joinerCheck -database=regenRn1 -tableCoverage all.joiner
+    joinerCheck -database=regenRn1 -times all.joiner
+    joinerCheck -database=regenRn1 -keys all.joiner
+
+    # when clean, check in:
+    git commit -m 'adding rules for regenRn1 refs #22113' all.joiner
+    git push
+    # run up a 'make alpha' in hg/hgTables to get this all.joiner file
+    # into the hgwdev/genome-test system
+
+    cd /hive/data/genomes/regenRn1
+    time (makeDownloads.pl regenRn1) > downloads.log 2>&1
+    #  real    10m7.605s
+
+    #   now ready for pushQ entry
+    mkdir /hive/data/genomes/regenRn1/pushQ
+    cd /hive/data/genomes/regenRn1/pushQ
+  time (makePushQSql.pl -redmineList regenRn1) > regenRn1.pushQ.sql 2> stderr.out
+    # real    9m58.779s
+
+    # remove the extra chainNet files from the listings:
+    sed -i -e "/etNig1/d" redmine.regenRn1.file.list
+    sed -i -e "/asAcu1/d" redmine.regenRn1.file.list
+    sed -i -e "/etNig1/d" redmine.regenRn1.table.list
+    sed -i -e "/onAlb1/d" redmine.regenRn1.table.list
+    sed -i -e "/asAcu1/d" redmine.regenRn1.table.list
+    sed -i -e "/Stickleback/d" redmine.regenRn1.releaseLog.txt
+    sed -i -e "/Tetraodon/d" redmine.regenRn1.releaseLog.txt
+    sed -i -e "/sparrow/d" redmine.regenRn1.releaseLog.txt
+    # remove the tandemDups and gapOverlap from the file list:
+    sed -i -e "/tandemDups/d" redmine.regenRn1.table.list
+    sed -i -e "/Tandem Dups/d" redmine.regenRn1.releaseLog.txt
+    sed -i -e "/gapOverlap/d" redmine.regenRn1.table.list
+    sed -i -e "/Gap Overlaps/d" redmine.regenRn1.releaseLog.txt
+    #  real    7m21.629s
+
+    #   check for errors in stderr.out, some are OK, e.g.:
+    # WARNING: hgwdev does not have /gbdb/regenRn1/wib/gc5Base.wib
+    # WARNING: hgwdev does not have /gbdb/regenRn1/wib/quality.wib
+    # WARNING: hgwdev does not have /gbdb/regenRn1/bbi/quality.bw
+    # WARNING: regenRn1 does not have seq
+    # WARNING: regenRn1 does not have extFile
+
+    # add the path names to the listing files in the redmine issue
+    # in the three appropriate entry boxes:
+
+#	/hive/data/genomes/regenRn1/pushQ/redmine.regenRn1.file.list
+#	/hive/data/genomes/regenRn1/pushQ/redmine.regenRn1.releaseLog.txt
+#	/hive/data/genomes/regenRn1/pushQ/redmine.regenRn1.table.list
+
+#########################################################################