view CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/gradesam.sh @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
line wrap: on
line source
#!/bin/bash

usage(){
echo "
Written by Brian Bushnell
Last modified May 23, 2014

Description:  Grades mapping correctness of a sam file of synthetic reads with headers generated by RandomReads3.java

Usage:   gradesam.sh in=<sam file> reads=<number of reads>

Parameters:
in=<file>       Specify the input sam file, or stdin.
reads=<int>     Number of reads in mapper's input (i.e., the fastq file).
thresh=20       Max deviation from correct location to be considered 'loosely correct'.
blasr=f         Set to 't' for BLASR output; fixes extra information added to read names.
ssaha2=f        Set to 't' for SSAHA2 or SMALT output; fixes incorrect soft-clipped read locations.
quality=3       Reads with a mapping quality of this or below will be considered ambiguously mapped.
bitset=t        Track read ID's to detect secondary alignments.
                Necessary for mappers that incorrectly output multiple primary alignments per read.

Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
"
}

#This block allows symlinked shellscripts to correctly set classpath.
pushd . > /dev/null
DIR="${BASH_SOURCE[0]}"
while [ -h "$DIR" ]; do
  cd "$(dirname "$DIR")"
  DIR="$(readlink "$(basename "$DIR")")"
done
cd "$(dirname "$DIR")"
DIR="$(pwd)/"
popd > /dev/null

#DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
CP="$DIR""current/"
set=0

if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
	usage
	exit
fi

function gradesam() {
	local CMD="java $EA $EOOM -Xmx200m -cp $CP align2.GradeSamFile $@"
#	echo $CMD >&2
	eval $CMD
}

gradesam "$@"