-
Notifications
You must be signed in to change notification settings - Fork 0
/
doit09-fastp.bash
executable file
·60 lines (46 loc) · 1.58 KB
/
doit09-fastp.bash
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
#! /bin/bash
. $(dirname ${BASH_SOURCE[0]})/doit-preamble.bash
# ------------------------------------------------------------------------
# Trim and filter the short reads
# (https://github.com/OpenGene/fastp)
# ------------------------------------------------------------------------
rm -rf ${FASTP}
if [ -z "${R1_FQ_GZ}" ] ; then
echo 1>&2 '# No Illumina reads to trim'
elif [ "${SKIP_FASTP}" ] ; then
echo 1>&2 '# Skipping Illumina clean-up'
mkdir ${FASTP}
cp --archive ${INPUTS}/raw_short_R1.fastq.gz ${FASTP}/trimmed_R1.fastq.gz
if [ -e ${INPUTS}/raw_short_R2.fastq.gz ] ; then
cp --archive ${INPUTS}/raw_short_R2.fastq.gz ${FASTP}/trimmed_R2.fastq.gz
fi
elif [ -e ${INPUTS}/raw_short_R2.fastq.gz ] ; then
echo 1>&2 '# Clean-up Illumina reads'
mkdir ${FASTP}
fastp \
--thread ${THREADS} \
${FASTP_ADAPTER_ARGS} \
--json ${FASTP}/fastp.json \
--html ${FASTP}/fastp.html \
--in1 ${INPUTS}/raw_short_R1.fastq.gz \
--in2 ${INPUTS}/raw_short_R2.fastq.gz \
--out1 ${FASTP}/trimmed_R1.fastq.gz \
--out2 ${FASTP}/trimmed_R2.fastq.gz \
--unpaired1 ${FASTP}/u.fastq.gz \
--unpaired2 ${FASTP}/u.fastq.gz
else
echo 1>&2 '# Clean-up Illumina reads'
mkdir ${FASTP}
fastp \
--thread ${THREADS} \
${FASTP_ADAPTER_ARGS} \
--json ${FASTP}/fastp.json \
--html ${FASTP}/fastp.html \
--in1 ${INPUTS}/raw_short_R1.fastq.gz \
--out1 ${FASTP}/trimmed_R1.fastq.gz
fi
# ------------------------------------------------------------------------
# Done.
# ------------------------------------------------------------------------
echo 1>&2 ''
echo 1>&2 '# Done.'