jpayne@69: #!/bin/bash jpayne@69: jpayne@69: usage(){ jpayne@69: echo " jpayne@69: Written by Brian Bushnell jpayne@69: Last modified September 18, 2019 jpayne@69: jpayne@69: Description: Runs TadpoleWrapper after some preprocessing, jpayne@69: to allow optimal assemblies using long kmers. jpayne@69: Only paired reads are supported. jpayne@69: jpayne@69: Usage: jpayne@69: tadpipe.sh in=reads.fq out=contigs.fa jpayne@69: jpayne@69: jpayne@69: Parameters: jpayne@69: in= Input reads. jpayne@69: in2= Optional read 2, if reads are in two files. jpayne@69: out=contigs.fa Output file name. jpayne@69: temp=$TMPDIR Path to a directory for temp files. jpayne@69: delete=t Delete intermediate files. jpayne@69: gz=f Gzip intermediate files. jpayne@69: jpayne@69: Other parameters can be passed to individual phases like this: jpayne@69: jpayne@69: assemble_k=200,250 Set kmer lengths for assembly phase. jpayne@69: merge_strict Set the strict flag in merge phase. jpayne@69: extend_el=120 Set the left-extension distance in the extension phase. jpayne@69: jpayne@69: Valid prefixes: jpayne@69: jpayne@69: filter_ PhiX and contaminant filtering. jpayne@69: trim_ Adapter trimmming. jpayne@69: merge_ Paired-read merging. jpayne@69: correct_ Error correction. jpayne@69: extend_ Read extension. jpayne@69: assemble_ Final assembly. jpayne@69: " jpayne@69: } jpayne@69: jpayne@69: #This block allows symlinked shellscripts to correctly set classpath. jpayne@69: pushd . > /dev/null jpayne@69: DIR="${BASH_SOURCE[0]}" jpayne@69: while [ -h "$DIR" ]; do jpayne@69: cd "$(dirname "$DIR")" jpayne@69: DIR="$(readlink "$(basename "$DIR")")" jpayne@69: done jpayne@69: cd "$(dirname "$DIR")" jpayne@69: DIR="$(pwd)/" jpayne@69: popd > /dev/null jpayne@69: jpayne@69: #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" jpayne@69: CP="$DIR""current/" jpayne@69: jpayne@69: z="-Xmx14g" jpayne@69: z2="-Xms14g" jpayne@69: set=0 jpayne@69: jpayne@69: if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then jpayne@69: usage jpayne@69: exit jpayne@69: fi jpayne@69: jpayne@69: calcXmx () { jpayne@69: source "$DIR""/calcmem.sh" jpayne@69: setEnvironment jpayne@69: parseXmx "$@" jpayne@69: if [[ $set == 1 ]]; then jpayne@69: return jpayne@69: fi jpayne@69: freeRam 15000m 84 jpayne@69: z="-Xmx${RAM}m" jpayne@69: z2="-Xms${RAM}m" jpayne@69: } jpayne@69: calcXmx "$@" jpayne@69: jpayne@69: tadpipe() { jpayne@69: local CMD="java $EA $EOOM $z $z2 -cp $CP assemble.TadPipe $@" jpayne@69: echo $CMD >&2 jpayne@69: eval $CMD jpayne@69: } jpayne@69: jpayne@69: tadpipe "$@"