Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/makepolymers.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 3, 2017 | |
7 | |
8 Description: Creates polymer sequences. | |
9 Can be used in conjunction with mutate.sh to generate low-complexity sequence. | |
10 | |
11 Usage: makepolymers.sh out=<output file> k=<repeat length> minlen=<sequence length> | |
12 | |
13 I/O parameters: | |
14 out=<file> Output genome. | |
15 overwrite=f (ow) Set to false to force the program to abort rather than | |
16 overwrite an existing file. | |
17 | |
18 Processing parameters: | |
19 k=1 Length of repeating polymeric units. | |
20 To generate a sweep of multiple values of k, | |
21 specify both mink and maxk. | |
22 minlen=31 Ensure sequences are at least this long. | |
23 Specifically, minlen=X will ensure sequences are long enough | |
24 that all possible kmers of length X are present. | |
25 | |
26 Java Parameters: | |
27 -Xmx This will set Java's memory usage, overriding autodetection. | |
28 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will | |
29 specify 200 megs. The max is typically 85% of physical memory. | |
30 -eoom This flag will cause the process to exit if an out-of-memory | |
31 exception occurs. Requires Java 8u92+. | |
32 -da Disable assertions. | |
33 | |
34 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems. | |
35 " | |
36 } | |
37 | |
38 #This block allows symlinked shellscripts to correctly set classpath. | |
39 pushd . > /dev/null | |
40 DIR="${BASH_SOURCE[0]}" | |
41 while [ -h "$DIR" ]; do | |
42 cd "$(dirname "$DIR")" | |
43 DIR="$(readlink "$(basename "$DIR")")" | |
44 done | |
45 cd "$(dirname "$DIR")" | |
46 DIR="$(pwd)/" | |
47 popd > /dev/null | |
48 | |
49 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" | |
50 CP="$DIR""current/" | |
51 | |
52 z="-Xmx4g" | |
53 z2="-Xms4g" | |
54 set=0 | |
55 | |
56 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then | |
57 usage | |
58 exit | |
59 fi | |
60 | |
61 calcXmx () { | |
62 source "$DIR""/calcmem.sh" | |
63 setEnvironment | |
64 parseXmx "$@" | |
65 if [[ $set == 1 ]]; then | |
66 return | |
67 fi | |
68 freeRam 4000m 84 | |
69 z="-Xmx${RAM}m" | |
70 z2="-Xms${RAM}m" | |
71 } | |
72 calcXmx "$@" | |
73 | |
74 makepolymers() { | |
75 local CMD="java $EA $EOOM $z $z2 -cp $CP jgi.MakePolymers $@" | |
76 echo $CMD >&2 | |
77 eval $CMD | |
78 } | |
79 | |
80 makepolymers "$@" |