Debian Codegraph @

streamsam.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 usagescip-shell shell bbmap 39.20+dfsg-3 usage().(){
4 echoscip-shell system . . 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 [email protected] if you encounter any problems.
30 "
31 }
32
33 #This block allows symlinked shellscripts to correctly set classpath.
34 pushd . > /dev/nullscip-shell filesystem . . `/dev/null`.
35 DIR="${BASH_SOURCE[0]}"
36 while [scip-shell system . . `[`. -h "$DIR" ]; do
37 cd "$(dirnamescip-shell system . . dirname. "$DIR")"
38 DIR="$(readlinkscip-shell system . . readlink. "$(basenamescip-shell system . . basename. "$DIR")")"
39 done
40 cd "$(dirnamescip-shell system . . dirname. "$DIR")"
41 DIR="$(pwdscip-shell system . . pwd.)/"
42 popd > /dev/nullscip-shell filesystem . . `/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 [scip-shell system . . `[`. -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
51 usagescip-shell shell bbmap 39.20+dfsg-3 usage().
52 exit
53 fi
54
55 calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). () {
56 source "$DIR""/calcmem.sh"
57 setEnvironment
58 parseXmx "$@"
59 }
60 calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). "$@"
61
62 streamsamscip-shell shell bbmap 39.20+dfsg-3 streamsam().() {
63 local CMD="java $EA $EOOM $z -cp $CP stream.SamStreamerWrapper $@"
64 echoscip-shell system . . echo. $CMD >&2
65 eval $CMD
66 }
67
68 streamsamscip-shell shell bbmap 39.20+dfsg-3 streamsam(). "$@"