Commit 3be7639c authored by Blake Sweeney's avatar Blake Sweeney
Browse files

Initial version of GO annotation table

This is the initial version of the GO annotation table. This does not
yet handle cases where there is no data or the data fails to load. This
only deals with showing data.
parent d631f5b7
......@@ -32,10 +32,10 @@ angular.module("routes", []).service('routes', ['$interpolate', function($interp
'&hlpretag=<span class=text-search-highlights>' +
'&hlposttag=</span>'
,
ebiAutocomplete: 'http://www.ebi.ac.uk/ebisearch/ws/rest/RNAcentral/autocomplete?term={{ query }}&format=json'
ebiAutocomplete: 'http://www.ebi.ac.uk/ebisearch/ws/rest/RNAcentral/autocomplete?term={{ query }}&format=json',
apiGoTermsView: '/api/v1/rna/{{ upi }}/go-annotations/{{ taxid }}',
};
apiGoTermsView: '/api/v1/rna/{{ upi }}/go-annotations/{{ taxid }}';
// apply $interpolate to each route template expression
return Object.keys(routes)
......
<div>
<p>A table of GO annotations</p>
</div>
<table class="table table-hover table-condensed" id="go-annotations">
<thead>
<th>Qualifier</th>
<th>GO Term</th>
<th>Evidence Code</th>
<th>Source</th>
</thead>
<tbody>
<tr ng-repeat="annotation in $ctrl.go_annotations">
<td>{{ annotation.qualifier }}</td>
<td><a href="http://www.ebi.ac.uk/QuickGO/term/{{ annotation.go_term_id }}">{{ annotation.go_term_name }}</a></td>
<td><a href="https://www.ebi.ac.uk/QuickGO/term/{{ annotation.evidence_code_id }}">{{ annotation.evidence_code_name }}</a></td>
<td>{{ annotation.assigned_by }}</td>
</tr>
</tbody>
</table>
var go_annotations = {
bindings: {
upi: '=',
taxid: '=',
},
controller: ['$http', 'routes', function($http, routes) {
var ctrl = this;
ctrl.$onInit = function() {
ctrl.fetchGoTerms().then(
function(response) {
ctrl.go_terms = response.data.data;
},
function(response) {
ctrl.error = "Failed to fetch GO annotations";
}
);
};
ctrl.fetchGoTerms = function() {
return $http.get(
routes.apiGoTermsView({ upi: ctrl.upi, taxid: ctrl.taxid }),
{ timeout: 5000 }
);
};
}],
templateUrl: '/static/js/components/sequence/go_annotations/go_annotations.html'
};
angular.module("rnaSequence").component("go_annotations", go_annotations);
......@@ -185,6 +185,7 @@ limitations under the License.
<script src="{% static "js/components/sequence/xrefs/xrefs.component.js" %}"></script>
<script src="{% static "js/components/sequence/xrefs/xref-publications/xref-publications.component.js" %}"></script>
<script src="{% static "js/components/sequence/2d/2d.component.js" %}"></script>
<script src="{% static "js/components/sequence/go-annotations/go_annotations.component.js" %}"></script>
<script src="{% static "js/components/sequence-search/nhmmer.sequence.search.js" %}"></script>
......
......@@ -187,6 +187,12 @@ limitations under the License.
<p>
</div>
<div>
<h2>Go Annotations</h2>
<go-annotations upi="upi" taxid="taxid"></go-annotations>
</div>
<div>
<h2>
Rfam classification
......@@ -365,10 +371,6 @@ limitations under the License.
<secondary-structures upi="upi" taxid="taxid" show-secondary-structure-tab="show2dTab()"></secondary-structures>
</uib-tab>
<uib-tab index="3" heading="GO Annotations" id="go-annotations" deselect="checkTab($event, $selectedIndex)">
<go-annotations upi="upi" taxid="taxid"></go-annotations>
</uib-tab>
<uib-tab index="3" class="dropdown pull-right hidden-xs">
<uib-tab-heading>
<span uib-dropdown>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment