| 1 | #!/bin/bash |
| 2 | |
| 3 | usage(){ |
| 4 | echo " |
| 5 | Written by Brian Bushnell |
| 6 | Last modified March 11, 2024 |
| 7 | |
| 8 | Description: Plots Illumina read positions and barcode hamming distance. |
| 9 | |
| 10 | Usage: plotreadposition.sh in=<file.fq> out=<file.tsv> expected=<barcodes.txt> |
| 11 | |
| 12 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 13 | " |
| 14 | } |
| 15 | |
| 16 | #This block allows symlinked shellscripts to correctly set classpath. |
| 17 | pushd . > /dev/null |
| 18 | DIR="${BASH_SOURCE[0]}" |
| 19 | while [ -h "$DIR" ]; do |
| 20 | cd "$(dirname "$DIR")" |
| 21 | DIR="$(readlink "$(basename "$DIR")")" |
| 22 | done |
| 23 | cd "$(dirname "$DIR")" |
| 24 | DIR="$(pwd)/" |
| 25 | popd > /dev/null |
| 26 | |
| 27 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 28 | CP="$DIR""current/" |
| 29 | |
| 30 | z="-Xmx300m" |
| 31 | z2="-Xms300m" |
| 32 | set=0 |
| 33 | |
| 34 | if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 35 | usage |
| 36 | exit |
| 37 | fi |
| 38 | |
| 39 | calcXmx () { |
| 40 | source "$DIR""/calcmem.sh" |
| 41 | setEnvironment |
| 42 | parseXmx "$@" |
| 43 | } |
| 44 | calcXmx "$@" |
| 45 | |
| 46 | function plot() { |
| 47 | local CMD="java $EA $EOOM $z $z2 -cp $CP hiseq.PlotReadPosition $@" |
| 48 | echo $CMD >&2 |
| 49 | eval $CMD |
| 50 | } |
| 51 | |
| 52 | plot "$@" |