comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/shred.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 January 13, 2022
7 Description: Shreds sequences into shorter, potentially overlapping sequences.
8
9 Usage: shred.sh in=<file> out=<file> length=<number> minlength=<number> overlap=<number>
10
11 in=<file> Input sequences.
12 out=<file> Destination of output shreds.
13 length=500 Desired length of shreds.
14 minlength=1 Shortest allowed shred. The last shred of each input sequence may be shorter than desired length.
15 overlap=0 Amount of overlap between successive reads.
16 reads=-1 If nonnegative, stop after this many input sequences.
17 equal=f Shred each sequence into subsequences of equal size of at most 'length', instead of a fixed size.
18 median=0 If nonzero, randomly shred reads to a length with this median.
19 variance=0 If median is nonzero, shred to lengths of median +-variance.
20 qfake=30 Quality score, if using fastq output.
21
22 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
23 "
24 }
25
26 #This block allows symlinked shellscripts to correctly set classpath.
27 pushd . > /dev/null
28 DIR="${BASH_SOURCE[0]}"
29 while [ -h "$DIR" ]; do
30 cd "$(dirname "$DIR")"
31 DIR="$(readlink "$(basename "$DIR")")"
32 done
33 cd "$(dirname "$DIR")"
34 DIR="$(pwd)/"
35 popd > /dev/null
36
37 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
38 CP="$DIR""current/"
39
40 z="-Xmx1400m"
41 set=0
42
43 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
44 usage
45 exit
46 fi
47
48 calcXmx () {
49 source "$DIR""/calcmem.sh"
50 setEnvironment
51 parseXmx "$@"
52 }
53 calcXmx "$@"
54
55 stats() {
56 local CMD="java $EA $EOOM $z -cp $CP jgi.Shred $@"
57 # echo $CMD >&2
58 eval $CMD
59 }
60
61 stats "$@"