-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScript_1_Demultiplex_dDocent.sh
More file actions
236 lines (171 loc) · 11.2 KB
/
Copy pathScript_1_Demultiplex_dDocent.sh
File metadata and controls
236 lines (171 loc) · 11.2 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
#####################################
#
# Part 1: GBS data demultiplex & dDocent
# January 2025
#
# Code Contributor: Cassandra E.
# Biodiversity Research Center, UBC
#
#####################################
# This code includes the following 3 sections:
# 1.1: Demultiplexing
# 1.2: Use of dDocent (Mapping -> SNP calling -> SNP filtering)
# 1.3: Example code on how to run dDocent
#####################################
# 1.1 Demultiplexing
#####################################
# -- Move the following 3 files into your working directory
cd ~/scratch
mkdir working_dir
# -- File 1: fastq file (R1 and R2)
cp sample.R1.fastq.gz working_dir
cp sample.R2.fastq.gz working_dir
# -- File 2: barcode file
cp barcodes.txt working_dir
# -- File 3: perl script
cp GBS2enzymedemultiplex_notrim.pl working_dir
# -- TMUX: allows to run in the background
tmux new-session -s lane1
tmux attach-session -t lane1
# -- Start interactive sessions (SALLOC) to run this step
cd working_dir
salloc -c2 --time 20:00:00 --mem 120000m --account def-rieseber
# -- Demultiplexing
perl GBS2enzymedemultiplex_notrim.pl barcodes.txt sample.R1.fastq.gz sample.R1.fastq.gz
#####################################
# 1.2 dDocent
#####################################
# -- create tmux session
tmux new-session -s Cassiope
tmux attach-session -t Cassiope
# -- get interactive allocation
salloc -c48 --time 23:00:00 --mem 187G --account def-rieseber
# -- set up Ddocent environment in session
~/miniconda2/bin/conda create --name dDocent
source ~/miniconda2/bin/activate dDocent
# -- update conda
conda update -n base -c defaults conda
# Your installed version is: 2.17
#source ~/miniconda2/bin/deactivate dDocent
conda install -c bioconda ddocent
# Update from dDocent 2.6.0 to dDocent 2.9.4
##########################################
# 1.3 Example code on how to run dDocent
##########################################
#----------------
# change directory to your fastq files named according to Ddocent:
# https://www.ddocent.com/UserGuide/#quality-filtering
cd /project/6019339/celphin/Cassiope/Feb2023_dDocent/reference_fastq
# activate conda environment
source ~/miniconda2/bin/activate dDocent
#use dDocent to build the assembly (leave k2 parameter blank)
dDocent
55 individuals are detected. Is this correct? Enter yes or no and press [ENTER]
yes
dDocent detects 48 processors available on this system.
Please enter the maximum number of processors to use for this analysis.
48
dDocent detects 187 gigabytes of maximum memory available on this system.
Please enter the maximum memory to use for this analysis in gigabytes
For example, to limit dDocent to ten gigabytes, enter 10
This option does not work with all distributions of Linux. If runs are hanging at variant calling, enter 0
Then press [ENTER]
180
Do you want to quality trim your reads?
Type yes or no and press [ENTER]?
no
Do you want to perform an assembly?
Type yes or no and press [ENTER].
yes
What type of assembly would you like to perform? Enter SE for single end, PE for paired-end, RPE for paired-end sequencing for RAD protocols with random shearing, or OL for paired-end sequencing that has substantial overlap.
Then press [ENTER]
PE
Reads will be assembled with Rainbow
CD-HIT will cluster reference sequences by similarity. The -c parameter (% similarity to cluster) may need to be changed for your taxa.
Would you like to enter a new c parameter now? Type yes or no and press [ENTER]
yes
Please enter new value for c. Enter in decimal form (For 90%, enter 0.9)
0.95
Do you want to map reads? Type yes or no and press [ENTER]
no
Mapping will not be performed
Do you want to use FreeBayes to call SNPs? Please type yes or no and press [ENTER]
no
Please enter your email address. dDocent will email you when it is finished running.
Don't worry; dDocent has no financial need to sell your email address to spammers.
cassandra.elphinstone@shaw.ca
dDocent will require input during the assembly stage. Please wait until prompt says it is safe to move program to the background.
Number of Unique Sequences with More than X depth (Counted within individuals)
3e+06 ++----------+-----------+----------+-----------+-----------+-----------+----------+-----------+----------++
+ + + + + + + + + +
* |
|* |
2.5e+06 ++* ++
| * |
| * |
| * |
2e+06 ++ * ++
| * |
| ***** |
1.5e+06 ++ * ++
| ***** |
| * |
| ****** |
1e+06 ++ ***** ++
| ************ |
| ****************** |
| ****************** |
500000 ++ *****************************+
| *
| |
+ + + + + + + + + +
0 ++----------+-----------+----------+-----------+-----------+-----------+----------+-----------+----------++
2 4 6 8 10 12 14 16 18 20
depth
Please choose data cutoff. In essence, you are picking a minimum (within individual) coverage level for a read (allele) to be used in the reference assembly
3
Number of Unique Sequences present in more than X Individuals
Number of Unique Sequences
300000 ++----------------+----------------+-----------------+-----------------+----------------+----------------++
+ + + + + + +
| * |
| * |
250000 ++ * ++
| * |
| * |
| * |
200000 ++ * ++
| * |
| * |
150000 ++ * ++
| * |
| *** |
| * |
100000 ++ *** ++
| |
| **** |
| *** |
50000 ++ **** ++
| *** |
| **** |
+ + + ****************** + + +
0 ++----------------+----------------+-----------------+---***************************************---------++
0 5 10 15 20 25 30
Number of Individuals
Please choose data cutoff. Pick point right before the assymptote. A good starting cutoff might be 10% of the total number of individuals
5
At this point, all configuration information has been entered and dDocent may take several hours to run.
It is recommended that you move this script to a background operation and disable terminal input and output.
All data and logfiles will still be recorded.
To do this:
Press control and Z simultaneously
Type 'bg' without the quotes and press enter
Type 'disown -h' again without the quotes and press enter
Now sit back, relax, and wait for your analysis to finish
dDocent assembled 102787 sequences (after cutoffs) into 23890 contigs
dDocent has finished with an analysis in /project/6019339/celphin/Cassiope/Feb2023_dDocent/fastq/reference_fastq
dDocent started Mon Mar 6 16:58:48 PST 2023
dDocent finished Mon Mar 6 17:04:39 PST 2023
dDocent 2.9.4
The 'd' is silent, hillbilly.
# END