Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/countsharedlines.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 September 15, 2015 | |
7 | |
8 Description: Counts the number of lines shared between sets of files. | |
9 One output file will be printed for each input file. For example, | |
10 an output file for a file in the 'in1' set will contain one line per | |
11 file in the 'in2' set, indicating how many lines are shared. | |
12 | |
13 Usage: countsharedlines.sh in1=<file,file...> in2=<file,file...> | |
14 | |
15 Parameters: | |
16 include=f Set to 'true' to include the filtered names rather than excluding them. | |
17 prefix=f Allow matching of only the line's prefix (all characters up to first whitespace). | |
18 case=t (casesensitive) Match case also. | |
19 ow=t (overwrite) Overwrites files that already exist. | |
20 app=f (append) Append to files that already exist. | |
21 zl=4 (ziplevel) Set compression level, 1 (low) to 9 (max). | |
22 | |
23 Java Parameters: | |
24 -Xmx This will set Java's memory usage, overriding autodetection. | |
25 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will specify 200 megs. | |
26 The max is typically 85% of physical memory. | |
27 -eoom This flag will cause the process to exit if an out-of-memory | |
28 exception occurs. Requires Java 8u92+. | |
29 -da Disable assertions. | |
30 | |
31 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems. | |
32 " | |
33 } | |
34 | |
35 #This block allows symlinked shellscripts to correctly set classpath. | |
36 pushd . > /dev/null | |
37 DIR="${BASH_SOURCE[0]}" | |
38 while [ -h "$DIR" ]; do | |
39 cd "$(dirname "$DIR")" | |
40 DIR="$(readlink "$(basename "$DIR")")" | |
41 done | |
42 cd "$(dirname "$DIR")" | |
43 DIR="$(pwd)/" | |
44 popd > /dev/null | |
45 | |
46 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" | |
47 CP="$DIR""current/" | |
48 | |
49 z="-Xmx800m" | |
50 set=0 | |
51 | |
52 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then | |
53 usage | |
54 exit | |
55 fi | |
56 | |
57 calcXmx () { | |
58 source "$DIR""/calcmem.sh" | |
59 setEnvironment | |
60 parseXmx "$@" | |
61 if [[ $set == 1 ]]; then | |
62 return | |
63 fi | |
64 freeRam 800m 84 | |
65 z="-Xmx${RAM}m" | |
66 z2="-Xms${RAM}m" | |
67 } | |
68 calcXmx "$@" | |
69 | |
70 function countsharedlines() { | |
71 local CMD="java $EA $EOOM $z -cp $CP driver.CountSharedLines $@" | |
72 echo $CMD >&2 | |
73 eval $CMD | |
74 } | |
75 | |
76 countsharedlines "$@" |