forked from tadKeys/tabsat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
01_qc.sh
executable file
·60 lines (39 loc) · 1.04 KB
/
01_qc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
TMP_CUR_DIR=`dirname $0`
TMP_TABSAT_SCRIPT="$TMP_CUR_DIR/tabsat"
TMP_ABS_TABSAT_SCRIPT=`readlink -f $TMP_TABSAT_SCRIPT`
BASE_DIR=`dirname $TMP_ABS_TABSAT_SCRIPT`
PRINSEQLITE="${BASE_DIR}/tools/prinseq-lite-0.20.4/prinseq-lite.pl"
PRINSEQGRAPHS="${BASE_DIR}/tools/prinseq-lite-0.20.4/prinseq-graphs-noPCA.pl"
if [ -n "$1" ];
then
file=${1}
else
echo "-- Please specify a file"
exit
fi
if [ -n "$2" ];
then
outputfolder=${2}
else
echo "-- Please specify an output folder"
exit
fi
## Get the filename
FILENAME=`basename ${file}`
##
## Create output folder
##
mkdir -p $outputfolder
echo "-- Performing QC with ${file} - folder: ${outputfolder} - filename: ${FILENAME}"
##
## Run PrinSeq
##
FILENAME=`basename ${file}`
perl ${PRINSEQLITE} -fastq ${file} -graph_data ${outputfolder}/${FILENAME}.graph -out_good null -out_bad null &> ${outputfolder}/${FILENAME}.log
##
## Create PrinSeq graph
##
FILENAME=`basename ${file}`
perl ${PRINSEQGRAPHS} -i ${outputfolder}/${FILENAME}.graph -html_all
echo "-- ... done performing QC"