-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMCL_clustering.sh
executable file
·482 lines (346 loc) · 11.3 KB
/
MCL_clustering.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
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
#!/bin/bash
#$ -cwd
#Abort on any error,
set -e
cd path/to
# NOTE: name the .abc file all_vs_all.abc, or chnage it in this shell script
# All versus all clustering: evalues from 10 to -60 should be run. The results graphed (get data using: Count_number_size_clusters.py)
# and the point at which the clustering network brakes,
# should be the point at which the results are taken from. In our case 1e-31. remeber evalue results change depeding on
# database size
diamond makedb --in all.fa -d d
diamond blastp -p 16 --sensitive -e 1e-1 -v -q all.fa -d d.dmnd -a out
wait
diamond view -a out*.daa -f tab -o all_vs_all.tab
cut -f1,2,11 all_vs_all.tab > all_vs_all.abc
python Remove_low_quality_blast_matches.py all_vs_all.abc all_results_eval_1e-31.abc 1e-31
mcxload -abc all_results_eval_1e-31.abc --stream-mirror --stream-neg-log10 -stream-tf 'ceil(200)' -o all_results_eval_1e-31.mci -write-tab all_results_eval_1e-31.abc.tab
wait
mcl all_results_eval_1e-31.mci -I 6 -use-tab all_results_eval_1e-31.abc.tab -o all_results_eval_1e-31.abc_seq.mci
wait
mcl all_results_eval_1e-31.mci --d -write-graphx all_results_eval_1e-31.mci_Outputgraph.txt -I 6
wait
mcxdump -icl out.all_results_eval_1e-31.mci.I60 -tabr all_results_eval_1e-31.abc.tab -o all_results_eval_1e-31.mci.I60
######################################################################################################################
# This was run to collect the sequences for each cluster and align them.
cd $HOME/scratch/clustering/all_vs_all
# python script to parse the MCL cluster line and put in into thousands of files
python Count_size_MCL_clusters001_get_MYZUS_cluster_seq_Muscle_cluster_descriptions_seqIO_index006_gene_models.py
echo done step 1
# get the cluster summary
cd ./All_clusters
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
##rm *.txt
##rm *.fasta
filenames=*.fasta
for f in ${filenames}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${f} -out ${f}_aligned.fasta -maxiters 5000 -maxtrees 15"
echo ${cmd}
eval ${cmd}
wait
done
filenames2=*_aligned.fasta
for file in ${filenames2}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${file} -out ${file}_refine.fasta -refine"
echo ${cmd}
eval ${cmd}
wait
done
#rm -rf *_aligned.fasta
mkdir alignments
mv *_refine.fasta ./alignments
cd ./alignments
python $HOME/scratch/clustering/Align_back_translate_Aug2014.py
wait
cd ..
#rm *.txt
#rm *.fasta
cd ..
echo removed files in all clusters
###############################################################################################################################################
cd ./Bos2010
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
##rm *.txt
##rm *.fasta
filenames=*.fasta
for f in ${filenames}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${f} -out ${f}_aligned.fasta -maxiters 5000 -maxtrees 15"
echo ${cmd}
eval ${cmd}
wait
done
filenames2=*_aligned.fasta
for file in ${filenames2}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${file} -out ${file}_refine.fasta -refine"
echo ${cmd}
eval ${cmd}
wait
#rm -rf *_aligned.fasta
mkdir alignments
mv *_refine.fasta ./alignments
cd ./alignments
mkdir back_translated
python $HOME/scratch/clustering/Align_back_translate_Aug2014.py
wait
cd ..
#rm *.txt
#rm *.fasta
done
cd ..
###############################################################################################################################################
cd ./Conserved
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
#rm *.txt
#rm *.fasta
#filenames=*.fasta
#
#
#for f in ${filenames}
#do
# echo "Running muscle ${f}"
# cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${f} -out ${f}_aligned.fasta -maxiters 5000 -maxtrees 15"
# echo ${cmd}
# eval ${cmd}
# wait
# done
#
#
#filenames2=*_aligned.fasta
#for file in ${filenames2}
#do
# echo "Running muscle ${f}"
# cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${file} -out ${file}_refine.fasta -refine"
# echo ${cmd}
# eval ${cmd}
# wait
#rm -rf *_aligned.fasta
mkdir alignments
mv *_refine.fasta ./alignments
cd ./alignments
mkdir back_translated
python $HOME/scratch/clustering/Align_back_translate_Aug2014.py
wait
cd ..
#rm *.txt
#rm *.fasta
done
cd ..
###############################################################################################################################################
cd ./expression
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
filenames=*.fasta
##rm *.txt
##rm *.fasta
cd ..
######################################
cd ./Mass_spec
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
filenames=*.fasta
for f in ${filenames}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${f} -out ${f}_aligned.fasta -maxiters 5000 -maxtrees 15"
echo ${cmd}
eval ${cmd}
wait
done
filenames2=*_aligned.fasta
for file in ${filenames2}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${file} -out ${file}_refine.fasta -refine"
echo ${cmd}
eval ${cmd}
wait
#rm -rf *_aligned.fasta
mkdir alignments
mv *_refine.fasta ./alignments
cd ./alignments
mkdir back_translated
python $HOME/scratch/clustering/Align_back_translate_Aug2014.py
wait
cd ..
#rm *.txt
#rm *.fasta
done
##rm *.txt
##rm *.fasta
cd ..
######################################
cd ./Mcerasi_only
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
filenames=*.fasta
#rm -rf *_aligned.fasta
mkdir alignments
mv *_refine.fasta ./alignments
cd ./alignments
mkdir back_translated
python $HOME/scratch/clustering/Align_back_translate_Aug2014.py
wait
cd ..
#rm *.txt
#rm *.fasta
done
##rm *.txt
##rm *.fasta
cd ..
######################################
cd ./Mp_only
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
##rm *.txt
##rm *.fasta
cd ..
######################################
cd ./Myzus_only
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
for f in ${filenames}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${f} -out ${f}_aligned.fasta -maxiters 5000 -maxtrees 15"
echo ${cmd}
eval ${cmd}
wait
done
filenames2=*_aligned.fasta
for file in ${filenames2}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${file} -out ${file}_refine.fasta -refine"
echo ${cmd}
eval ${cmd}
wait
#rm -rf *_aligned.fasta
mkdir alignments
mv *_refine.fasta ./alignments
cd ./alignments
mkdir back_translated
python $HOME/scratch/clustering/Align_back_translate_Aug2014.py
wait
cd ..
#rm *.txt
#rm *.fasta
done
##rm *.txt
##rm *.fasta
cd ..
######################################
cd ./Pea_only
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
##rm *.txt
##rm *.fasta
cd ..
######################################
cd ./pea_saliva
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
filenames=*.fasta
for f in ${filenames}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${f} -out ${f}_aligned.fasta -maxiters 5000 -maxtrees 15"
echo ${cmd}
eval ${cmd}
wait
done
filenames2=*_aligned.fasta
for file in ${filenames2}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${file} -out ${file}_refine.fasta -refine"
echo ${cmd}
eval ${cmd}
wait
#rm -rf *_aligned.fasta
mkdir alignments
mv *_refine.fasta ./alignments
cd ./alignments
mkdir back_translated
python $HOME/scratch/clustering/Align_back_translate_Aug2014.py
wait
cd ..
#rm *.txt
#rm *.fasta
done
##rm *.txt
##rm *.fasta
cd ..
###############################################################################################################################################
cd ./RNAseq_clusters
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
mv *Cluster_catorgory_summary.out ../
filenames=*.fasta
for f in ${filenames}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${f} -out ${f}_aligned.fasta -maxiters 5000 -maxtrees 15"
echo ${cmd}
eval ${cmd}
wait
done
filenames2=*_aligned.fasta
for file in ${filenames2}
do
echo "Running muscle ${f}"
cmd="$HOME/Downloads/muscle3.8.31_i86linux64 -in ${file} -out ${file}_refine.fasta -refine"
echo ${cmd}
eval ${cmd}
wait
#rm -rf *_aligned.fasta
mkdir alignments
mv *_refine.fasta ./alignments
cd ./alignments
mkdir back_translated
python $HOME/scratch/clustering/Align_back_translate_Aug2014.py
wait
cd ..
#rm *.txt
#rm *.fasta
done
##rm *.txt
##rm *.txt
##rm *.fasta
cd ..
cd ./Rpadi_only
cp ~/misc_python/MCL_clusters_get_seq/get_CLUSTER_ANNOT_INFO_IN_Folder.py ./
python get_CLUSTER_ANNOT_INFO_IN_Folder.py
###################################################################################################################################
RBBH clustering:
python ~/misc_python/BLAST_output_parsing/Blast_RBH_two_fasta_file_evalue.py -a prot --threads 8 -t blastp A.pisum.AA.fasta M.cerasi.V1.AA.fasta -o A.pisum.AA_M.cerasi.V1.AA.tab
python ~/misc_python/BLAST_output_parsing/Blast_RBH_two_fasta_file_evalue.py -a prot --threads 8 -t blastp A.pisum.AA.fasta Rp.v1.AA.fasta -o A.pisum.AA_Rp.v1.AA.tab
python ~/misc_python/BLAST_output_parsing/Blast_RBH_two_fasta_file_evalue.py -a prot --threads 8 -t blastp A.pisum.AA.fasta Dnox.v1.AA.fasta -o A.pisum.AA_Dnox.v1.AA.tab
python ~/misc_python/BLAST_output_parsing/Blast_RBH_two_fasta_file_evalue.py -a prot --threads 8 -t blastp A.pisum.AA.fasta Mp_O_v1.AA.fasta -o A.pisum.AA_Mp_O_v1.AA.tab
#mc
python ~/misc_python/BLAST_output_parsing/Blast_RBH_two_fasta_file_evalue.py -a prot --threads 8 -t blastp M.cerasi.V1.AA.fasta Rp.v1.AA.fasta -o M.cerasi.V1.AA_Rp.v1.AA.tab
python ~/misc_python/BLAST_output_parsing/Blast_RBH_two_fasta_file_evalue.py -a prot --threads 8 -t blastp M.cerasi.V1.AA.fasta Dnox.v1.AA.fasta -o M.cerasi.V1.AA_Dnox.v1.AA.tab
python ~/misc_python/BLAST_output_parsing/Blast_RBH_two_fasta_file_evalue.py -a prot --threads 8 -t blastp M.cerasi.V1.AA.fasta Mp_O_v1.AA.fasta -o M.cerasi.V1.AA_Mp_O_v1.AA.tab
#RP
python ~/misc_python/BLAST_output_parsing/Blast_RBH_two_fasta_file_evalue.py -a prot --threads 8 -t blastp Rp.v1.AA.fasta Dnox.v1.AA.fasta -o Rp.v1.AA_Dnox.v1.AA.tab
python ~/misc_python/BLAST_output_parsing/Blast_RBH_two_fasta_file_evalue.py -a prot --threads 8 -t blastp Rp.v1.AA.fasta Mp_O_v1.AA.fasta -o Rp.v1.AA_Mp_O_v1.AA.tab