jpayne@69: #!/bin/bash jpayne@69: jpayne@69: usage(){ jpayne@69: echo " jpayne@69: Written by Brian Bushnell jpayne@69: Last modified October 17, 2019 jpayne@69: jpayne@69: Description: Generates a random, (probably) repeat-free genome. jpayne@69: jpayne@69: Usage: randomgenome.sh len= chroms= gc= out= jpayne@69: jpayne@69: Parameters: jpayne@69: out= Output. jpayne@69: overwrite=f (ow) Set to false to force the program to abort rather than jpayne@69: overwrite an existing file. jpayne@69: len=100000 Total genome size. jpayne@69: chroms=1 Number of pieces. jpayne@69: gc=0.5 GC fraction. jpayne@69: nopoly=f Ban homopolymers. jpayne@69: pad=0 Add this many Ns to contig ends; does not count toward jpayne@69: genome size. jpayne@69: seed=-1 Set to a positive number for deterministic output. jpayne@69: amino=f Produce random amino acids instead of nucleotides. jpayne@69: includestop=f Include stop codons in random amino sequences. jpayne@69: jpayne@69: Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems. jpayne@69: " jpayne@69: } jpayne@69: jpayne@69: #This block allows symlinked shellscripts to correctly set classpath. jpayne@69: pushd . > /dev/null jpayne@69: DIR="${BASH_SOURCE[0]}" jpayne@69: while [ -h "$DIR" ]; do jpayne@69: cd "$(dirname "$DIR")" jpayne@69: DIR="$(readlink "$(basename "$DIR")")" jpayne@69: done jpayne@69: cd "$(dirname "$DIR")" jpayne@69: DIR="$(pwd)/" jpayne@69: popd > /dev/null jpayne@69: jpayne@69: #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" jpayne@69: CP="$DIR""current/" jpayne@69: jpayne@69: z="-Xmx200m" jpayne@69: set=0 jpayne@69: jpayne@69: if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then jpayne@69: usage jpayne@69: exit jpayne@69: fi jpayne@69: jpayne@69: calcXmx () { jpayne@69: source "$DIR""/calcmem.sh" jpayne@69: setEnvironment jpayne@69: parseXmx "$@" jpayne@69: } jpayne@69: calcXmx "$@" jpayne@69: jpayne@69: randomgenome() { jpayne@69: local CMD="java $EA $EOOM $z -cp $CP jgi.RandomGenome $@" jpayne@69: echo $CMD >&2 jpayne@69: eval $CMD jpayne@69: } jpayne@69: jpayne@69: randomgenome "$@"