-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemp_paired_end_script_rc.csh
92 lines (77 loc) · 2.7 KB
/
emp_paired_end_script_rc.csh
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh
#
##SBATCH --job-name=QIIME2_paired
#SBATCH --time=24:00:00
#SBATCH --ntasks=5
#SBATCH --cpus-per-task=1
#SBATCH --partition=parallel
#SBATCH --mem-per-cpu=20G
#SBATCH --nodes=1
#SBATCH --mail-type=end
#SBATCH [email protected]
#load qiime module
module load qiime2/2023.5.1
# copy emp_paired_end_script.config.txt to analysis folder
# edit variables of config file according to analysis
# this script will use the variables in the config file for this analysis
source ./emp_paired_end_script.config
# echo the time for each - this helps with troubleshooting bugs
echo "Starting qiime2 analysis"
date
# import the demultiplexed data
echo "Starting qiime2 tools import"
date
# importing fastq files from emp-paired-end-sequences directory
qiime tools import \
--type EMPPairedEndSequences \
--input-path $DATA \
--output-path ${PREFIX}.qza
# demultiplex sequence data
echo "Starting demux"
date
qiime demux emp-paired \
--i-seqs ${PREFIX}.qza \
--m-barcodes-file $METADATA \
--m-barcodes-column BarcodeSequence \
--p-rev-comp-mapping-barcodes \
--o-per-sample-sequences ${PREFIX}_demux.qza \
--o-error-correction-details ${PREFIX}_demux-details.qza \
--p-no-golay-error-correction
# make a summary of the demultiplexed sequences
echo "Starting demux summary"
date
qiime demux summarize \
--i-data ${PREFIX}_demux.qza \
--o-visualization ${PREFIX}_demux.qzv
# use DADA2 to remove sequencing errors
echo "Starting DADA2"
date
qiime dada2 denoise-paired \
--i-demultiplexed-seqs ${PREFIX}_demux.qza \
--p-trim-left-f 23 \
--p-trim-left-r 23 \
--p-trunc-len-f 200 \
--p-trunc-len-r 200 \
--o-representative-sequences ${PREFIX}_reps.qza \
--o-table ${PREFIX}_dada2.qza \
--o-denoising-stats ${PREFIX}_stats-dada2.qza \
--p-n-threads 2 \
--p-min-fold-parent-over-abundance 10
# filter samples for this study
echo "Starting filter"
date
qiime feature-table filter-samples \
--i-table ${PREFIX}_dada2.qza \
--m-metadata-file ${METADATA} \
--p-where "[SampleOwner]='Lizzy'" \
--o-filtered-table ${PREFIX}_dada2_filtered_table.qza
# make a feature table summary with the filtered samples for this study
echo "Starting feature table summary"
date
qiime feature-table summarize \
--i-table ${PREFIX}_dada2.qza \
--o-visualization ${PREFIX}_dada2_summarize.qzv \
--m-sample-metadata-file ${METADATA}
echo "End of script"
date
~