| 1 | #!/bin/bash |
| 2 | |
| 3 | usage(){ |
| 4 | echo " |
| 5 | Written by Brian Bushnell |
| 6 | Last modified September 27, 2018 |
| 7 | |
| 8 | Description: Generates a prokaryotic gene model (.pkm) for gene calling. |
| 9 | Input is fasta and gff files. |
| 10 | The .pkm file may be used by CallGenes. |
| 11 | |
| 12 | Usage: analyzegenes.sh in=x.fa gff=x.gff out=x.pgm |
| 13 | |
| 14 | File parameters: |
| 15 | in=<file> A fasta file or comma-delimited list of fasta files. |
| 16 | gff=<file> A gff file or comma-delimited list. This is optional; |
| 17 | if present, it must match the number of fasta files. |
| 18 | If absent, a fasta file 'foo.fasta' will imply the |
| 19 | presence of 'foo.gff'. |
| 20 | out=<file> Output pgm file. |
| 21 | |
| 22 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 23 | " |
| 24 | } |
| 25 | |
| 26 | #This block allows symlinked shellscripts to correctly set classpath. |
| 27 | pushd . > /dev/null |
| 28 | DIR="${BASH_SOURCE[0]}" |
| 29 | while [ -h "$DIR" ]; do |
| 30 | cd "$(dirname "$DIR")" |
| 31 | DIR="$(readlink "$(basename "$DIR")")" |
| 32 | done |
| 33 | cd "$(dirname "$DIR")" |
| 34 | DIR="$(pwd)/" |
| 35 | popd > /dev/null |
| 36 | |
| 37 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 38 | CP="$DIR""current/" |
| 39 | |
| 40 | z="-Xmx2g" |
| 41 | z2="-Xms2g" |
| 42 | set=0 |
| 43 | |
| 44 | if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 45 | usage |
| 46 | exit |
| 47 | fi |
| 48 | |
| 49 | calcXmx () { |
| 50 | source "$DIR""/calcmem.sh" |
| 51 | setEnvironment |
| 52 | parseXmx "$@" |
| 53 | } |
| 54 | calcXmx "$@" |
| 55 | |
| 56 | function analyze() { |
| 57 | local CMD="java $EA $EOOM $z $z2 -cp $CP prok.AnalyzeGenes $@" |
| 58 | #echo $CMD >&2 |
| 59 | eval $CMD |
| 60 | } |
| 61 | |
| 62 | analyze "$@" |