#This is the first release of the low-coverage 1.5X assembly of the bushbaby
#(Otolemur garnettii). The genome sequencing and assembly is provided by the
#Broad Institute.
#
#The N50 size is the length such that 50% of the assembled genome lies in
#blocks of the N50 size or longer. The N50 length for supercontigs is 101.35 kb
#and is 3.13 kb for contigs. The total number of bases in supercontigs is 3.39
#Gb and in contigs is 1.97 Gb.

#	http://www.ncbi.nlm.nih.gov/Traces/wgs/?val=AAQR00

#
##########################################################################
#  Run the makeGenomeDb.pl script (DONE - 2006-12-18 - Robert)
    # prepare for the makeGenomeDb.pl script:
    ssh hgwdev
    cd /cluster/data/otoGar1
cat << '_EOF_' > otoGar1.config.ra 
# Config parameters for makeGenomeDb.pl:
db otoGar1
clade vertebrate
genomeCladePriority 16
commonName Bushbaby
scientificName Otolemur garnetti 
assemblyDate Dec. 2006
assemblyLabel Broad version 1
orderKey 16
fakeAgpMinContigGap 25
fakeAgpMinScaffoldGap 25 
mitoAcc none
fastaFiles /cluster/data/otoGar1/fromBroad/Draft_v1.agp.chromosome.fasta
dbDbSpeciesDir bushbaby
_EOF_

~/kent/src/hg/utils/automation/makeGenomeDb.pl otoGar1.config.ra
~/kent/src/hg/utils/automation/makeGenomeDb.pl otoGar1.config.ra -continue agp
#########################################################################
#WindowMasker
ssh kolossus
cd /cluster/data/otoGar1/bed
~/kent/src/hg/utils/automation/doWindowMasker.pl otoGar1 -workhorse=kolossus > wmRun.log 2>&1 &
ssh hgwdev
cd /cluster/data/otoGar1/bed/WindowMasker.2006-12-18/
hgLoadBed otoGar1 windowmasker windowmasker.bed.gz

#########################################################################
# SIMPLE REPEATS (TRF) (DONE 2006-12-19 - Robert)
    ssh kolossus
    mkdir /cluster/data/otoGar1/bed/simpleRepeat
    cd /cluster/data/otoGar1/bed/simpleRepeat
    nice -n 19 time twoBitToFa ../../otoGar1.unmasked.2bit stdout \
	| trfBig -trf=/cluster/bin/i386/trf stdin /dev/null \
	    -bedAt=simpleRepeat.bed -tempDir=/tmp > trf.log 2>&1 &
    # Make a filtered version for sequence masking:
    awk '{if ($5 <= 12) print;}' simpleRepeat.bed > trfMask.bed
    splitFileByColumn trfMask.bed trfMaskChrom

    # Load unfiltered repeats into the database:
    ssh hgwdev
    hgLoadBed otoGar1 simpleRepeat \
      /cluster/data/otoGar1/bed/simpleRepeat/simpleRepeat.bed \
      -sqlTable=$HOME/kent/src/hg/lib/simpleRepeat.sql
    featureBits otoGar1 simpleRepeat

#########################################################################
# Mask seeds with orrb to do better alignments - Robert
download and compile orrb from www.drive5.com/orrb  and copy to
/cluster/bin/i386/orrb
mkdir /cluster/data/otoGar1/orrb
cd /cluster/data/otoGar1/orrb
twoBitToFa ../otoGar1/otoGar1.unmasked.2bit \
   /san/sanvol1/scratch/otoGar/otoGar1.fa
/cluster/bin/i386/orrb -mask /san/sanvol1/scratch/otoGar/otoGar1.fa \
                     -target /san/sanvol1/scratch/otoGar/otoGar1.fa\
                   -out otoGar1.maskOrrb.fa -wordsize 11 -threshalpha 13 \
                   -pattern 00011111000

#########################################################################
## Processing photograph (DONE - 2007-02-15 - Hiram)
    ssh hgwdev
    mkdir /cluster/data/otoGar1/photograph
    cd /cluster/data/otoGar1/photograph
    cp -p /usr/local/apache/htdocs/images/Bu* ./BushBaby.jpg
    convert -quality 80 -normalize -sharpen 0 -geometry 200x320 BushBaby.jpg \
	Otolemur_garnettii.jpg
    # add Otolemur_garnettii.jpg to the browser doc source tree and copy
    #	to /usr/local/apache/htdocs/images
    #	It is still a bit dark, a -gamma argument could lighten it

################################################
# DOWNLOADS (2007-06-05 kate)

    ssh kkstore05
    cd /cluster/data/otoGar1
    mkdir bigZips
    cd bigZips
    nice twoBitToFa ../otoGar1.2bit otoGar1.fa
    nice gzip otoGar1.fa 
    md5sum *.gz > md5sum.txt

    ssh hgwdev
    set d = /usr/local/apache/htdocs/goldenPath
    set bd = /cluster/data/otoGar1
    cp $d/sorAra1/bigZips/README.txt $bd/bigZips
    # EDIT
    mkdir -p $d/otoGar1/bigZips
    ln -s $bd/bigZips/{*.gz,md5sum.txt,README.txt} $d/otoGar1/bigZips
   
############################################################################
##  BLASTZ swap from mm9 alignments (2007-11-11 - markd)
    ssh hgwdev
    mkdir /cluster/data/otoGar1/bed/blastz.mm9.swap
    cd /cluster/data/otoGar1/bed/blastz.mm9.swap
    ln -s blastz.mm9.swap ../blastz.mm9
    /cluster/bin/scripts/doBlastzChainNet.pl \
        -swap /cluster/data/mm9/bed/blastz.otoGar1/DEF >& swap.out&

    # fb.otoGar1.chainMm9Link.txt:
    #   592429209 bases of 1969052059 (30.087%) in intersection

############################################################################
# TRANSMAP vertebrate.2008-05-20 build  (2008-05-24 markd)

vertebrate-wide transMap alignments were built  Tracks are created and loaded
by a single Makefile. This is available from:
   svn+ssh://hgwdev.soe.ucsc.edu/projects/compbio/usr/markd/svn/projs/transMap/tags/vertebrate.2008-05-20

see doc/builds.txt for specific details.
############################################################################
############################################################################
# TRANSMAP vertebrate.2008-06-07 build  (2008-06-30 markd)

vertebrate-wide transMap alignments were built  Tracks are created and loaded
by a single Makefile. This is available from:
   svn+ssh://hgwdev.soe.ucsc.edu/projects/compbio/usr/markd/svn/projs/transMap/tags/vertebrate.2008-06-30

see doc/builds.txt for specific details.

############################################################################
# add NCBI identifiers to the dbDb (DONE - 2008-10-21 - Hiram)
    hgsql -e 'update dbDb set
sourceName="Broad version 1 (NCBI project 16955, AAQR00000000)" where name="otoGar1";' hgcentraltest
###########################################################################
############################################################################
# TRANSMAP vertebrate.2009-07-01 build  (2009-07-21 markd)

vertebrate-wide transMap alignments were built  Tracks are created and loaded
by a single Makefile. This is available from:
   svn+ssh://hgwdev.soe.ucsc.edu/projects/compbio/usr/markd/svn/projs/transMap/tags/vertebrate.2009-07-01

see doc/builds.txt for specific details.
############################################################################
############################################################################
# TRANSMAP vertebrate.2009-09-13 build  (2009-09-20 markd)

vertebrate-wide transMap alignments were built  Tracks are created and loaded
by a single Makefile. This is available from:
   svn+ssh://hgwdev.soe.ucsc.edu/projects/compbio/usr/markd/svn/projs/transMap/tags/vertebrate.2009-09-13

see doc/builds.txt for specific details.
############################################################################
