Skip to content
Permalink
7a58760e5d
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
166 lines (152 sloc) 7.23 KB
{% extends 'base.html' %}
{% block title %}
{% if species %}
{{ species.name }} details
{% else %}
Species overview
{% endif %}
{% endblock %}
{% block container %}
{% import 'macros/pagination.html' as macro %}
<div class="top-pad">
{% if species %}
<ol class="breadcrumb">
<li><a href="{{ url_for('main.screen') }}">Home</a></li>
<li><a href="{{ url_for('species.species_overview') }}">Species</a></li>
<li class="active"><strong><em>{{ species.name }}</em></strong></li>
</ol>
<h1><strong><em>{{ species.name }}</em></strong> <small>({{ species.code }})</small></h1>
{% if description %}
{{ description }}
<br />
{% endif %}
<br />
<div class="row">
<div class="col-lg-12">
<br />
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Download <span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="{{url_for('species.species_stream_coding', species_id=species.id)}}" download="{{species.code}}.cds.fasta">Coding Sequences</a></li>
<li><a href="{{url_for('species.species_stream_protein', species_id=species.id)}}" download="{{species.code}}.aa.fasta">Protein Sequences</a></li>
<li class="dropdown-header">Networks</li>
{% for n in species.networks %}
<li><a href="{{ url_for('expression_network.expression_network_export', method_id=n.id) }}" download="network_{{n.id}}.tab">{{ n.description }}</a></li>
{% else %}
<li class="text-muted">No network found</li>
{% endfor %}
</ul>
</div>
<br /><br />
</div>
</div>
{{ macro.pagination('Sequences', url_for('species.species_sequences', species_id=species.id), species.sequence_count, none, 'species') }}
{% elif all_species %}
<ol class="breadcrumb">
<li><a href="{{ url_for('main.screen') }}">Home</a></li>
<li class="active"><strong>Species</strong></li>
</ol>
<h1>Species Overview</h1>
{% if species_tree %}
<h3 class="banner-blue">Species Tree</h3>
<div id="tree_panel">
<div id='phylogram'></div>
</div>
{% endif %}
<div class="table-responsive">
<table class="table table-separated" style="margin-bottom:100px;" id="species_table">
<thead>
<tr>
{% if g.debug %}<th data-sort="int"><span class="sort-icon"></span>ID</th>{% endif %}
<th data-sort="string-ins"><span class="sort-icon"></span>Name</th>
<th data-sort="int"><span class="sort-icon"></span>Transcripts</th>
<th data-sort="int"><span class="sort-icon"></span>Profiles</th>
<th data-sort="int"><span class="sort-icon"></span>Networks</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for s in all_species %}
<tr>
{% if g.debug %}<td>{{ s.id }}</td>{% endif %}
<td><em><a href="{{ url_for('species.species_view', species_id=s.id) }}">{{ s.name }}</a></em> <span class="'text-muted">({{ s.code }})</span></td>
<td>{{ s.sequence_count }}</td>
<td>{{ s.profile_count }}</td>
{% if s.network_count > 0 %}
<td><a href="{{url_for('expression_network.expression_network_species', species_id=s.id)}}">{{ s.network_count }}</a></td>
{% else %}
<td><span class="text-muted">0</span></td>
{% endif %}
<td>
<div class="btn-group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Download <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="{{url_for('species.species_stream_coding', species_id=s.id)}}" download="{{s.code}}.cds.fasta">Coding Sequences</a></li>
<li><a href="{{url_for('species.species_stream_protein', species_id=s.id)}}" download="{{s.code}}.aa.fasta">Protein Sequences</a></li>
<li class="dropdown-header">Networks</li>
{% for n in s.networks %}
<li><a href="{{ url_for('expression_network.expression_network_export', method_id=n.id) }}" download="network_{{n.id}}.tab">{{ n.description }}</a></li>
{% else %}
<li class="text-muted">No network found</li>
{% endfor %}
</ul>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block extrajs %}
{% if all_species %}
<script>
$(function () {
$("#species_table").stupidtable();
});
</script>
{% if species_tree %}
<script src="{{ url_for('static', filename='js/d3.v3.min.js') }}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='js/newick.js') }}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='js/d3.phylogram.js') }}" type="text/javascript"></script>
<script>
function draw_tree() {
var newick = Newick.parse("{{ species_tree }}")
var newickNodes = []
function buildNewickNodes(node, callback) {
newickNodes.push(node)
if (node.branchset) {
for (var i=0; i < node.branchset.length; i++) {
buildNewickNodes(node.branchset[i])
}
}
}
buildNewickNodes(newick)
d3.phylogram.build('#phylogram', newick, {
width: $('#tree_panel').width()-160,
height: {{ all_species|count*30+30 }},
skipTicks: true,
skipInnerLabels: true
});
}
function resize_tree() {
//clear div and redraw tree
$('#phylogram').empty();
draw_tree();
}
//Draw tree once the dom is ready
$(function() {
draw_tree();
});
var id;
$( window ).resize(function() {
clearTimeout(id);
id = setTimeout(resize_tree, 50);
});
</script>
{% endif %}
{% endif %}
{% endblock %}