annotate filter-wrapper.sh @ 0:d4690e65afcd draft

Uploaded
author bcclaywell
date Thu, 26 Feb 2015 18:16:36 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
1 #!/bin/bash
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
2
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
3 source $(dirname $0)/util.sh
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
4 source $1
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
5
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
6 INPUT_QUAL=$(extify qual ${INPUT_QUAL})
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
7 BARCODES=$(extify csv ${BARCODES})
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
8 RAW_SEQS=$(extify fasta ${RAW_SEQS})
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
9
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
10 seqmagick quality-filter \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
11 --input-qual ${INPUT_QUAL} \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
12 --barcode-file ${BARCODES} \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
13 --primer "${PRIMER}" \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
14 --report-out ${FILTER_REPORT} \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
15 --details-out ${FILTER_DETAILS} \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
16 --map-out ${SPLIT_MAP} \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
17 --barcode-header \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
18 --min-length ${MIN_LENGTH} \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
19 --min-mean-quality ${MIN_QUALITY} \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
20 --quality-window 30 \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
21 --quality-window-prop 0.9 \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
22 --quality-window-mean-qual 15 \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
23 ${RAW_SEQS} \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
24 filtered.fasta
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
25
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
26 if [[ ${REVERSE_COMPLEMENT} == "TRUE" ]]; then
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
27 seqmagick mogrify \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
28 --reverse-complement \
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
29 filtered.fasta
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
30 fi
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
31
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
32 mv filtered.fasta ${FILTERED_SEQS}
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
33
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
34 # TODO: separate tool for concatenating seq data (and reverse complementing them?)
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
35 #cat [12]*Reads.fasta | seqmagick convert --input-format fasta - combined.fasta --reverse-complement
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
36 #cat [12]*.map.csv > combined.map.csv
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
37
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
38 sequencing_quality_report.py ${PLATE_JSON} -t "Sequencing quality report" -o ${SQR_DIR}
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
39
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
40 cat <<EOF > ${SQR}
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
41 <!DOCTYPE HTML>
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
42 <html lang="en-US">
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
43 <head/>
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
44 <body>
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
45 <a href="index.html">Sequencing quality report</a>
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
46 </body>
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
47 </html>
d4690e65afcd Uploaded
bcclaywell
parents:
diff changeset
48 EOF