comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/processhi-c.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 March 28, 2018
7
8 Description: Finds and trims junctions in mapped Hi-C reads.
9 For the purpose of reporting junction motifs, this requires paired-end reads,
10 because only improper pairs will be considered as possibly containing
11 junctions. However, all reads that map with soft-clipping will be trimmed
12 on the 3' (right) end, regardless of pairing status.
13
14 Usage: processhi-c.sh in=<mapped reads> out=<trimmed reads>
15
16 Parameters:
17 in=<file> A sam/bam file containing mapped reads.
18 out=<file> Output file of trimmed reads.
19 overwrite=f (ow) Set to false to force the program to abort rather than
20 overwrite an existing file.
21 printkmers=t Generate files with kmer counts at junction sites.
22 junctions=junctions_k%.txt File pattern for junction output.
23
24 Java Parameters:
25 -Xmx This will set Java's memory usage, overriding autodetection.
26 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will
27 specify 200 megs. The max is typically 85% of physical memory.
28 -eoom This flag will cause the process to exit if an out-of-memory
29 exception occurs. Requires Java 8u92+.
30 -da Disable assertions.
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
50 z="-Xmx200m"
51 set=0
52
53 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
54 usage
55 exit
56 fi
57
58 calcXmx () {
59 source "$DIR""/calcmem.sh"
60 setEnvironment
61 parseXmx "$@"
62 }
63 calcXmx "$@"
64
65 process() {
66 local CMD="java $EA $EOOM $z -cp $CP jgi.FindHiCJunctions $@"
67 echo $CMD >&2
68 eval $CMD
69 }
70
71 process "$@"