Debian Codegraph @

kmercountmulti.sh

raw symbols SCIP
1 #!/bin/bash
2
3 usage(){
4 echo "
5 Written by Brian Bushnell
6 Last modified February 20, 2020
7
8 Description: Estimates cardinality of unique kmers in sequence data.
9 Processes multiple kmer lengths simultaneously to produce a histogram.
10
11 Usage: kmercountmulti.sh in=<file> sweep=<20,100,8> out=<histogram output>
12
13 Parameters:
14 in=<file> (in1) Input file, or comma-delimited list of files.
15 in2=<file> Optional second file for paired reads.
16 out=<file> Histogram output. Default is stdout.
17 k= Comma-delimited list of kmer lengths to use.
18 sweep=min,max,incr Use incremented kmer values from min to max. For example,
19 sweep=20,26,2 is equivalent to k=20,22,24,26.
20 buckets=2048 Use this many buckets for counting; higher decreases
21 variance, for large datasets. Must be a power of 2.
22 seed=-1 Use this seed for hash functions.
23 A negative number forces a random seed.
24 minprob=0 Set to a value between 0 and 1 to exclude kmers with a
25 lower probability of being correct.
26 hashes=1 Use this many hash functions. More hashes yield greater
27 accuracy, but H hashes takes H times as long.
28 stdev=f Print standard deviations.
29
30 Shortcuts:
31 The # symbol will be substituted for 1 and 2.
32 For example:
33 kmercountmulti.sh in=read#.fq
34 ...is equivalent to:
35 kmercountmulti.sh in1=read1.fq in2=read2.fq
36
37 Java Parameters:
38 -Xmx This will set Java's memory usage, overriding autodetection.
39 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will specify 200 megs.
40 The max is typically 85% of physical memory.
41 -eoom This flag will cause the process to exit if an
42 out-of-memory exception occurs. Requires Java 8u92+.
43 -da Disable assertions.
44
45 Please contact Brian Bushnell at [email protected] if you encounter any problems.
46 "
47 }
48
49 #This block allows symlinked shellscripts to correctly set classpath.
50 pushd . > /dev/null
51 DIR="${BASH_SOURCE[0]}"
52 while [ -h "$DIR" ]; do
53 cd "$(dirname "$DIR")"
54 DIR="$(readlink "$(basename "$DIR")")"
55 done
56 cd "$(dirname "$DIR")"
57 DIR="$(pwd)/"
58 popd > /dev/null
59
60 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
61 CP="$DIR""current/"
62
63 z="-Xmx500m"
64 set=0
65
66 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
67 usage
68 exit
69 fi
70
71 calcXmx () {
72 source "$DIR""/calcmem.sh"
73 setEnvironment
74 parseXmx "$@"
75 }
76 calcXmx "$@"
77
78 function kmercountmulti() {
79 local CMD="java $EA $EOOM $z -cp $CP jgi.KmerCountMulti $@"
80 echo $CMD >&2
81 eval $CMD
82 }
83
84 kmercountmulti "$@"