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

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 69:33d812a61356
1 #!/bin/bash
2
3 usage(){
4 echo "
5 Written by Brian Bushnell
6 Last modified October 17, 2019
7
8 Description: Generates a random, (probably) repeat-free genome.
9
10 Usage: randomgenome.sh len=<total size> chroms=<int> gc=<float> out=<file>
11
12 Parameters:
13 out=<file> Output.
14 overwrite=f (ow) Set to false to force the program to abort rather than
15 overwrite an existing file.
16 len=100000 Total genome size.
17 chroms=1 Number of pieces.
18 gc=0.5 GC fraction.
19 nopoly=f Ban homopolymers.
20 pad=0 Add this many Ns to contig ends; does not count toward
21 genome size.
22 seed=-1 Set to a positive number for deterministic output.
23 amino=f Produce random amino acids instead of nucleotides.
24 includestop=f Include stop codons in random amino sequences.
25
26 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
27 "
28 }
29
30 #This block allows symlinked shellscripts to correctly set classpath.
31 pushd . > /dev/null
32 DIR="${BASH_SOURCE[0]}"
33 while [ -h "$DIR" ]; do
34 cd "$(dirname "$DIR")"
35 DIR="$(readlink "$(basename "$DIR")")"
36 done
37 cd "$(dirname "$DIR")"
38 DIR="$(pwd)/"
39 popd > /dev/null
40
41 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
42 CP="$DIR""current/"
43
44 z="-Xmx200m"
45 set=0
46
47 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
48 usage
49 exit
50 fi
51
52 calcXmx () {
53 source "$DIR""/calcmem.sh"
54 setEnvironment
55 parseXmx "$@"
56 }
57 calcXmx "$@"
58
59 randomgenome() {
60 local CMD="java $EA $EOOM $z -cp $CP jgi.RandomGenome $@"
61 echo $CMD >&2
62 eval $CMD
63 }
64
65 randomgenome "$@"