| 1 | #!/bin/bash |
| 2 | |
| 3 | usage(){ |
| 4 | echo " |
| 5 | Written by Brian Bushnell |
| 6 | Last modified December 5, 2024 |
| 7 | |
| 8 | Description: Finds orfs and calls genes in unspliced prokaryotes. |
| 9 | This includes bacteria, archaea, viruses, and mitochondria. |
| 10 | Can also predict 16S, 23S, 5S, and tRNAs. |
| 11 | |
| 12 | Usage: callgenes.sh in=contigs.fa out=calls.gff outa=aminos.faa out16S=16S.fa |
| 13 | |
| 14 | File parameters: |
| 15 | in=<file> A fasta file; the only required parameter. |
| 16 | out=<file> Output gff file. |
| 17 | outa=<file> Amino acid output. |
| 18 | out16s=<file> 16S output. |
| 19 | model=<file> A pgm file or comma-delimited list. |
| 20 | If unspecified a default model will be used. |
| 21 | stats=stderr Stats output (may be stderr, stdin, a file, or null). |
| 22 | hist=null Gene length histogram. |
| 23 | compareto= Optional reference gff file to compare with the gene calls. |
| 24 | 'auto' will name it based on the input file name. |
| 25 | |
| 26 | Formatting parameters: |
| 27 | json=false Print stats in JSON. |
| 28 | binlen=21 Histogram bin length. |
| 29 | bins=1000 Maximum histogram bins. |
| 30 | pz=f (printzero) Print histogram lines with zero count. |
| 31 | |
| 32 | |
| 33 | |
| 34 | Other parameters: |
| 35 | minlen=60 Don't call genes shorter than this. |
| 36 | trd=f (trimreaddescription) Set to true to trim read headers after |
| 37 | the first whitespace. Necessary for IGV. |
| 38 | merge=f For paired reads, merge before calling. |
| 39 | detranslate=f Output canonical nucleotide sequences instead of amino acids. |
| 40 | recode=f Re-encode nucleotide sequences over called genes, leaving |
| 41 | non-coding regions unchanged. |
| 42 | |
| 43 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 44 | " |
| 45 | } |
| 46 | |
| 47 | #This block allows symlinked shellscripts to correctly set classpath. |
| 48 | pushd . > /dev/null |
| 49 | DIR="${BASH_SOURCE[0]}" |
| 50 | while [ -h "$DIR" ]; do |
| 51 | cd "$(dirname "$DIR")" |
| 52 | DIR="$(readlink "$(basename "$DIR")")" |
| 53 | done |
| 54 | cd "$(dirname "$DIR")" |
| 55 | DIR="$(pwd)/" |
| 56 | popd > /dev/null |
| 57 | |
| 58 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 59 | CP="$DIR""current/" |
| 60 | |
| 61 | z="-Xmx6g" |
| 62 | z2="-Xms6g" |
| 63 | set=0 |
| 64 | |
| 65 | if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 66 | usage |
| 67 | exit |
| 68 | fi |
| 69 | |
| 70 | calcXmx () { |
| 71 | source "$DIR""/calcmem.sh" |
| 72 | setEnvironment |
| 73 | parseXmx "$@" |
| 74 | } |
| 75 | calcXmx "$@" |
| 76 | |
| 77 | function callgenes() { |
| 78 | local CMD="java $EA $EOOM $z $z2 -cp $CP prok.CallGenes $@" |
| 79 | #Too long to echo sometimes since wildcards can be expanded |
| 80 | #echo $CMD >&2 |
| 81 | eval $CMD |
| 82 | } |
| 83 | |
| 84 | callgenes "$@" |