Skip to content

Commit c6578d0

Browse files
committed
Fixed BLAST links.
1 parent c0b0aca commit c6578d0

File tree

6 files changed

+234
-60
lines changed

6 files changed

+234
-60
lines changed
Lines changed: 158 additions & 0 deletions
Loading
50.4 KB
Loading

NetExplorer/templates/NetExplorer/blast.html

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -81,61 +81,61 @@ <h2>Application</h2>
8181

8282
<div class="results-div">
8383
{% if results %}
84-
<h2>Results</h2>
85-
<br>
86-
<table id="blast-results">
87-
<thead>
88-
<tr>
89-
<th>Query</th>
90-
<th>Subject</th>
91-
<th>Identity</th>
92-
<th>Al length</th>
93-
<th>Mismatches</th>
94-
<th>Gap opens</th>
95-
<th>Q start</th>
96-
<th>Q end</th>
97-
<th>S start</th>
98-
<th>S end</th>
99-
<th>E-value</th>
100-
<th>Bit score</th>
101-
</tr>
102-
</thead>
103-
<tbody>
104-
{% for line in results %}
84+
<h2>Results</h2>
85+
<br>
86+
<table id="blast-results">
87+
<thead>
10588
<tr>
106-
{% for col in line %}
107-
{% if forloop.counter == 2 %}
108-
<td>
109-
<a class="card-trigger"
110-
title="Click to view info card"
111-
target="{{ col }}"
112-
targetDB="{{ database }}">
113-
{{ col }}
114-
</a>
115-
</td>
116-
{% else %}
117-
<td>{{ col }}</td>
118-
{% endif %}
119-
{% endfor %}
89+
<th>Query</th>
90+
<th>Subject</th>
91+
<th>Identity</th>
92+
<th>Al length</th>
93+
<th>Mismatches</th>
94+
<th>Gap opens</th>
95+
<th>Q start</th>
96+
<th>Q end</th>
97+
<th>S start</th>
98+
<th>S end</th>
99+
<th>E-value</th>
100+
<th>Bit score</th>
120101
</tr>
121-
{% endfor %}
122-
</tbody>
123-
</table>
124-
125-
<!-- HIDDEN CARD OVERLAY -->
126-
<div id="button-container">
127-
<div class="close-overlay" title="Close card">
128-
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
129-
</div>
130-
<div class="full-screen-card" title="Open in new window">
131-
<span class="glyphicon glyphicon-new-window" aria-hidden="true"></span>
102+
</thead>
103+
<tbody>
104+
{% for line in results %}
105+
<tr>
106+
{% for col in line %}
107+
{% if forloop.counter == 2 %}
108+
<td>
109+
<a class="card-trigger"
110+
title="Click to view info card"
111+
target="{{ col }}"
112+
targetDB="{{ database }}">
113+
{{ col }}
114+
</a>
115+
</td>
116+
{% else %}
117+
<td>{{ col }}</td>
118+
{% endif %}
119+
{% endfor %}
120+
</tr>
121+
{% endfor %}
122+
</tbody>
123+
</table>
124+
125+
<!-- HIDDEN CARD OVERLAY -->
126+
<div id="button-container">
127+
<div class="close-overlay" title="Close card">
128+
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
129+
</div>
130+
<div class="full-screen-card" title="Open in new window">
131+
<span class="glyphicon glyphicon-new-window" aria-hidden="true"></span>
132+
</div>
132133
</div>
133-
</div>
134-
<div id="card-overlay" class="card-overlay">
135-
<div class="card-title">
134+
<div id="card-overlay" class="card-overlay">
135+
<div class="card-title">
136136

137-
</div>
138-
</div>
137+
</div>
138+
</div>
139139
{% endif %}
140140
</div>
141141

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{% load static %}
2+
<head>
3+
<link rel="shortcut icon" href="{% static 'Images/mini-logo.ico' %}">
4+
<link rel="stylesheet" href="{% static 'css/style.css' %}">
5+
<title>PlaNet - Protein not found</title>
6+
</head>
7+
8+
<body>
9+
<div id="body-wrapper">
10+
<div id="error404">
11+
<img src="{% static 'Images/not_interactome.png' %}" id="img404">
12+
<br>
13+
<br>
14+
<p>The specified symbol is not in any of the interactomes, that is, we don't have interaction information for this protein/contig</p>
15+
<h4>Go back to <a href="/PlanNET">PlanNET</a></h4>
16+
</div>
17+
</div>
18+
</body>

NetExplorer/views.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ def get_card(request, symbol=None, database=None):
217217
symbol = request.GET['target']
218218
database = request.GET['targetDB']
219219

220-
print("GET CARD")
221220
try:
222221
card_node = query_node(symbol, database)
223222
if database != "Human":
@@ -230,18 +229,18 @@ def get_card(request, symbol=None, database=None):
230229
print("HEY")
231230
homologs = card_node.get_homologs()
232231
except (NodeNotFound, IncorrectDatabase):
233-
return render(request, 'NetExplorer/404.html')
232+
return render_to_response('NetExplorer/not_interactome.html')
234233

235234
if database != "Human":
236235
response = {
237-
'node' : card_node,
238-
'json_graph': graph.to_json(),
239-
'domains' : card_node.domains_to_json()
236+
'node' : card_node,
237+
'json_graph': graph.to_json(),
238+
'domains' : card_node.domains_to_json()
240239
}
241240
else:
242241
response = {
243-
'node' : card_node,
244-
'homologs': homologs
242+
'node' : card_node,
243+
'homologs': homologs
245244
}
246245
if request.is_ajax():
247246
return render(request, 'NetExplorer/gene_card.html', response)
@@ -447,9 +446,8 @@ def blast(request):
447446
pipe = Popen([request.POST['type'], "-db", BLAST_DB_DIR + database , "-query", temp.name, '-outfmt', '6'], stdout=PIPE, stderr=STDOUT)
448447
stdout, stderr = pipe.communicate()
449448
results = [ line.split("\t") for line in stdout.split("\n") if line ]
450-
return render(request, 'NetExplorer/blast.html', {'results': results, 'database': database, 'databases': sorted(DATABASES) })
449+
return render(request, 'NetExplorer/blast.html', {'results': results, 'database': database.title(), 'databases': sorted(DATABASES) })
451450
else:
452-
print(sorted(DATABASES))
453451
return render(request, 'NetExplorer/blast.html',{'databases': sorted(DATABASES)})
454452

455453
# ------------------------------------------------------------------------------

static/Images/not_interactome.png

50.4 KB
Loading

0 commit comments

Comments
 (0)