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

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