#############################################################################
# LASTZ rat/rn7 vs. cow bosTau9 (WORKING - 2021-04-28 - Hiram)

    mkdir /hive/data/genomes/rn7/bed/lastzBosTau9.2021-04-28
    cd /hive/data/genomes/rn7/bed/lastzBosTau9.2021-04-28

    printf '# Rat vs. cow bosTau9
BLASTZ=/cluster/bin/penn/lastz-distrib-1.04.03/bin/lastz
BLASTZ_M=254
BLASTZ_Y=3400
BLASTZ_L=6000
BLASTZ_K=2200
BLASTZ_Q=/hive/data/staging/data/blastz/HoxD55.q

# TARGET: Rat Rn7
SEQ1_DIR=/hive/data/genomes/rn7/rn7.2bit
SEQ1_LEN=/hive/data/genomes/rn7/chrom.sizes
SEQ1_CHUNK=20000000
SEQ1_LAP=10000
SEQ1_LIMIT=5

# QUERY: cow bosTau9
SEQ2_DIR=/hive/data/genomes/bosTau9/bosTau9.2bit
SEQ2_LEN=/hive/data/genomes/bosTau9/chrom.sizes
SEQ2_CHUNK=20000000
SEQ2_LAP=0
SEQ2_LIMIT=20

BASE=/hive/data/genomes/rn7/bed/lastzBosTau9.2021-04-28
TMPDIR=/dev/shm
' > DEF

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

    sed -e 's/^/    # /;' fb.rn7.chainBosTau9Link.txt
    # 872723875 bases of 2626580772 (33.227%) in intersection
    sed -e 's/^/    # /;' fb.rn7.chainSynBosTau9Link.txt
    # 775681551 bases of 2626580772 (29.532%) in intersection

    time (doRecipBest.pl -load -workhorse=hgwdev -buildDir=`pwd` \
	rn7 bosTau9) > rbest.log 2>&1 &
    # real    648m32.765s

    sed -e 's/^/    # /;' fb.rn7.chainRBest.BosTau9.txt
    # 796235597 bases of 2626580772 (30.315%) in intersection

    # and for the swap:
    mkdir /hive/data/genomes/bosTau9/bed/blastz.rn7.swap
    cd /hive/data/genomes/bosTau9/bed/blastz.rn7.swap

    time (doBlastzChainNet.pl -verbose=2 \
      /hive/data/genomes/rn7/bed/lastzBosTau9.2021-04-28/DEF \
        -swap -chainMinScore=3000 -chainLinearGap=medium \
          -workhorse=hgwdev -smallClusterHub=ku -bigClusterHub=ku \
            -syntenicNet) > swap.log 2>&1
    #  real    93m58.566s

    sed -e 's/^/    # /;' fb.bosTau9.chainRn7Link.txt
    # 857332479 bases of 2715853792 (31.568%) in intersection

    sed -e 's/^/    # /;' fb.bosTau9.chainSynRn7Link.txt
    # 779374329 bases of 2715853792 (28.697%) in intersection

    time (doRecipBest.pl -load -workhorse=hgwdev -buildDir=`pwd` \
	bosTau9 rn7) > rbest.log 2>&1 &
    # real    533m51.949s

    cat fb.bosTau9.chainRBest.Rn7.txt
    # 794580345 bases of 2715853792 (29.257%) in intersection

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