-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_trim.sh
74 lines (58 loc) · 1.93 KB
/
script_trim.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
69
70
71
72
73
74
## originally by Yulong Niu
date
RAW_PATH=/netscratch/dep_psl/grp_rgo/yniu/KaWaiFlg22/raw_data_soil
CLEAN_PATH=/netscratch/dep_psl/grp_rgo/yniu/KaWaiFlg22/clean_data_soil
FASTP_PATH=/home/yniu/Biotools
FASTQC_PATH=/opt/share/software/bin
CORENUM=16
cd ${RAW_PATH}
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~raw~~~~~~~~~~~~~~~~~~
## sample names
fq=($(ls | grep .fq.gz))
for i in ${fq[@]}
do
echo "FastQC ${i}"
${FASTQC_PATH}/fastqc -o ${RAW_PATH} \
-t ${CORENUM} \
${i}
echo "Trimming ${i}."
${FASTP_PATH}/fastp -w ${CORENUM} \
-z 6 \
-p \
-U --umi_loc=read1 --umi_len=8 \
--trim_tail1=2 \
-h ${i%%.*}.html \
-i ${i} \
-o ${CLEAN_PATH}/${i}
done
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##~~~~~~~~~~~~~~~~~~~~~1stadd~~~~~~~~~~~~~~~~~~~~~~~~~~
fq=($(ls | grep fq.gz))
fqnames=($(echo "${fq[@]%_*}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
for i in ${fqnames[@]}
do
echo "Trimming ${i}_R1.fq.gz ${i}_R2.fq.gz."
${FASTP_PATH}/fastp -w ${CORENUM} \
-z 6 \
-p -c \
-h ${i}.html \
-i ${i}_R1.fq.gz -I ${i}_R2.fq.gz \
-o ${CLEAN_PATH}/${i}_R1.fq.gz -O ${CLEAN_PATH}/${i}_R2.fq.gz
done
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##~~~~~~~~~~~~~~~~~~~~~soil~~~~~~~~~~~~~~~~~~~~~~~~~~
fq=($(ls | grep fq.gz))
fqnames=($(echo "${fq[@]%_*}" | tr ' ' '\n' | sort -u | tr '\n' ' '))
for i in ${fqnames[@]}
do
echo "Trimming ${i}_R1.fq.gz ${i}_R2.fq.gz."
${FASTP_PATH}/fastp -w ${CORENUM} \
-z 6 \
-p -c \
-h ${i}.html \
-i ${i}_R1.fq.gz -I ${i}_R2.fq.gz \
-o ${CLEAN_PATH}/${i}_R1.fq.gz -O ${CLEAN_PATH}/${i}_R2.fq.gz
done
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
date