Debian Codegraph @

makechimeras.sh

raw symbols SCIP
1 #!/bin/bash
2
3 usage(){
4 echo "
5 Written by Brian Bushnell
6 Last modified February 17, 2015
7
8 Description: Makes chimeric sequences from nonchimeric sequences.
9 Designed for PacBio reads.
10
11 Usage: makechimeras.sh in=<input> out=<output> chimeras=<integer>
12
13 Input Parameters:
14 in=<file> The input file containing nonchimeric reads.
15 unpigz=t Decompress with pigz for faster decompression.
16
17 Output Parameters:
18 out=<file> Fasta output destination.
19 chimeras=-1 Number of chimeras to create (required parameter).
20 forcelength=0 If a positive number X, one parent will be length X, and the other will be length-X.
21
22 Java Parameters:
23 -Xmx This will set Java's memory usage, overriding autodetection.
24 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will
25 specify 200 megs. The max is typically 85% of physical memory.
26 -eoom This flag will cause the process to exit if an out-of-memory
27 exception occurs. Requires Java 8u92+.
28 -da Disable assertions.
29
30 Please contact Brian Bushnell at [email protected] if you encounter any problems.
31 "
32 }
33
34 #This block allows symlinked shellscripts to correctly set classpath.
35 pushd . > /dev/null
36 DIR="${BASH_SOURCE[0]}"
37 while [ -h "$DIR" ]; do
38 cd "$(dirname "$DIR")"
39 DIR="$(readlink "$(basename "$DIR")")"
40 done
41 cd "$(dirname "$DIR")"
42 DIR="$(pwd)/"
43 popd > /dev/null
44
45 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
46 CP="$DIR""current/"
47
48 z="-Xmx1g"
49 z2="-Xms1g"
50 set=0
51
52 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
53 usage
54 exit
55 fi
56
57 calcXmx () {
58 source "$DIR""/calcmem.sh"
59 setEnvironment
60 parseXmx "$@"
61 if [[ $set == 1 ]]; then
62 return
63 fi
64 freeRam 800m 82
65 z="-Xmx${RAM}m"
66 z2="-Xms${RAM}m"
67 }
68 calcXmx "$@"
69
70 makechimeras() {
71 local CMD="java $EA $EOOM $z -cp $CP jgi.MakeChimeras $@"
72 echo $CMD >&2
73 eval $CMD
74 }
75
76 makechimeras "$@"