comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/msa.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 February 5, 2020
7
8 Description: Aligns a query sequence to reference sequences.
9 Outputs the best matching position per reference sequence.
10 If there are multiple queries, only the best-matching query will be used.
11 MSA in this context stands for MultiStateAligner, not Multiple Sequence Alignment.
12
13 Usage:
14 msa.sh in=<file> out=<file> literal=<literal,literal,...>
15 or
16 msa.sh in=<file> out=<file> ref=<lfile>
17
18 Parameters:
19 in=<file> File containing reads.
20 out=<file> Sam output file.
21 literal= A sequence of bases to match, or a comma-delimited list.
22 ref=<file> A fasta file of bases to match. Please set either ref
23 or literal, not both.
24 rcomp=t Also look for reverse-complements of the sequences.
25 addr=f Add r_ prefix to reverse-complemented alignments.
26 replicate=f Make copies of sequences with undefined bases for every
27 possible combination. For example, ATN would expand to
28 ATA, ATC, ATG, and ATT.
29 cutoff=0 Ignore alignments with identity below this (range 0-1).
30 swap=f Swap the reference and query; e.g., report read alignments
31 to the reference instead of reference alignments to the reads.
32
33 Java Parameters:
34 -Xmx This will set Java's memory usage, overriding automatic
35 memory detection. -Xmx20g will specify
36 20 gigs of RAM, and -Xmx200m will specify 200 megs.
37 The max is typically 85% of physical memory.
38 -eoom This flag will cause the process to exit if an out-of-memory
39 exception occurs. Requires Java 8u92+.
40 -da Disable assertions.
41
42 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
43 "
44 }
45
46 #This block allows symlinked shellscripts to correctly set classpath.
47 pushd . > /dev/null
48 DIR="${BASH_SOURCE[0]}"
49 while [ -h "$DIR" ]; do
50 cd "$(dirname "$DIR")"
51 DIR="$(readlink "$(basename "$DIR")")"
52 done
53 cd "$(dirname "$DIR")"
54 DIR="$(pwd)/"
55 popd > /dev/null
56
57 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
58 CP="$DIR""current/"
59
60 z="-Xmx1g"
61 z2="-Xms1g"
62 set=0
63
64 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
65 usage
66 exit
67 fi
68
69 calcXmx () {
70 source "$DIR""/calcmem.sh"
71 setEnvironment
72 parseXmx "$@"
73 if [[ $set == 1 ]]; then
74 return
75 fi
76 freeRam 2000m 84
77 z="-Xmx${RAM}m"
78 z2="-Xms${RAM}m"
79 }
80 calcXmx "$@"
81
82 msa() {
83 local CMD="java $EA $EOOM $z -cp $CP jgi.FindPrimers $@"
84 echo $CMD >&2
85 eval $CMD
86 }
87
88 msa "$@"