-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathresult2.php
executable file
·1599 lines (1463 loc) · 68.4 KB
/
result2.php
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
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
require_once("header.php");
require_once("db_connection.php");
require_once("functions.php");
// GET QUERY ID
$human_convart_id = $_REQUEST["human"];
$mouse_convart_id = $_REQUEST["mouse"];
$worm_convart_id = $_REQUEST["worm"];
$convart_id_list = array($human_convart_id, $mouse_convart_id, $worm_convart_id);
$convart_id_list = array_filter($convart_id_list);
sort($convart_id_list);
if ($human_convart_id == "" && $mouse_convart_id == "" && $worm_convart_id == "")
exit;
$str_convart_ids = implode(",", $convart_id_list);
#Get MSA
mysqli_query($db_connection, "SET profiling = 1;");
#echo $str_convart_ids;
$msaIdQuery = mysqli_query($db_connection, "SELECT GROUP_CONCAT(convart_gene_id) AS ids, msa_id FROM msa_gene GROUP BY msa_id HAVING ids = '$str_convart_ids' LIMIT 1");
if (mysqli_num_rows($msaIdQuery) == 0) {
$msaIdQuery = mysqli_query($db_connection, "SELECT GROUP_CONCAT(convart_gene_id) AS ids, msa_id FROM msa_gene GROUP BY msa_id HAVING ids = '$human_convart_id' LIMIT 1");
if (mysqli_num_rows($msaIdQuery) == 0) {
# Burayı sonra düzenle!!
echo '<div class="center-align card-panel blue "> <span class="white-text">The MSA could not be found! </span><br> <br><a href="https://convart.org" class="btn white blue-text">Go Back to Search Page</a> </div>';
exit();
}
}
$msa_id = (int) mysqli_fetch_assoc($msaIdQuery)["msa_id"];
$msa = getMSAById($msa_id);
$transcriptId = getTranscriptIdByConvartGeneId($human_convart_id);
$geneDetails = getGeneDetailsById($transcriptId);
$transcriptIdMouse = getProteinIdByConvartGeneIdMouse($mouse_convart_id);
$geneDetailsMouse = getGeneDetailsById($transcriptIdMouse);
$dbIds_mouse = explode(',', str_replace('"', '', $geneDetailsMouse['dbs']['NP']))[0];
$enstIdMouse = explode(',', str_replace('"', '', $geneDetailsMouse['dbs']['ENSMUST']))[0];
//$enstIdMouse = end(array_filter($dbIds, function ($x) {
// return strstr($x, 'ENS') !== FALSE;
//}));
//getGeneDetailsByENSTIdFromAPI($geneDetailsMouse, $enstIdMouse);
//$geneDetailsMouse['species_id'] = "Mus musculus";
//$ensembleIdMouse = $geneDetailsMouse['ENSG'];
//$geneDetailsMouse = getGeneDetailsById($ensembleIdMouse);
//$geneDetailsMouse['other_id'] = $ensembleIdMouse;
$geneIdMouse = $geneDetailsMouse['dbs']['NCBI'];
//$geneDetailsMouse = getGeneDetailsById($dbIds_mouse);
//if (!isset($geneDetailsMouse['gene_symbol']) or empty($geneDetailsMouse['gene_symbol'])) {
// $geneDetailsMouse = getGeneDetailsByENSTIdFromAPI($geneDetailsMouse, $enstIdMouse);
// $geneDetailsMouse['species_id'] = "Mus musculus";
//}
$transcriptIdWorm = getTranscriptIdByConvartGeneId($worm_convart_id);
$geneDetailsWorm = getGeneDetailsById($transcriptIdWorm);
$gnomADResult = "";
$ClinVarStatisticResult = "";
$geneInfo = [];
if ($geneDetails['species_id'] == 'Homo sapiens') {
$humanGeneDetails = $geneDetails;
$geneInfo['human_gene_id'] = $geneDetails['dbs']['NCBI'];
} else if (!empty($geneDetails['dbs']['NCBI'])) {
$geneInfo = getHumanHomolog($geneDetails['dbs']['NCBI']);
$humanGeneDetails = getGeneDetailsByConvartId($msa['human_convart_gene_id'], $geneInfo['human_gene_id']);
} else if ((empty($geneDetails['dbs']['NCBI']) || $geneDetails['dbs']['NCBI'] == '""')
&& strstr($transcriptId, 'ENST') !== false
) {
getGeneDetailsByENSTIdFromAPI($geneDetails, $transcriptId);
$newGeneDetails = getNCBIDetailsById($geneDetails['ENSG']);
$geneDetails['dbs']['ENST'] = explode('.', $transcriptId)[0];
$geneDetails = array_merge_recursive($geneDetails, $newGeneDetails);
$geneInfo['human_gene_id'] = $geneDetails['dbs']['NCBI'];
$humanGeneDetails = $geneDetails;
}
$geneDetails['dbs']['NCBI'] = @str_replace('"', '', $geneDetails['dbs']['NCBI']);
// $humanGeneVariants = searchProteinNumbers($geneInfo['human_gene_id'])['Homo sapiens'];
#echo microtime(true)-$start;
#$humanGeneVariants = array_filter($humanGeneVariants, function($x) {global $msa; return $x['transcript_id'] != $msa['human_convart_gene_id']; });
$geneId = str_replace("\"", "", $geneDetails['dbs']['NCBI']);
if (!isset($geneIdMouse) or empty($geneIdMouse)) {
$geneIdMouse = $geneDetailsMouse['ENSG'];
} else {
$geneIdMouse = str_replace("\"", "", $geneDetailsMouse['dbs']['NCBI']);
}
$geneIdWorm = str_replace("\"", "", $geneDetailsWorm['dbs']['NCBI']);
#Gene Other IDs for Gene Ontology Annotations
$other_idsHuman = explode(',', $geneDetails['other_id']);
$other_idHuman = $other_idsHuman[key(preg_grep('/ENSG/i', $other_idsHuman))];
$other_idsMouse = explode(',', $geneDetailsMouse['other_id']);
$other_idMouse = $other_idsMouse[key(preg_grep('/ENSMUSG/i', $other_idsMouse))];
$other_idsWorm = explode(',', $geneDetailsWorm['other_id']);
$other_idWorm = $other_idsWorm[key(preg_grep('/WB/i', $other_idsWorm))];
if ($msa == null) {
header("Location: index.php?err=no_result");
exit();
}
#ClinVar
#$clinVarQuery = getClinvarData(@$humanGeneDetails['dbs']['NM'], 'nm_id');
#gnomAD
if (isset($humanGeneDetails['dbs']['ENST'])) {
#$gnomadQuery = getGnomADData($humanGeneDetails['dbs']['ENST']);
}
#Domains
if (isset($convart_id_list)) {
$domain_list = $human_convart_id;
if (isset($mouse_convart_id)) {
$domain_list .= "," . $mouse_convart_id;
}
if (isset($worm_convart_id)) {
$domain_list .= "," . $worm_convart_id;
}
$domainsQuery = getProteinDomains($domain_list);
}
#AlphaFold2
if (isset($convart_id_list)) {
$uniprot_list['human'] = getUniprotIdByConvartId($human_convart_id);
if (isset($mouse_convart_id)) {
$uniprot_list['mouse'] = getUniprotIdByConvartId($mouse_convart_id);
}
if (isset($worm_convart_id)) {
$uniprot_list['worm'] = getUniprotIdByConvartId($worm_convart_id);
}
}
#Statistics ClinVar
if (isset($humanGeneDetails['dbs']['NP'])) {
$clinVarCounts = getClinvarStatsBySignificance($humanGeneDetails['dbs']['NP'], 'np_id');
} else {
$clinVarCounts = [];
}
#Statistics gnomAD
if (isset($humanGeneDetails['dbs']['ENST'])) {
$gnomADCounts = getgnomADStats($humanGeneDetails['dbs']['ENST']);
} else {
$gnomADCounts = [];
}
#Statistics PTM
if (isset($humanGeneDetails['dbs']['UNIPROT'])) {
$ptmCounts = getPTMStats($humanGeneDetails['dbs']['UNIPROT']);
} else {
$ptmCounts = [];
}
#Statistics dbSNP
if (isset($humanGeneDetails['dbs']['ENST'])) {
$dbSNPCounts = getdbSNPStats(@$humanGeneDetails['dbs']['ENST']);
} else {
$dbSNPCounts = [];
}
#Statistics TopMed
if (isset($humanGeneDetails['dbs']['ENST'])) {
$TopMedCounts = getTopMedStats(@$humanGeneDetails['dbs']['ENST']);
} else {
$TopMedCounts = 0;
}
#Statistics COSMIC
if (isset($humanGeneDetails['dbs']['ENST'])) {
$cosmicCounts = getCosmicStats(@$humanGeneDetails['dbs']['ENST']);
} else {
$cosmicCounts = [];
}
if (!empty($clinVarCounts)) {
$dynamicChartTitle = 'ClinVar Pathogenicity of Variations';
$dynamicChart = 'clinvar';
} elseif (!empty($ptmCounts)) {
$dynamicChartTitle = 'Post translational modifications (PTM) by Type';
$dynamicChart = 'ptm';
} elseif (!empty($gnomADCounts)) {
$dynamicChartTitle = 'gnomAD Variants By Annotation';
$dynamicChart = 'gnomad';
} elseif (!empty($cosmicCounts)) {
$dynamicChartTitle = 'COSMIC Variants By Annotation';
$dynamicChart = 'cosmic';
} elseif (!empty($dbSNPCounts)) {
$dynamicChartTitle = 'dbSNP Variants By Annotation';
$dynamicChart = 'dbSNP';
}
#Disease Finder
if (isset($humanGeneDetails['dbs']['NCBI'])) {
$DiseaseQuery = diseaseFind(str_replace('"', '', $humanGeneDetails['dbs']['NCBI']));
} else {
$DiseaseQuery = [];
}
$query = mysqli_query($db_connection, "SHOW PROFILES;");
if ($_GET['test']) {
while ($row = mysqli_fetch_assoc($query)) {
print_R($row);
echo "<br>";
}
}
?>
<!-- Current Project | Tables and Other Components -->
<div class="row TablesContainer" style="position:relative; margin-left: 15%;">
<div class="col s1 m1 l1" style="
position: fixed;
left: 15px;
height:75%;
width: 13.5%;
overflow: scroll;
/* top: 0; */
" id="table-of-contents">
</div>
<!-- Current Project Tool -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">format_align_center</i>ConVarT</div>
<div class="collapsible-body">
<div class="row resultGeneBox">
<!-- Current Project | Result Box - Gene Card -->
<div class="col s12 m12 l6" style="overflow: auto;">
<div class="result_title blue_color"><i><?= $geneDetails['gene_symbol'] ? printify($geneDetails['gene_symbol']) : $transcriptId; ?></i> (GeneID: <?= $geneId; ?>) | <?= ucfirst($geneDetails['species_id']); ?></div>
<table class="gene_info_table">
<?php if (isset($geneDetails['gene_description'])) : ?>
<tr>
<td><b>Description:</b></td>
<td><?= printify($geneDetails['gene_description']); ?></td>
</tr>
<?php endif; ?>
<tr>
<td><b>Synonyms:</b></td>
<td><i> <?= printify($geneDetails['gene_synonym']); ?></i></td>
</tr>
<tr>
<td><b>Other ID(s):</b></td>
<td><?= linkify(@$geneDetails['other_id']); ?></td>
</tr>
<tr>
<td><b>Protein Accession Numbers:</b></td>
<td><?= linkify(@$geneDetails['protein_number']); ?></td>
</tr>
<tr>
<td><b>Statistics: </b> </td>
<td><?php if (array_sum($clinVarCounts)) : ?> ClinVar(<b><?= array_sum($clinVarCounts); ?></b>)<?php endif; ?>
<?php if (array_sum($gnomADCounts) > 0) : ?> gnomAD(<b><?= array_sum($gnomADCounts); ?></b>)<?php endif; ?>
<?php if (array_sum($cosmicCounts) > 0) : ?> COSMIC(<b><?= array_sum($cosmicCounts); ?></b>)<?php endif; ?>
<?php if (array_sum($dbSNPCounts) > 0) : ?> dbSNP(<b><?= array_sum($dbSNPCounts); ?></b>)<?php endif; ?>
<?php if (array_sum($ptmCounts) > 0) : ?> PTM(<b><?= array_sum($ptmCounts); ?></b>)<?php endif; ?>
<?php if ($TopMedCounts > 0) : ?> TopMed(<b><?= $TopMedCounts; ?></b>)<?php endif; ?>
</td>
</tr>
</table>
</div>
<!-- Current Project | Statistics -->
<div class="col s12 m12 l6">
<div class="result_title blue_color">
<b><?= $dynamicChartTitle; ?></b>
<?php if ($dynamicChart == 'clinvar') : ?>
<a href="#clinical_significance_classification_help" class="modal-trigger tooltipped" data-position="right" data-delay="10" data-tooltip="Classification of Clinicial Significance of ClinVar Data"><i class="material-icons blue-text text-darken-1">help</i></a>
<?php endif; ?>
</div>
<div id="dynamic_chart"></div>
</div>
</div> <!-- end of gene card -->
<iframe id="CurrentProjectTool2" src="tool.php?msa_id=<?= $msa_id; ?>&human=<?= $_GET['human']; ?>&mouse=<?= $_GET['mouse']; ?>&worm=<?= $_GET['worm']; ?>&version=2" width="96%" style="min-height:430px; height:auto !important" frameborder="0"></iframe>
<p>
∙ Conservation scores are calculated by (number of aminoacids that matches between Human & the compared species ) / (aminoacid count in the human gene)
<br>
∙ Please click the name of species for the protein accession number used in the alignment.
<br>∙ A <span style="color:#52b5f1;font-weight:bold">p</span> letter used as a pointer to positions of post translational modifications in human.
<br>∙ A <span style="color:black;font-weight:bold">⁑</span> double asterisk showing orthologous variants between human, mouse and C. elegans.
<br>∙ A <span style="color:black;font-weight:bold">✳</span> single asterisk displaying phenotypic variants from mouse and C. elegans.
<br>∙ Protein domains illustrated above belong to <i>Homo sapiens</i> (Human).
<!-- <br>∙ ClinVar stacked bar chart represents whole protein isoforms of the gene. Please, check the other protein isoforms of the gene: -->
<br>
</p>
</div>
<br>
</div>
<!-- Gene Info --->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">info</i>Gene Info</div>
<div class="collapsible-body">
<!-- Current Project | Result Box - Gene Card -->
<table class="gene_info_table">
<tr>
<td colspan="2">
<div class="result_title blue_color"><i><?= $geneDetails['gene_symbol'] ? printify($geneDetails['gene_symbol']) : $transcriptId; ?></i> (GeneID: <?= $geneId; ?>) | <?= ucfirst($geneDetails['species_id']); ?></div>
</td>
</tr>
<?php if (isset($geneDetails['gene_description'])) : ?>
<tr>
<td><b>Description:</b></td>
<td><?= printify($geneDetails['gene_description']); ?></td>
</tr>
<?php endif; ?>
<tr>
<td><b>Synonyms:</b></td>
<td><i> <?= printify($geneDetails['gene_synonym']); ?></i></td>
</tr>
<tr>
<td><b>Other ID(s):</b></td>
<td><?= linkify(@$geneDetails['other_id']); ?></td>
</tr>
<tr>
<td><b>Protein Accession Numbers:</b></td>
<td><?= linkify(@$geneDetails['protein_number']); ?></td>
</tr>
<tr>
<td><b>AlphaFold 3D Structure:</b></td>
<td><?= linkifyUniprot(@$uniprot_list['human']); ?></td>
</tr>
<tr>
<td><b>Statistics: </b> </td>
<td><?php if (array_sum($clinVarCounts)) : ?> ClinVar(<b><?= array_sum($clinVarCounts); ?></b>)<?php endif; ?>
<?php if (array_sum($gnomADCounts) > 0) : ?> gnomAD(<b><?= array_sum($gnomADCounts); ?></b>)<?php endif; ?>
<?php if (array_sum($cosmicCounts) > 0) : ?> COSMIC(<b><?= array_sum($cosmicCounts); ?></b>)<?php endif; ?>
<?php if (array_sum($dbSNPCounts) > 0) : ?> dbSNP(<b><?= array_sum($dbSNPCounts); ?></b>)<?php endif; ?>
<?php if (array_sum($ptmCounts) > 0) : ?> PTM(<b><?= array_sum($ptmCounts); ?></b>)<?php endif; ?>
<?php if ($TopMedCounts > 0) : ?> TopMed(<b><?= $TopMedCounts; ?></b>)<?php endif; ?>
</td>
</tr>
<tr>
<td colspan="2">
<div class="result_title blue_color"><i><?= $geneDetailsMouse['gene_symbol'] ? printify($geneDetailsMouse['gene_symbol']) : $transcriptIdMouse; ?></i> (GeneID: <?= $geneIdMouse; ?>) | <?= ucfirst($geneDetailsMouse['species_id']); ?></div>
</td>
</tr>
<?php if (isset($geneDetailsMouse['gene_description'])) : ?>
<tr>
<td><b>Description:</b></td>
<td><?= printify($geneDetailsMouse['gene_description']); ?></td>
</tr>
<?php endif; ?>
<tr>
<td><b>Synonyms:</b></td>
<td><i> <?= printify($geneDetailsMouse['gene_synonym']); ?></i></td>
</tr>
<tr>
<td><b>Other ID(s):</b></td>
<td><?= linkify(@$geneDetailsMouse['other_id']); ?></td>
</tr>
<tr>
<td><b>Protein Accession Numbers:</b></td>
<td><?= linkify(@$geneDetailsMouse['protein_number']); ?></td>
</tr>
<tr>
<td><b>AlphaFold 3D Structure:</b></td>
<td><?= linkifyUniprot(@$uniprot_list['mouse']); ?></td>
</tr>
<tr>
<td colspan="2">
<div class="result_title blue_color"><i><?= $geneDetailsWorm['gene_symbol'] ? printify($geneDetailsWorm['gene_symbol']) : $transcriptIdWorm; ?></i> (GeneID: <?= $geneIdWorm; ?>) | <?= ucfirst($geneDetailsWorm['species_id']); ?></div>
</td>
</tr>
<?php if (isset($geneDetailsWorm['gene_description'])) : ?>
<tr>
<td><b>Description:</b></td>
<td><?= printify($geneDetailsWorm['gene_description']); ?></td>
</tr>
<?php endif; ?>
<tr>
<td><b>Synonyms:</b></td>
<td><i> <?= printify($geneDetailsWorm['gene_synonym']); ?></i></td>
</tr>
<tr>
<td><b>Other ID(s):</b></td>
<td><?= linkify(@$geneDetailsWorm['other_id']); ?></td>
</tr>
<tr>
<td><b>Protein Accession Numbers:</b></td>
<td><?= linkify(@$geneDetailsWorm['protein_number']); ?></td>
</tr>
<tr>
<td><b>AlphaFold 3D Structure:</b></td>
<td><?= linkifyUniprot(@$uniprot_list['worm']); ?></td>
</tr>
</table>
</div>
<br>
</div>
<!-- GO Annotation Table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">import_contacts</i>Gene Ontology Annotations</div>
<div class="collapsible-body">
<div id="go_annotation_chart"></div>
<div class="table-wrapper">
<table id="go_annotationTable" class="special_table hide">
<thead>
<tr>
<th>GO Term Accession <i class="material-icons right">filter_list</i></th>
<th>Organism <i class="material-icons right">filter_list</i></th>
<th>GO Domain <i class="material-icons right">filter_list</i></th>
<th>GO Term Name <i class="material-icons right">filter_list</i></th>
<th>Definition <i class="material-icons right">filter_list</i></th>
<th>GO Term Evidence Code <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><br>
</div>
<!-- ClinVar Table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">import_contacts</i>ClinVar Data <a href="#clinical_significance_classification_help" class="modal-trigger tooltipped" data-position="right" data-delay="10" data-tooltip="Classification of Clinicial Significance of ClinVar Data"><i class="material-icons white-text text-darken-1">help</i></a></div>
<div class="collapsible-body">
<div id="clinvar_chart"></div>
<div class="table-wrapper">
<table id="ClinVarTable" class="special_table hide">
<thead>
<tr>
<th>Variation ID <i class="material-icons right">filter_list</i></th>
<th>Allele ID <i class="material-icons right">filter_list</i></th>
<th>RS Number <i class="material-icons right">filter_list</i></th>
<th>Variant Type <i class="material-icons right">filter_list</i></th>
<th>Record <i class="material-icons right">filter_list</i></th>
<th>Alteration <i class="material-icons right">filter_list</i></th>
<th>Clinicial Sig. <i class="material-icons right">filter_list</i></th>
<th>Phenotypes <i class="material-icons right">filter_list</i></th>
<th>Review Status <i class="material-icons right">filter_list</i></th>
<th>RCV Acc.N. <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div>
</div>
<br>
</div>
<!-- gnomAD table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">healing</i>gnomAD</div>
<div class="collapsible-body">
<div id="gnomad_chart"></div>
<div class="table-wrapper">
<table id="gnomADtable" class="special_table hide">
<thead>
<tr>
<th>Variant ID <i class="material-icons right">filter_list</i></th>
<th>Transcript ID <i class="material-icons right">filter_list</i></th>
<th>Alteration <i class="material-icons right">filter_list</i></th>
<th>Annotation <i class="material-icons right">filter_list</i></th>
<th>Allele C. <i class="material-icons right">filter_list</i></th>
<th>Allele N. <i class="material-icons right">filter_list</i></th>
<th>Allele F. <i class="material-icons right">filter_list</i></th>
<th>rsNumber <i class="material-icons right">filter_list</i></th>
<th>Flags<i class="material-icons right">filter_list</i></th>
<th>Filter <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><br>
</div>
<!-- PTM table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">place</i>Post-translational Modifications (PTMs)</div>
<div class="collapsible-body">
<div id="ptm_chart"></div>
<div class="table-wrapper">
<table id="ptmTable" class="special_table hide">
<thead>
<tr>
<th>Gene Name <i class="material-icons right">filter_list</i></th>
<th>ACC ID <i class="material-icons right">filter_list</i></th>
<th>PTM Type <i class="material-icons right">filter_list</i></th>
<th>Position <i class="material-icons right">filter_list</i></th>
<th>Mod-rsd <i class="material-icons right">filter_list</i></th>
<th>Site +/-7 Aa <i class="material-icons right">filter_list</i></th>
<th>Mw_kd <i class="material-icons right">filter_list</i></th>
<th>Site grpID <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><br>
</div>
<!-- COSMIC table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">blur_on</i>Catalogue of Somatic Mutations in Cancer (COSMIC)</div>
<div class="collapsible-body">
<div id="cosmic_chart"></div>
<div class="table-wrapper">
<table id="cosmicTable" class="special_table hide">
<thead>
<tr>
<th>Gene Name <i class="material-icons right">filter_list</i></th>
<th>Transcript ID <i class="material-icons right">filter_list</i></th>
<th>Sample name <i class="material-icons right">filter_list</i></th>
<th>Primary Site <i class="material-icons right">filter_list</i></th>
<th>Primary Histology <i class="material-icons right">filter_list</i></th>
<th>Mutation ID <i class="material-icons right">filter_list</i></th>
<th>Mutation CDS <i class="material-icons right">filter_list</i></th>
<th>Mutation Aa <i class="material-icons right">filter_list</i></th>
<th>Mutation Desc. <i class="material-icons right">filter_list</i></th>
<th>FATHMM Prediction <i class="material-icons right">filter_list</i></th>
<th>FATHMM Score <i class="material-icons right">filter_list</i></th>
<th>Mutation Somatic Status <i class="material-icons right">filter_list</i></th>
<th>PUBMED PMID <i class="material-icons right">filter_list</i></th>
<th>Tumor Origin <i class="material-icons right">filter_list</i></th>
<th>Position <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><br>
</div>
<!-- Community Table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">import_contacts</i>Community Data </div>
<div class="collapsible-body">
<div class="table-wrapper">
<table id="CommunityTable" class="special_table hide">
<thead>
<tr>
<th>Contributor <i class="material-icons right">filter_list</i></th>
<th>Organization <i class="material-icons right">filter_list</i></th>
<th>Organism <i class="material-icons right">filter_list</i></th>
<th>Protein ID <i class="material-icons right">filter_list</i></th>
<th>Position <i class="material-icons right">filter_list</i></th>
<th>Aa Change <i class="material-icons right">filter_list</i></th>
<th>Phenotype <i class="material-icons right">filter_list</i></th>
<th>Impact <i class="material-icons right">filter_list</i></th>
<th>Consequence <i class="material-icons right">filter_list</i></th>
<th>Source <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table></div>
</div>
<br></div>
<!-- TopMed table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">chrome_reader_mode</i>TopMed</div>
<div class="collapsible-body">
<div id="TopMed_chart"></div>
<div class="table-wrapper">
<table id="TopMedTable" class="special_table hide">
<thead>
<tr>
<th>Gene ID <i class="material-icons right">filter_list</i></th>
<th>Transcript ID <i class="material-icons right">filter_list</i></th>
<th>Variant Type <i class="material-icons right">filter_list</i></th>
<th>Position <i class="material-icons right">filter_list</i></th>
<th>Variation <i class="material-icons right">filter_list</i></th>
<th>SIFT <i class="material-icons right">filter_list</i></th>
<th>PolyPhen <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><br>
</div>
<!-- dbSNP table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">chrome_reader_mode</i>dbSNP</div>
<div class="collapsible-body">
<div id="dbSNP_chart"></div>
<div class="table-wrapper">
<table id="dbSNPTable" class="special_table hide">
<thead>
<tr>
<th>Gene ID <i class="material-icons right">filter_list</i></th>
<th>Transcript ID <i class="material-icons right">filter_list</i></th>
<th>Consequence <i class="material-icons right">filter_list</i></th>
<th>Position <i class="material-icons right">filter_list</i></th>
<th>HGVSp <i class="material-icons right">filter_list</i></th>
<th>Impact <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><br>
</div>
<!-- Mouse Variants table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">healing</i>Mouse Variants</div>
<div class="collapsible-body">
<div id="mouseVariants_chart"></div>
<div class="table-wrapper">
<table id="mouseVariantsTable" class="special_table hide">
<thead>
<tr>
<th>Variation ID <i class="material-icons right">filter_list</i></th>
<th>Gene Name <i class="material-icons right">filter_list</i></th>
<th>Phenotype <i class="material-icons right">filter_list</i></th>
<th>Change <i class="material-icons right">filter_list</i></th>
<th>RefSeq ID <i class="material-icons right">filter_list</i></th>
<th>Position <i class="material-icons right">filter_list</i></th>
<th>Phenotypic Significance <i class="material-icons right">filter_list</i></th>
<th>Source <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><br>
</div>
<!-- C.elegans variants table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">healing</i>C elegans Variants</div>
<div class="collapsible-body">
<div id="cel_chart"></div>
<div class="table-wrapper">
<table id="celTable" class="special_table hide">
<thead>
<tr>
<th>Variation ID <i class="material-icons right">filter_list</i></th>
<th>Gene Name <i class="material-icons right">filter_list</i></th>
<th>Phenotypic Significance <i class="material-icons right">filter_list</i></th>
<th>RefSeq ID <i class="material-icons right">filter_list</i></th>
<th>Change <i class="material-icons right">filter_list</i></th>
<th>Position <i class="material-icons right">filter_list</i></th>
<th>Phenotype <i class="material-icons right">filter_list</i></th>
<th>Source <i class="material-icons right">filter_list</i></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><br>
</div>
<!-- Domains Table -->
<div class="col s12 m12 l12">
<div class="collapsible-header active"><i class="material-icons">format_align_center</i>Protein Domains (PFAM)</div>
<div class="collapsible-body">
<div class="table-wrapper">
<table id="DomainTable" class="special_table">
<tbody>
<tr>
<th>Pfam Domain <i class="material-icons right">filter_list</i></th>
<th>Domain Name <i class="material-icons right">filter_list</i></th>
<th>Description <i class="material-icons right">filter_list</i></th>
<th>Positions <i class="material-icons right">filter_list</i></th>
<th>Clan <i class="material-icons right">filter_list</i></th>
<th>Clan Name <i class="material-icons right">filter_list</i></th>
<th>Organism <i class="material-icons right">filter_list</i></th>
</tr>
<tr id="noResultQS_domains" class="grey">
<td colspan="7"><span class="flow-text white-text center">NO RESULT FOUND</span></td>
</tr>
<?php if ($domainsQuery == null) : ?>
<tr>
<td colspan="7" class="grey"><span class="flow-text white-text center">NO DOMAINS EXIST</span></td>
</tr>
<?php
else :
while ($row = mysqli_fetch_array($domainsQuery)) : ?>
<tr class="list-domain">
<td><a href="https://pfam.xfam.org/family/<?= $row['pfam_domain_id']; ?>" target="_blank">
<?= $row['pfam_domain_id']; ?></a></td>
<td><?= $row['domain_name']; ?></td>
<td><?= $row['domain_desc']; ?></td>
<td><?= $row['start_point'] . '-' . $row['end_point']; ?></td>
<td><a href="https://pfam.xfam.org/clan/<?= $row['clan_id']; ?>" target="_blank"><?= $row['clan_id']; ?></a></td>
<td><?= $row['clan_name']; ?></td>
<td><?= $row['organism']; ?></td>
</tr>
<?php endwhile; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<br>
</div>
<!-- Diseases and Genes Table -->
<div class="col s12 m12 l12">
<!-- <div class="collapsible-header active"><i class="material-icons">view_list</i>Diseases for Human Homolog (<?= strstr(printify($humanGeneDetails['gene_symbol']), ',', true); ?>) of the Gene (<?= printify($geneDetails['gene_symbol']); ?> - <?= ucfirst($geneDetails['species_id']); ?>)</div> -->
<div class="collapsible-header active"><i class="material-icons">view_list</i>List of the diseases from DisGeNET</div>
<div class="collapsible-body">
<center><input type="text" class="quick_search" id="quick_search_diseases" placeholder="Search in the table "></center>
<div class="table-wrapper">
<table id="DiseasesTable" class="special_table">
<tbody>
<tr>
<!-- <th>Gene Symbol <i class="material-icons right">filter_list</i></th> -->
<th>Disease Name <i class="material-icons right">filter_list</i></th>
<th width="350">Disease Category <i class="material-icons right">filter_list</i></th>
<th>DSI* <i class="material-icons right">filter_list</i></th>
<th>DPI** <i class="material-icons right">filter_list</i></th>
</tr>
<?php if ($DiseaseQuery == null) : ?>
<tr>
<td class="grey" colspan="6"><span class="flow-text white-text center">NO RESULT FOUND</span></td>
</tr>
<?php
else :
while ($row = mysqli_fetch_array($DiseaseQuery)) :
$raw_category = $row['category'];
if (empty($raw_category) == false) {
$array_raw_category = explode(";", $raw_category);
$category = "";
foreach ($array_raw_category as $cat_id) {
$category .= $disease_cat_mapping[$cat_id] . "; ";
}
} else {
$category = "N/A";
}
?>
<tr class="list-dis-gene">
<!-- <td><?= strstr(printify($humanGeneDetails['gene_symbol']), ',', true); ?></td> -->
<td><?= $row['disease_name']; ?></td>
<td><?= $category; ?></td>
<td><?= $row['dsi']; ?></td>
<td><?= $row['dpi']; ?></td>
</tr>
<?php endwhile; ?>
<?php endif; ?>
<tr id="noResultQS_diseases" class="grey">
<td colspan="6"><span class="flow-text white-text center">NO RESULT FOUND</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div> <!-- end of tables -->
<!-- Modal Structure -->
<div id="clinical_significance_classification_help" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Classification of Clinicial Significance of ClinVar Data</h4>
<p>
<?php
foreach ($clinicalSignificanceMapping as $category => $significances) {
echo "<b>" . $category . "</b><br>";
foreach ($significances as $significance) {
echo $significance . "<br>";
}
}
?>
</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-white btn-flat blue white-text">Agree</a>
</div>
</div>
<!-- Tool Pop-Up -->
<div id="PopUpTool" class="modal modal-fixed-footer" style="width: 90% !important; height: 60% !important">
<div class="modal-content">
<iframe id="CurrentProjectTool" src="<?= $GLOBALS['base_url']; ?>tool.php?msa_id=<?= $msa_id; ?>&human=<?= $_GET['human']; ?>&mouse=<?= $_GET['mouse']; ?>&worm=<?= $_GET['worm']; ?>" width="96%" style="min-height:390px; height:auto !important" frameborder="0"></iframe>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-white btn-flat blue white-text">CLOSE</a>
</div>
</div>
<!-- Current Project | FeedBack -->
<div class="fixed-action-btn"> <a class="btn-floating btn-large waves-effect waves-light blue tooltipped modal-trigger" href="https://forms.gle/U5WwH4SdCsYSmi9C7" target="_blank" data-position="left" data-delay="0" data-tooltip="Send a feedback about the results."> <i class="large material-icons">feedback</i></a></div>
<!-- Linking from Table to Viewer -->
<script type="text/javascript">
$('.modal').modal({
inDuration: 0,
outDuration: 0,
fadeDuration: 100
});
$('select').material_select();
var event = new Event('mouseover');
if (!Element.prototype.scrollIntoViewIfNeeded) {
Element.prototype.scrollIntoViewIfNeeded = function(centerIfNeeded) {
centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded;
var parent = this.parentNode,
parentComputedStyle = window.getComputedStyle(parent, null),
parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue('border-top-width')),
parentBorderLeftWidth = parseInt(parentComputedStyle.getPropertyValue('border-left-width')),
overTop = this.offsetTop - parent.offsetTop < parent.scrollTop,
overBottom = (this.offsetTop - parent.offsetTop + this.clientHeight - parentBorderTopWidth) > (parent.scrollTop + parent.clientHeight),
overLeft = this.offsetLeft - parent.offsetLeft < parent.scrollLeft,
overRight = (this.offsetLeft - parent.offsetLeft + this.clientWidth - parentBorderLeftWidth) > (parent.scrollLeft + parent.clientWidth),
alignWithTop = overTop && !overBottom;
if ((overTop || overBottom) && centerIfNeeded) {
parent.scrollTop = this.offsetTop - parent.offsetTop - parent.clientHeight / 2 - parentBorderTopWidth + this.clientHeight / 2;
}
if ((overLeft || overRight) && centerIfNeeded) {
parent.scrollLeft = this.offsetLeft - parent.offsetLeft - parent.clientWidth / 2 - parentBorderLeftWidth + this.clientWidth / 2;
}
if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) {
this.scrollIntoView(alignWithTop);
}
};
}
function goToVariation(protein, position) {
$('#PopUpTool').modal('open');
var iframe = document.getElementById("CurrentProjectTool");
iframe.scrollIntoViewIfNeeded();
var iframeWindow = iframe.contentWindow;
var iframeDocument = iframe.contentDocument;
var viewportPosition = iframeWindow.viewer.getAminoacidPositionInViewport(protein, position - 1);
//$(iframeDocument).find('#CurrentProjectTool').scrollLeft(viewportPosition*20 - iframe.clientWidth/2);
$(iframeDocument).find('input[name=position]').val(position);
iframe.contentWindow.document.getElementById("CurrentProjectTool-species-select").selectedIndex = protein;
$(iframeDocument).find("CurrentProjectTool-species-select").selectedIndex = protein;
iframeWindow.viewer.positionKeyUp();
setTimeout(function() {
iframeWindow.viewer.showVariation(protein, position - 1);
}, 125);
}
</script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.18/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/scroller/2.0.0/js/dataTables.scroller.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.18/css/jquery.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/scroller/2.0.0/css/scroller.dataTables.min.css">
<script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
<!-- Tables -->
<script type="text/javascript">
$(document).ready(function() {
<?php if (isset($humanGeneDetails['dbs']['NP'])) : ?>
// ClinVar Table
$('#ClinVarTable').DataTable({
"processing": true,
"serverSide": true,
"searchable": true,
"pageLength": 20,
"searchDelay": 600,
<?php if (isset($humanGeneDetails['dbs']['NP'])) : ?> "ajax": {
"url": "<?= $GLOBALS['base_url']; ?>/api.php?action=clinvar&id=<?= urlencode(normalizeIds($humanGeneDetails['dbs']['NP'])); ?>",
"type": "GET"
},
<?php endif; ?> "deferRender": true,
"columnDefs": [{
"targets": 5,
"render": function(data, type, row) {
var position = data.split('---')[1];
data = data.split('---')[0];
return '<a class="variation-link" onclick="goToVariation(0, ' + position + ')">' + data + '</a>';
},
"defaultContent": "<button>Click!</button>"
}, {
"targets": 2,
"render": function(data, type, row) {
if (data == "N/A") {
rs_link = "#";
rs_target = "_top";
} else {
rs_link = "https://www.ncbi.nlm.nih.gov/clinvar/?term=" + data;
rs_target = "_blank";
}
return '<a class="variation-link" href="' + rs_link + '" target="' + rs_target + '">' + data + '</a>';
},
"defaultContent": "<button>Click!</button>"
}],
language: {
searchPlaceholder: "Search in the table",
search: "",
processing: '<i class="fa fa-spinner fa-spin fa-3x fa-fw"></i><span class="sr-only">Loading...</span> '
}
});
$('#ClinVarTable').removeClass('hide');
<?php else : ?>
$('#ClinVarTable').parent().parent().parent().hide();
<?php endif; ?>
//gnomAD Table
$('#gnomADtable').DataTable({
"processing": false,
"serverSide": false,
"pageLength": 20,
<?php if (isset($humanGeneDetails['dbs']['ENST'])) : ?> "ajax": "<?= $GLOBALS['base_url']; ?>/api.php?action=gnomad&id=<?= urlencode(normalizeIds($humanGeneDetails['dbs']['ENST'])); ?>",
<?php endif; ?> "columnDefs": [{
"targets": 0,
"render": function(data, type, row) {
return '<a class="variation-link" target="_blank" href="https://gnomad.broadinstitute.org/variant/' + data + '">' + data + '</a>';
},
"defaultContent": "<button>Click!</button>"
}, {
"targets": 1,
"render": function(data, type, row) {
return '<a class="variation-link" target="_blank" href="https://www.ensembl.org/id/' + data + '">' + data + '</a>';
},
"defaultContent": "<button>Click!</button>"
}, {
"targets": 2,
"render": function(data, type, row) {
var position = data.split('---')[1];
data = data.split('---')[0];
return '<a class="variation-link" onclick="goToVariation(0, ' + position + ')">' + data + '</a>';
},
"defaultContent": "<button>Click!</button>"
}],
"deferRender": true,
language: {
searchPlaceholder: "Search in the table",
search: ""
}
});
$('#gnomADtable').removeClass('hide');
//GO Annotation Table
$('#go_annotationTable').DataTable( {
"processing": false,
"serverSide": false,
"pageLength": 20,
<?php if (isset($other_idHuman) || isset($other_idMouse) || isset($other_idWorm)) : ?>
"ajax": "<?= $GLOBALS['base_url']; ?>/api.php?action=go_annotation&id=<?= "%22",urlencode($other_idHuman),"%22,%22", urlencode($other_idMouse), "%22,%22",urlencode($other_idWorm),"%22"; ?>",
<?php endif; ?>
"columnDefs": [{
"targets": 0,
"render": function(data,type,row) {
return '<a class="go-accession-link" target="_blank" href="http://amigo.geneontology.org/amigo/term/' + data + '">' + data + '</a>';
},
"defaultContent": "<button>Click!</button>"
}, {
"targets": 2,
"render": function(data, type, row) {
data = data.split('_')
data = data[0] + " " + data[1];
return '<p class="go-domain">' + data + '</p>';