#########################################################################
# LASTZ gorilla/gorGor4 human/hg38 - (DONE - 2016-1-04 - Jonathan)
    mkdir /hive/data/genomes/hg38/bed/lastzGorGor4.2016-01-04
    cd /hive/data/genomes/hg38/bed/lastzGorGor4.2016-01-04

    cat << '_EOF_' > DEF
# human vs gorilla
BLASTZ=/cluster/bin/penn/lastz-distrib-1.03.66/bin/lastz
BLASTZ_T=2
BLASTZ_O=600
BLASTZ_E=150
BLASTZ_M=254
BLASTZ_K=4500
BLASTZ_Y=15000
BLASTZ_Q=/scratch/data/blastz/human_chimp.v2.q
#       A     C     G     T
# A    90  -330  -236  -356
# C  -330   100  -318  -236
# G  -236  -318   100  -330
# T  -356  -236  -330    90

# TARGET: human hg38
SEQ1_DIR=/hive/data/genomes/hg38/hg38.2bit
SEQ1_LEN=/hive/data/genomes/hg38/chrom.sizes
SEQ1_CHUNK=20000000
SEQ1_LAP=10000
SEQ1_IN_CONTIGS=0

# QUERY: gorilla gorGor4
SEQ2_DIR=/hive/data/genomes/gorGor4/gorGor4.2bit
SEQ2_LEN=/hive/data/genomes/gorGor4/chrom.sizes
SEQ2_CHUNK=20000000
SEQ2_LAP=0
SEQ2_LIMIT=500
SEQ_IN_CONTIGS=0

BASE=/hive/data/genomes/hg38/bed/lastzGorGor4.2016-01-04
TMPDIR=/dev/shm
'_EOF_'
    # << happy emacs

    time (doBlastzChainNet.pl `pwd`/DEF -verbose=2 \
        -chainMinScore=3000 -chainLinearGap=medium \
          -workhorse=hgwdev -smallClusterHub=ku -bigClusterHub=ku \
            -syntenicNet) > do.log 2>&1
    # real    233m13.670s

    cat fb.hg38.chainGorGor4Link.txt 
    # 2831582533 bases of 3049335806 (92.859%) in intersection

    time (doRecipBest.pl -buildDir=`pwd` hg38 gorGor4) > rbest.log 2>&1 &
    # real    41m52.877s

    # and for the swap:
    mkdir /hive/data/genomes/gorGor4/bed/blastz.hg38.swap
    cd /hive/data/genomes/gorGor4/bed/blastz.hg38.swap

    time (doBlastzChainNet.pl -verbose=2 \
      /hive/data/genomes/hg38/bed/lastzGorGor4.2016-01-04/DEF \
        -swap -chainMinScore=3000 -chainLinearGap=medium \
          -workhorse=hgwdev -smallClusterHub=ku -bigClusterHub=ku \
            -syntenicNet) > swap.log 2>&1
    #  real    105m40.710s

    cat fb.gorGor4.chainHg38Link.txt 
    # 2731892128 bases of 2917333143 (93.643%) in intersection

    time (doRecipBest.pl -buildDir=`pwd` gorGor4 hg38) > rbest.log 2>&1
    # real    44m25.268s

#########################################################################
