Debian Codegraph @

removehuman.sh

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