forked from cropgeeks/eorna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgene.cgi
executable file
·189 lines (136 loc) · 9.03 KB
/
gene.cgi
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
#!/usr/bin/perl
use barleyrtd_wrapper;
use eorna;
use CGI;
use GD;
use strict;
my $cgi_query = CGI->new();
my $gene_name = $cgi_query->param("seq_name");
my $dataset = $cgi_query->param("dataset");
my $image_dir = "/var/www/html/barleyrtd-new/blast_net_images";
print "Content-type: text/html\n\n";
my $db_query = barleyrtd_wrapper->new('efish_genomics');
#Get the contig that this gene is from
my ($contig_id) = $db_query->{'dbh'}->
selectrow_array("select contig_id from transcript_sequences where gene_id = '$gene_name' and dataset_name=\'$dataset\'");
my ($contig_length) = $db_query->{'dbh'}->
selectrow_array("select seq_length from genomic_sequences where contig_id = '$contig_id' and dataset_name=\'$dataset\'");
if ($contig_id eq ""){
eorna::printHeader("Error");
print "<div class='container-fluid'>
<div class='row'>
<nav class='col-md-2 d-none d-md-block grey sidebar'>
<div class='sidebar-sticky'>
<ul class='nav flex-column'>
<li class='nav-item nav-link' id='nav-title'><img class='img-fluid' src='images/eorna-logo.png' width=150'><span class='app-title'>EoRNA</span></li>
<li class='nav-item nav-link' id='nav-header'><b>Utilities Menu</b></li>
<div class='list-group'>
<li class='nav-item'><a class='nav-link active' href='index.html'>Home</a></li>
<li class='nav-item'><a class='nav-link' href='blast.html'>Homology Search</a></li>
<li class='nav-item'><a class='nav-link' href='keyword.html'>Annotation Search</a></li>
<li class='nav-item'><a class='nav-link' href='download.html'>Bulk Data Download</a></li>
<li class='nav-item'><a class='nav-link' href='bart_lookup.html'>Translate HORVU to BART IDs</a></li>
<li class='nav-item'><a class='nav-link' href='go.html'>GO Enrichment</a></li>
</div>
</ul>
</div>
</nav>
<main role='main' class='col-md-9 ml-sm-auto col-lg-10 pt-3 px-4'>
<div class='data-header'>Error Message</div>
<br>
<div class='data-body'>\n
<span class='error'>There are no genes in the database with ID \"$gene_name\". <br>Please enter a valid sequence identifier for the search.</span><br><br>
<div class='card-deck m-3'>
<div class='card border-dark'>
<div class='card-header option-header'>Search for a Sequence by ID</div>
<div class='card-body'>
<p><b>Barley RTD</b> : The predicted genes have the nomenclature 'BART1_0-u00001'. Transcript models are named after the the gene loci like 'BART1_0-u00001.001'.
<p><b>Morex 2017 Pseudomolecules Annotation</b> : The predicted genes have the nomenclature 'HORVU1Hr1G000010'. Transcript models are named after the the gene loci like 'HORVU1Hr1G000010.1'.
<table class='table-bordered' width='100%'><theader><tr><th>Dataset</th><th>Transcript IDs</th><th># Genes</th><th> # Transcripts</th></tr></theader>
<tbody>
<tr><td>Barley RTD</td><td>BART1_0-u00001.001</td><td>60,444</td><td>177,240</td></tr>
<tr><td>HORVU 2017</td><td>HORVU1Hr1G000010.1</td><td>81,683</td><td>334,126</td></tr>
</tbody>
</table>
<br>
<p>Searching for a gene ID will return all the transcript models from that gene region. You can go directly to a gene or transcript by using this search box:</p>
<form action='search_ids.cgi' method='get'>
<div class='input-group mb-3'>
<div class='input-group-prepend'>
<span class='input-group-text'>Search for Sequence ID</span>
</div>
<input type='text' class='form-control' name='seq_name' value='BART1_0-u00001' onfocus=\"this.value=''\">
<div class='input-group-append'><input class='btn btn-success' type='submit' value='Search'></div>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
</body>
</html>";
die("eorna/gene.cgi: Lookup contig source for $gene_name, $dataset - No contig in eorna for this gene id\n");
}
my ($transcript_start, $transcript_stop, $chromosome) = $db_query->{'dbh'}->
selectrow_array("select min(f_start), max(f_stop), contig_id from transcript_structure where gene_id = '$gene_name' and dataset_name=\'$dataset\' group by contig_id");
my $matching_genes_link = "<a class='nav-link' href='#matchingGenes'>Matching BARTs</a>";
if ($gene_name =~ /BART/){
$matching_genes_link = "<a class='nav-link' href='#matchingGenes'>Matching HORVUs</a>";
}
eorna::printHeader($gene_name);
print "<div class='container-fluid'>
<div class='row'>
<nav class='col-md-2 d-none d-md-block grey sidebar'>
<div class='sidebar-sticky'>
<ul class='nav flex-column'>
<li class='nav-item nav-link' id='nav-title'><img class='img-fluid' src='images/eorna-logo.png' width=150'><span class='app-title'>Expression Browser Beta</span></li>
<li class='nav-item'></li>
<li class='nav-item nav-link' id='nav-header'><b>Gene ID</b></li>
<li class='nav-item' id='nav-info'>$gene_name</li>
<li class='nav-item nav-link' id='nav-header'><b>Location</b></li>
<li class='nav-item' id='nav-info'>$chromosome: $transcript_start - $transcript_stop</li>
<li class='nav-item nav-link' id='nav-header'><b>Data</b></li>
<div class='list-group' id='list-data'>
<li class='nav-item'><a class='nav-link' href='#tpmgraph'>TPM Values</a></li>
<li class='nav-item'><a class='nav-link' href='#summary'>Transcripts</a></li>
<li class='nav-item'><a class='nav-link' href='#alt_cds'>CDS Structure</a></li>
<li class='nav-item'>$matching_genes_link</li>
<li class='nav-item'><a class='nav-link' href='#homologies'>Homologues</a></li>
<li class='nav-item'><a class='nav-link' href='#go_annot'>GO Annotation</a></li>
<li class='nav-item'><a class='nav-link' href='#mtp_gbrowse'>Barley GBrowse</a></li>
</div>
<li class='nav-item nav-link' id='nav-header'><b>Utilities Menu</b></li>
<div class='list-group'>
<li class='nav-item'><a class='nav-link' href='index.html'>Home</a></li>
<li class='nav-item'><a class='nav-link' href='blast.html'>Homology Search</a></li>
<li class='nav-item'><a class='nav-link' href='keyword.html'>Annotation Search</a></li>
<li class='nav-item'><a class='nav-link' href='download.html'>Bulk Data Download</a></li>
<li class='nav-item'><a class='nav-link' href='bart_lookup.html'>Translate HORVU to BART IDs</a></li>
<li class='nav-item'><a class='nav-link' href='go.html'>GO Enrichment</a></li>
</div>
</ul>
</div>
</nav>
<main role='main' class='col-md-9 ml-sm-auto col-lg-10 pt-3 px-4'>\n\n";
############### Print table of padded TPM values for the transcript of this gene ############
eorna::createJSPlotlyGraph($gene_name);
############### Draw a diagram of the contig and the locations of gene transcripts on it ####
eorna::drawTranscriptTable($gene_name, $dataset);
eorna::drawTranscriptsGbrowse($gene_name, $dataset, "y");
################## Print matching genes ####################################################
if ($gene_name =~ /BART/) {
eorna::printMatchingHORVU($gene_name);
}
if ($gene_name =~ /HORVU/) {
eorna::printMatchingBART($gene_name);
}
############### Get the Rice and TAIR top hits for the longest transcript of the gene #######
eorna::getHomologies($gene_name, $dataset);
############### Print the Go annotation for a bart gene #####################################
eorna::printGOAnnotation($gene_name);
############### Get the gbrowse of the gene ##########################################
eorna::get_GBrowse($gene_name);
eorna::printFooter();