jpayne@69
|
1 #!/bin/bash
|
jpayne@69
|
2
|
jpayne@69
|
3 usage(){
|
jpayne@69
|
4 echo "
|
jpayne@69
|
5 Written by Brian Bushnell
|
jpayne@69
|
6 Last modified February 17, 2015
|
jpayne@69
|
7
|
jpayne@69
|
8 ***DEPRECATED***
|
jpayne@69
|
9
|
jpayne@69
|
10 Description: Randomly adds adapters to a file, or grades a trimmed file.
|
jpayne@69
|
11 The input is a set of reads, paired or unpaired.
|
jpayne@69
|
12 The output is those same reads with adapter sequence replacing some of the bases in some reads.
|
jpayne@69
|
13 For paired reads, adapters are located in the same position in read1 and read2.
|
jpayne@69
|
14 This is designed for benchmarking adapter-trimming software, and evaluating methodology.
|
jpayne@69
|
15 randomreads.sh is better for paired reads, though, as it actually adds adapters at the correct location,
|
jpayne@69
|
16 so that overlap may be used for adapter detection.
|
jpayne@69
|
17
|
jpayne@69
|
18 Usage: addadapters.sh in=<file> in2=<file2> out=<outfile> out2=<outfile2> adapters=<file>
|
jpayne@69
|
19
|
jpayne@69
|
20 in2 and out2 are for paired reads and are optional.
|
jpayne@69
|
21 If input is paired and there is only one output file, it will be written interleaved.
|
jpayne@69
|
22
|
jpayne@69
|
23 Parameters:
|
jpayne@69
|
24 ow=f (overwrite) Overwrites files that already exist.
|
jpayne@69
|
25 int=f (interleaved) Determines whether INPUT file is considered interleaved.
|
jpayne@69
|
26 qin=auto ASCII offset for input quality. May be 33 (Sanger), 64 (Illumina), or auto.
|
jpayne@69
|
27 qout=auto ASCII offset for output quality. May be 33 (Sanger), 64 (Illumina), or auto (same as input).
|
jpayne@69
|
28 add Add adapters to input files. Default mode.
|
jpayne@69
|
29 grade Evaluate trimmed input files.
|
jpayne@69
|
30 adapters=<file> Fasta file of adapter sequences.
|
jpayne@69
|
31 literal=<sequence> Comma-delimited list of adapter sequences.
|
jpayne@69
|
32 left Adapters are on the left (3') end of the read.
|
jpayne@69
|
33 right Adapters are on the right (5') end of the read. Default mode.
|
jpayne@69
|
34 adderrors=t Add errors to adapters based on the quality scores.
|
jpayne@69
|
35 addpaired=t Add adapters to the same location for read 1 and read 2.
|
jpayne@69
|
36 arc=f Add reverse-complemented adapters as well as forward.
|
jpayne@69
|
37 rate=0.5 Add adapters to this fraction of reads.
|
jpayne@69
|
38
|
jpayne@69
|
39 Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
|
jpayne@69
|
40 "
|
jpayne@69
|
41 }
|
jpayne@69
|
42
|
jpayne@69
|
43 #This block allows symlinked shellscripts to correctly set classpath.
|
jpayne@69
|
44 pushd . > /dev/null
|
jpayne@69
|
45 DIR="${BASH_SOURCE[0]}"
|
jpayne@69
|
46 while [ -h "$DIR" ]; do
|
jpayne@69
|
47 cd "$(dirname "$DIR")"
|
jpayne@69
|
48 DIR="$(readlink "$(basename "$DIR")")"
|
jpayne@69
|
49 done
|
jpayne@69
|
50 cd "$(dirname "$DIR")"
|
jpayne@69
|
51 DIR="$(pwd)/"
|
jpayne@69
|
52 popd > /dev/null
|
jpayne@69
|
53
|
jpayne@69
|
54 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
|
jpayne@69
|
55 CP="$DIR""current/"
|
jpayne@69
|
56
|
jpayne@69
|
57 z="-Xmx200m"
|
jpayne@69
|
58 set=0
|
jpayne@69
|
59
|
jpayne@69
|
60 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
|
jpayne@69
|
61 usage
|
jpayne@69
|
62 exit
|
jpayne@69
|
63 fi
|
jpayne@69
|
64
|
jpayne@69
|
65 calcXmx () {
|
jpayne@69
|
66 source "$DIR""/calcmem.sh"
|
jpayne@69
|
67 setEnvironment
|
jpayne@69
|
68 parseXmx "$@"
|
jpayne@69
|
69 }
|
jpayne@69
|
70 calcXmx "$@"
|
jpayne@69
|
71
|
jpayne@69
|
72 function addadapters() {
|
jpayne@69
|
73 local CMD="java $EA $EOOM $z -cp $CP jgi.AddAdapters $@"
|
jpayne@69
|
74 echo $CMD >&2
|
jpayne@69
|
75 eval $CMD
|
jpayne@69
|
76 }
|
jpayne@69
|
77
|
jpayne@69
|
78 addadapters "$@"
|