jpayne@69: #!/bin/bash jpayne@69: jpayne@69: usage(){ jpayne@69: echo " jpayne@69: Written by Brian Bushnell jpayne@69: Last modified May 23, 2014 jpayne@69: jpayne@69: Description: Grades mapping correctness of a sam file of synthetic reads with headers generated by RandomReads3.java jpayne@69: jpayne@69: Usage: gradesam.sh in= reads= jpayne@69: jpayne@69: Parameters: jpayne@69: in= Specify the input sam file, or stdin. jpayne@69: reads= Number of reads in mapper's input (i.e., the fastq file). jpayne@69: thresh=20 Max deviation from correct location to be considered 'loosely correct'. jpayne@69: blasr=f Set to 't' for BLASR output; fixes extra information added to read names. jpayne@69: ssaha2=f Set to 't' for SSAHA2 or SMALT output; fixes incorrect soft-clipped read locations. jpayne@69: quality=3 Reads with a mapping quality of this or below will be considered ambiguously mapped. jpayne@69: bitset=t Track read ID's to detect secondary alignments. jpayne@69: Necessary for mappers that incorrectly output multiple primary alignments per read. jpayne@69: jpayne@69: Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems. 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: 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: function gradesam() { jpayne@69: local CMD="java $EA $EOOM -Xmx200m -cp $CP align2.GradeSamFile $@" jpayne@69: # echo $CMD >&2 jpayne@69: eval $CMD jpayne@69: } jpayne@69: jpayne@69: gradesam "$@"