jpayne@69
|
1 #!/bin/bash
|
jpayne@69
|
2
|
jpayne@69
|
3 usage(){
|
jpayne@69
|
4 echo "
|
jpayne@69
|
5 Written by Brian Bushnell
|
jpayne@69
|
6 Last modified December 22, 2021
|
jpayne@69
|
7 This script requires at least 17GB RAM.
|
jpayne@69
|
8 It is designed for NERSC and uses hard-coded paths.
|
jpayne@69
|
9
|
jpayne@69
|
10 Description: Removes all reads that map to the human genome with at least 88% identity after quality trimming.
|
jpayne@69
|
11 This is more aggressive than removehuman.sh and uses an unmasked human genome reference.
|
jpayne@69
|
12 It removes roughly 99.99% of human 2x150bp reads, but may incur false-positive removals.
|
jpayne@69
|
13 NOTE! This program uses hard-coded paths and will only run on Nersc systems unless you change the path.
|
jpayne@69
|
14
|
jpayne@69
|
15 Usage: removehuman.sh in=<input file> outu=<clean output file>
|
jpayne@69
|
16
|
jpayne@69
|
17 Input may be fasta or fastq, compressed or uncompressed.
|
jpayne@69
|
18
|
jpayne@69
|
19 Parameters:
|
jpayne@69
|
20 threads=auto (t) Set number of threads to use; default is number of logical processors.
|
jpayne@69
|
21 overwrite=t (ow) Set to false to force the program to abort rather than overwrite an existing file.
|
jpayne@69
|
22 interleaved=auto (int) If true, forces fastq input to be paired and interleaved.
|
jpayne@69
|
23 trim=t Trim read ends to remove bases with quality below minq.
|
jpayne@69
|
24 Values: t (trim both ends), f (neither end), r (right end only), l (left end only).
|
jpayne@69
|
25 untrim=t Undo the trimming after mapping.
|
jpayne@69
|
26 minq=4 Trim quality threshold.
|
jpayne@69
|
27 ziplevel=2 (zl) Set to 1 (lowest) through 9 (max) to change compression level; lower compression is faster.
|
jpayne@69
|
28 outm=<file> File to output the reads that mapped to human.
|
jpayne@69
|
29 path= Set the path to an indexed human genome.
|
jpayne@69
|
30
|
jpayne@69
|
31 ***** All BBMap parameters can be used; run bbmap.sh for more details. *****
|
jpayne@69
|
32
|
jpayne@69
|
33 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
|
jpayne@69
|
34 "
|
jpayne@69
|
35 }
|
jpayne@69
|
36
|
jpayne@69
|
37 #This block allows symlinked shellscripts to correctly set classpath.
|
jpayne@69
|
38 pushd . > /dev/null
|
jpayne@69
|
39 DIR="${BASH_SOURCE[0]}"
|
jpayne@69
|
40 while [ -h "$DIR" ]; do
|
jpayne@69
|
41 cd "$(dirname "$DIR")"
|
jpayne@69
|
42 DIR="$(readlink "$(basename "$DIR")")"
|
jpayne@69
|
43 done
|
jpayne@69
|
44 cd "$(dirname "$DIR")"
|
jpayne@69
|
45 DIR="$(pwd)/"
|
jpayne@69
|
46 popd > /dev/null
|
jpayne@69
|
47
|
jpayne@69
|
48 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
|
jpayne@69
|
49 CP="$DIR""current/"
|
jpayne@69
|
50 JNI="-Djava.library.path=""$DIR""jni/"
|
jpayne@69
|
51 JNI=""
|
jpayne@69
|
52
|
jpayne@69
|
53 z="-Xmx16000m"
|
jpayne@69
|
54 z2="-Xms16000m"
|
jpayne@69
|
55 set=0
|
jpayne@69
|
56
|
jpayne@69
|
57 calcXmx () {
|
jpayne@69
|
58 source "$DIR""/calcmem.sh"
|
jpayne@69
|
59 setEnvironment
|
jpayne@69
|
60 parseXmx "$@"
|
jpayne@69
|
61 }
|
jpayne@69
|
62 calcXmx "$@"
|
jpayne@69
|
63
|
jpayne@69
|
64 function removehuman() {
|
jpayne@69
|
65 local CMD="java $EA $EOOM $z $z2 $JNI -cp $CP align2.BBMap minratio=0.75 maxindel=8 bwr=0.22 bw=26 minhits=1 path=/global/cfs/cdirs/bbtools/hg19 build=2 pigz unpigz zl=6 qtrim=r trimq=10 untrim idtag usemodulo printunmappedcount ztd=2 maxsites=1 k=14 tipsearch=0 kfilter=25 bloomfilter $@"
|
jpayne@69
|
66 echo $CMD >&2
|
jpayne@69
|
67 eval $CMD
|
jpayne@69
|
68 }
|
jpayne@69
|
69
|
jpayne@69
|
70 removehuman "$@"
|