Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/removehuman.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 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 bbushnell@lbl.gov if you encounter any problems. | |
33 " | |
34 } | |
35 | |
36 #This block allows symlinked shellscripts to correctly set classpath. | |
37 pushd . > /dev/null | |
38 DIR="${BASH_SOURCE[0]}" | |
39 while [ -h "$DIR" ]; do | |
40 cd "$(dirname "$DIR")" | |
41 DIR="$(readlink "$(basename "$DIR")")" | |
42 done | |
43 cd "$(dirname "$DIR")" | |
44 DIR="$(pwd)/" | |
45 popd > /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 [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then | |
57 usage | |
58 exit | |
59 fi | |
60 | |
61 calcXmx () { | |
62 source "$DIR""/calcmem.sh" | |
63 setEnvironment | |
64 parseXmx "$@" | |
65 } | |
66 calcXmx "$@" | |
67 | |
68 function 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 echo $CMD >&2 | |
71 eval $CMD | |
72 } | |
73 | |
74 removehuman "$@" |