-
Notifications
You must be signed in to change notification settings - Fork 6
/
05-trimgalore.sh
executable file
·68 lines (63 loc) · 2.08 KB
/
05-trimgalore.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
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
HOME_PATH=/home/user/analysis
FASTQ_PATH=$HOME_PATH/fastq
TRIMGALORE_COMMAND=$TRIMGALORE_PATH/trim_galore
CUTADAPT_COMMAND=$CUTADAPT_PATH/cutadapt
TRIMGALORE_OUTPUT=$HOME_PATH/fastq_qual
CORES=4
if [ ! -d $TRIMGALORE_OUTPUT ]
then
mkdir -p $TRIMGALORE_OUTPUT
fi
for FILE in $FASTQ_PATH/*_1.fastq.gz
do
BASE=`basename $FILE | sed s/_1\.fastq\.gz//`
echo "Processing $BASE"
mkdir -p $TRIMGALORE_OUTPUT
F1=$FASTQ_PATH/$BASE"_1.fastq.gz"
F2=$FASTQ_PATH/$BASE"_2.fastq.gz"
$TRIMGALORE_COMMAND \
--quality 30 \
--length 50 \
--output_dir $TRIMGALORE_OUTPUT/ \
--path_to_cutadapt $CUTADAPT_COMMAND \
--cores 4 \
--paired \
--fastqc \
--trim-n $F1 $F2
mv $TRIMGALORE_OUTPUT/$BASE"_1_val_1.fq.gz" \
$TRIMGALORE_OUTPUT/$BASE"_1.fastq.gz"
mv $TRIMGALORE_OUTPUT/$BASE"_2_val_2.fq.gz" \
$TRIMGALORE_OUTPUT/$BASE"_2.fastq.gz"
mv $TRIMGALORE_OUTPUT/$BASE"_1_val_1_fastqc.html" \
$TRIMGALORE_OUTPUT/$BASE"_1_fastqc.html"
mv $TRIMGALORE_OUTPUT/$BASE"_1_val_1_fastqc.zip" \
$TRIMGALORE_OUTPUT/$BASE"_1_fastqc.zip"
mv $TRIMGALORE_OUTPUT/$BASE"_2_val_2_fastqc.html" \
$TRIMGALORE_OUTPUT/$BASE"_2_fastqc.html"
mv $TRIMGALORE_OUTPUT/$BASE"_2_val_2_fastqc.zip" \
$TRIMGALORE_OUTPUT/$BASE"_2_fastqc.zip"
done
## For single-end reads
#for FILE in $FASTQ_PATH/*.fastq.gz
#do
# BASE=`basename $FILE | sed s/\.fastq\.gz//`
# echo "Processing $BASE"
# mkdir -p $TRIMGALORE_OUTPUT
# F=$FASTQ_PATH/$BASE".fastq.gz"
# $TRIMGALORE_COMMAND \
# --quality 30 \
# --length 50 \
# --output_dir $TRIMGALORE_OUTPUT/$BASE \
# --path_to_cutadapt $CUTADAPT_COMMAND \
# --cores 4 \
# --fastqc \
# --trim-n $F
#
# mv $TRIMGALORE_OUTPUT/$BASE"_val.fq.gz" \
# $TRIMGALORE_OUTPUT/$BASE".fastq.gz"
# mv $TRIMGALORE_OUTPUT/$BASE"_val_fastqc.html" \
# $TRIMGALORE_OUTPUT/$BASE"_fastqc.html"
# mv $TRIMGALORE_OUTPUT/$BASE"_val_fastqc.zip" \
# $TRIMGALORE_OUTPUT/$BASE"_fastqc.zip"
#done