#! /bin/bash 
# Last edited on 2013-10-14 17:16:22 by stolfilocal

seqA="$1"; shift;      # Tag (short name) of sequence A. 
sizeA="$1"; shift;     # Tot length of sequence A.
seqB="$1"; shift;      # Tag (short name) of sequence B. 
sizeB="$1"; shift;     # Tot length of sequence B.
tool="$1"; shift;      # Tool used to create the LAV file ("FASTA", "LASTZ", etc.)
minRungs="$1"; shift;  # Min number of rungs per candidate.
minGood="$1"; shift;   # Two-digit percentage 00 to 99 only.

# Assumes that the LAV file was created with LASTZ.

infile="lav/${seqA}_${seqB}_${tool}.lav"
outfile="cdv/${seqA}_${seqB}_${tool}_${minRungs}_${minGood}.cdv"

dm_lav_to_cdv \
  -seqA 101 ${seqA} ${sizeA} \
  -seqB 102 ${seqB} ${sizeB} \
  -minCandSize ${minRungs} \
  -minGoodFrac 0.${minGood} \
  -verbose \
  < ${infile} \
  > ${outfile}

