Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/renameimg.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 August 23, 2017 | |
7 | |
8 Description: Renames img records to be prefixed by their id. | |
9 This is for internal JGI use and has no external utility. | |
10 | |
11 Usage: renameimg.sh in=auto out=renamed.fa.gz | |
12 | |
13 Parameters: | |
14 in= 3-column tsv with imgID, taxID, and file path. | |
15 These files will have their sequences renamed and concatenated. | |
16 img= Optional, if a different (presumably bigger) file will be used for taxonomic assignment. | |
17 For example, in could be a subset of img, potentially with incorrect taxIDs. | |
18 | |
19 Java Parameters: | |
20 -Xmx This will set Java's memory usage, overriding autodetection. | |
21 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will specify 200 megs. | |
22 The max is typically 85% of physical memory. | |
23 -eoom This flag will cause the process to exit if an out-of-memory exception occurs. Requires Java 8u92+. | |
24 -da Disable assertions. | |
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="-Xmx1g" | |
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 function rename() { | |
60 local CMD="java $EA $EOOM $z -cp $CP tax.RenameIMG $@" | |
61 echo $CMD >&2 | |
62 eval $CMD | |
63 } | |
64 | |
65 rename "$@" |