-
Notifications
You must be signed in to change notification settings - Fork 2
/
spemud_helper_flow_orthovar.php
70 lines (65 loc) · 2.77 KB
/
spemud_helper_flow_orthovar.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
<?php
define('IGNORE_HEADER', 'asd');
require ("header.php");
$spm_iframe = trim($_GET['spm']);
?>
<script type="text/javascript">
function errorView() {
return '<div class="card-panel blue"> <span class="white-text">Non-coding Ensembl transcripts (ENST) will not show up. For example, non-coding transcript ENST00000504290 (ENST) (such as TP53; ) will not appear in the ConVarT v.1.0 version. The ConVarT v.1.0 currently shows human variants from gnomAD, TOPMed, COSMIC, and ClinVar, all of which are mapped to the GRCh37/hg19 reference sequence. So those Ensembl transcripts (ENST) that are not available in GRCh37/hg19 will not show up. We will be moving to GRCh38 in the future.</span> </div><a href="#" class="btn waves-effect waves-light preResultBtnEmpty">No finding for this gene</a>';
}
function speciesView(transcriptsBySpecies) {
html = "";
for(species in transcriptsBySpecies) {
transcripts = transcriptsBySpecies[species];
if(transcripts.length == 0) continue;
html += `<div class="row"> <div class="pageTitle">Results in <i> ${species} </i> <hr></div> `;
html += transcriptView(transcripts);
html += `</div>`;
}
return html;
}
function transcriptView(transcripts) {
htmlTranscripts = ""
usedHumanGeneSymbols = {};
for(transcript of transcripts) {
humanGeneSymbol = transcript['human_homolog']['human_gene_symbol']
if(humanGeneSymbol in usedHumanGeneSymbols) continue
else usedHumanGeneSymbols[humanGeneSymbol] = true;
htmlTranscript = `<a target="_blank"
href="https://convart.org/search?spemud=${transcript['human_homolog']['human_gene_symbol']}"
class="btn waves-effect waves-light preResultBtn"
style="max-width:100%!important" >
<i>${transcript['gene_symbol']}</i> (${transcript['ncbi_gene_id']}) |
HUMAN ${transcript['human_homolog']['human_gene_symbol']}
- (${transcript['human_homolog']['human_gene_id']})
</a>`;
htmlTranscripts += htmlTranscript;
}
return htmlTranscripts;
}
$(document).ready ( function(){
$.get('api.php?action=orthovarhelp&query=' + "<?php echo $spm_iframe; ?>", function(data) {
data = JSON.parse(data);
if(data == null || data.length == 0) {
content = errorView();
} else {
content = speciesView(data);
}
$('#transcripts').html(content);
});
return false;
});
</script>
<!-- api.php?action=humansearch&query=<GENE SEARCH TEXT> -->
<!-- Human Homolog Searching Form -->
<div id="human-homolog-search">
<div class="row">
<form action="API" method="get" class="mainForm" autocomplete="off">
<div class="col s0 m0 l3"></div>
</form>
</div>
</div>
<hr>
<div class="container">
<div class="col s12 m12 l12" id="transcripts"> </div>
</div>