Debian Codegraph @

filterbarcodes.sh

raw symbols SCIP
1 #!/bin/bash
2
3 usage(){
4 echo "
5 Written by Brian Bushnell
6 Last modified February 17, 2015
7
8 Description: Filters barcodes by quality, and generates quality histograms.
9
10 Usage: filterbarcodes.sh in=<file> out=<file> maq=<integer>
11
12 Input parameters:
13 in=<file> Reads that have already been muxed with barcode qualities using mergebarcodes.sh.
14 int=auto (interleaved) If true, forces fastq input to be paired and interleaved.
15 qin=auto ASCII offset for input quality. May be 33 (Sanger), 64 (Illumina), or auto.
16
17 Output parameters:
18 out=<file> Write filtered reads here. 'out=stdout.fq' will pipe to standard out.
19 cor=<file> Correlation between read and index qualities.
20 bqhist=<file> Barcode quality histogram by position.
21 baqhist=<file> Barcode average quality histogram.
22 bmqhist=<file> Barcode min quality histogram.
23 overwrite=t (ow) Set to false to force the program to abort rather than overwrite an existing file.
24 ziplevel=2 (zl) Set to 1 (lowest) through 9 (max) to change compression level; lower compression is faster.
25 fastawrap=80 Length of lines in fasta output.
26 qout=auto ASCII offset for output quality. May be 33 (Sanger), 64 (Illumina), or auto (same as input).
27 maq=0 Filter reads with barcode average quality less than this.
28 mmq=0 Filter reads with barcode minimum quality less than this.
29
30 Other parameters:
31 pigz=t Use pigz to compress. If argument is a number, that will set the number of pigz threads.
32 unpigz=t Use pigz to decompress.
33
34 Java Parameters:
35 -Xmx This will set Java's memory usage, overriding autodetection.
36 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will specify 200 megs.
37 The max is typically 85% of physical memory.
38 -eoom This flag will cause the process to exit if an
39 out-of-memory exception occurs. Requires Java 8u92+.
40 -da Disable assertions.
41
42 Please contact Brian Bushnell at [email protected] if you encounter any problems.
43 "
44 }
45
46 #This block allows symlinked shellscripts to correctly set classpath.
47 pushd . > /dev/null
48 DIR="${BASH_SOURCE[0]}"
49 while [ -h "$DIR" ]; do
50 cd "$(dirname "$DIR")"
51 DIR="$(readlink "$(basename "$DIR")")"
52 done
53 cd "$(dirname "$DIR")"
54 DIR="$(pwd)/"
55 popd > /dev/null
56
57 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
58 CP="$DIR""current/"
59
60 z="-Xmx200m"
61 set=0
62
63 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
64 usage
65 exit
66 fi
67
68 calcXmx () {
69 source "$DIR""/calcmem.sh"
70 setEnvironment
71 parseXmx "$@"
72 }
73 calcXmx "$@"
74
75 filterbarcodes() {
76 local CMD="java $EA $EOOM $z -cp $CP jgi.CorrelateBarcodes $@"
77 echo $CMD >&2
78 eval $CMD
79 }
80
81 filterbarcodes "$@"