-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript
56 lines (41 loc) · 1.8 KB
/
script
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
#!/bin/bash
set -e
set -u
#install usearch, vseach, fastQC
export usearch=path/to/usearch11.0.667_i86linux32
if [ x$usearch == x ] ; then
echo Must set \$usearch >> /dev/stderr
exit 1
fi
cd ~/PRJNA423040
rm -rf ./output
mkdir -p ./output
cd ./output
SECONDS=0
echo "STEP1: assembling reads..."
# we have single end reads
cat ../*.fastq >> merged.fastq
mkdir -p fastqc_check_before
echo "STEP2:running FAST QC on merged raw fastq files..."
fastqc merged.fastq -o ./fastqc_check_before
echo "STEP3: filtering the reads..."
# Strip primer (CCGTCAATTCMTTTRAGT, len 18, strips 30 bases as stated)
$usearch -fastx_truncate merged.fastq -stripleft 30 -fastqout reads_stripped.fastq
$usearch -fastq_filter reads_stripped.fastq -fastq_maxee 1.0 -fastq_trunclen 350 -fastaout filtered.fa
echo "STEP4:dereplication: findind the unique sequences and abundances..."
vsearch --derep_fulllength filtered.fa -sizeout -relabel Uniq -output uniques.fa
echo "STEP5:picking OTUs and checking chimeras and discarding...it makes 97% OTUs"
$usearch -cluster_otus uniques.fa -minsize 2 -otus otus.fa -relabel Otu \
-uparseout cluster_otus_detail.up -log cluster_otus.log
echo "STEP6:creating OTU tables..."
$usearch -otutab filtered.fa -otus otus.fa -otutabout otutab_raw.txt
echo "STEP7:assigning taxonomy to the OTU table..."
db_path="path/to/rdp_16s_v18.fa"
$usearch -sintax otus.fa -db "$db_path" -strand both \
-tabbedout sintax.txt -sintax_cutoff 0.8
echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
echo ANALYSIS COMPLETE
echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
duration=$SECONDS
echo "Installing took $(($duration / 3600)) hours, \
$(($duration / 60)) minutes and $(($duration % 60)) seconds."