comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/comparevcf.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 April 30, 2019
7
8 Description: Performs set operations on VCF files:
9 Union, intersection, and subtraction.
10
11 Usage: comparevcf.sh in=<file,file,...> out=<file>
12
13 I/O parameters:
14 in=<file> Input; must be at least 2 files.
15 out=<file> Output file.
16 ref=<file> Reference file; optional. Usually not needed.
17 shist=<file> (scorehist) Output for variant score histogram.
18 overwrite=f (ow) Set to false to force the program to abort rather than
19 bgzip=f Use bgzip for gzip compression.
20
21 Processing Mode (choose one only):
22 subtract=t Subtract all other files from the first file.
23 union=f Make a union of all files.
24 intersection=f Make an intersection of all files.
25
26 Processing Parameters:
27 addsamples=t Include all samples in the output lines. (TODO)
28 splitalleles=f Split multi-allelic lines into multiple lines.
29 splitsubs=f Split multi-base substitutions into SNPs.
30 canonize=t Trim variations down to a canonical representation.
31
32 Java Parameters:
33 -Xmx This will set Java's memory usage, overriding autodetection.
34 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will
35 specify 200 megs. The max is typically 85% of physical memory.
36 -eoom This flag will cause the process to exit if an out-of-memory
37 exception occurs. Requires Java 8u92+.
38 -da Disable assertions.
39
40 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
41 "
42 }
43
44 #This block allows symlinked shellscripts to correctly set classpath.
45 pushd . > /dev/null
46 DIR="${BASH_SOURCE[0]}"
47 while [ -h "$DIR" ]; do
48 cd "$(dirname "$DIR")"
49 DIR="$(readlink "$(basename "$DIR")")"
50 done
51 cd "$(dirname "$DIR")"
52 DIR="$(pwd)/"
53 popd > /dev/null
54
55 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
56 CP="$DIR""current/"
57
58 z="-Xmx4g"
59 z2="-Xms4g"
60 set=0
61
62 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
63 usage
64 exit
65 fi
66
67 calcXmx () {
68 source "$DIR""/calcmem.sh"
69 setEnvironment
70 parseXmx "$@"
71 if [[ $set == 1 ]]; then
72 return
73 fi
74 freeRam 4000m 84
75 z="-Xmx${RAM}m"
76 z2="-Xms${RAM}m"
77 }
78 calcXmx "$@"
79
80 comparevcf() {
81 local CMD="java $EA $EOOM $z $z2 -cp $CP var2.CompareVCF $@"
82 echo $CMD >&2
83 eval $CMD
84 }
85
86 comparevcf "$@"