comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/opt/bbmap-39.01-1/streamsam.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 21, 2018
7
8 Description: Converts sam/bam to fastq rapidly with multiple threads.
9 bam files require samtools or sambamba in the path.
10
11 Usage: streamsam.sh in=<file> out=<file>
12
13 Filtering parameters:
14 minpos= Ignore alignments not overlapping this range.
15 maxpos= Ignore alignments not overlapping this range.
16 minmapq= Ignore alignments with mapq below this.
17 maxmapq= Ignore alignments with mapq above this.
18 contigs= Comma-delimited list of contig names to include. These
19 should have no spaces, or underscores instead of spaces.
20 mapped=t Include mapped reads.
21 unmapped=t Include unmapped reads.
22 secondary=f Include secondary alignments.
23 supplimentary=t Include supplimentary alignments.
24 lengthzero=f Include alignments without bases.
25 invert=f Invert sam filters.
26 ordered=t Keep reads in input order. False is faster.
27 ref=<file> Optional reference file.
28
29 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
30 "
31 }
32
33 #This block allows symlinked shellscripts to correctly set classpath.
34 pushd . > /dev/null
35 DIR="${BASH_SOURCE[0]}"
36 while [ -h "$DIR" ]; do
37 cd "$(dirname "$DIR")"
38 DIR="$(readlink "$(basename "$DIR")")"
39 done
40 cd "$(dirname "$DIR")"
41 DIR="$(pwd)/"
42 popd > /dev/null
43
44 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
45 CP="$DIR""current/"
46
47 z="-Xmx1g"
48 set=0
49
50 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
51 usage
52 exit
53 fi
54
55 calcXmx () {
56 source "$DIR""/calcmem.sh"
57 setEnvironment
58 parseXmx "$@"
59 }
60 calcXmx "$@"
61
62 streamsam() {
63 local CMD="java $EA $EOOM $z -cp $CP stream.SamStreamerWrapper $@"
64 echo $CMD >&2
65 eval $CMD
66 }
67
68 streamsam "$@"