annotate static/js/app.js @ 0:c03cf513baf3 draft default tip

planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
author eduardo
date Mon, 01 May 2017 14:56:39 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
1 var app = angular.module('app', ['ngTouch', 'ui.grid','ui.grid.grouping', 'ui.grid.pagination', 'ui.grid.exporter']);
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
2
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
3 app.controller('MainCtrl', ['$scope', '$http', '$interval', 'uiGridGroupingConstants', function ($scope, $http, $interval, uiGridGroupingConstants ){
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
4 $scope.gridOptions = {
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
5 enableFiltering: true,
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
6 enableGridMenu: true,
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
7 enableSelectAll: true,
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
8 exporterCsvFilename: 'myFile.csv',
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
9 exporterMenuPdf: false,
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
10 treeRowHeaderAlwaysVisible: false,
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
11 paginationPageSizes: [25, 50],
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
12 paginationPageSize: 25,
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
13 exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")),
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
14 //enableHorizontalScrollbar: 0,
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
15 //enableVerticalScrollbar: 1,
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
16 columnDefs: [
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
17 { name: 'contig', grouping: { groupPriority: 0 }, sort: { priority: 0, direction: 'desc' }, width: '25%', cellTemplate: '<div><div ng-if="!col.grouping || col.grouping.groupPriority === undefined || col.grouping.groupPriority === null || ( row.groupHeader && col.grouping.groupPriority === row.treeLevel )" class="ui-grid-cell-contents" title="TOOLTIP">{{COL_FIELD CUSTOM_FILTERS}}</div></div>' },
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
18 { name: 'mRNA', grouping: { groupPriority: 1 }, sort: { priority: 1,direction: 'desc' }, width: '25%', cellTemplate: '<div><div ng-if="!col.grouping || col.grouping.groupPriority === undefined || col.grouping.groupPriority === null || ( row.groupHeader && col.grouping.groupPriority === row.treeLevel )" class="ui-grid-cell-contents" title="TOOLTIP">{{COL_FIELD CUSTOM_FILTERS}}</div></div>' },
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
19 { name: 'prediction', width: '25%' },
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
20 { name: 'source', width: '10%' },
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
21 { name: 'score', width: '5%'},
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
22 ],
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
23 onRegisterApi: function( gridApi ) {
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
24 $scope.gridApi = gridApi;
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
25 }
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
26 };
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
27
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
28 var baseurl= '/api/datasets/'+hdaId+'?provider=sqlite-dict&data_type=raw_data&query=';
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
29 var select="select%20transcript_id%20as%20contig,%20query_prot_id%20as%20mRNA,'SignalPeptide'%20as%20prediction,%20'signalp'%20as%20source,%20score%20from%20signalp%20s,%20orf%20o%20where%20s.query_prot_id=o.orf_id%20union%20\
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
30 select%20transcript_id%20as%20contig,%20orf_id%20as%20mRNA,peptide%20as%20prediction,%20'transdecoder'%20as%20source,%20length%20as%20score%20from%20orf%20union%20\
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
31 select%20transcript_id%20as%20contig,%20queryprotid%20as%20mRNA,%20substr(Topology,10)%20as%20prediction,%20'tmhmmer'%20as%20source%20,substr(Score,7)%20as%20score%20from%20tmhmm%20t,%20orf%20o%20where%20t.queryprotid=o.orf_id%20and%20PredHel%20<>%20'PredHel=0'%20union%20\
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
32 select%20transcript_id%20as%20contig,%20TrinityID%20as%20mRNA,%20substr(LinkId,15)%20as%20prediction%20,%20DatabaseSource%20as%20source,%20BitScore%20as%20score\
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
33 from%20blastdbase%20b%20,%20%20uniprotindex%20u,%20orf%20o%20where%20b.Trinityid=o.orf_id%20and%20u.Accession=b.FullAccession%20and%20u.AttributeType%20='D'%20union%20\
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
34 select%20transcript_id%20as%20contig,%20QueryProtID%20as%20mRNA,%20HMMERTDomainDescription%20as%20prediction,%20'hmmer'%20as%20source,%20ThisDomainEvalue%20as%20score%20%20from%20hmmerdbase%20h,pfamreference%20p,orf%20o%20where%20h.queryprotid=o.orf_id%20and%20h.FullDomainScore%20>=%20p.Domain_NoiseCutoff%20and%20p.pfam_accession=h.pfam_id";
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
35 var url= baseurl + select;
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
36 $http.get(url)
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
37 .success (function(response){
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
38 $scope.gridOptions.data = [].concat.apply([], response.data);
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
39 //mygridOptions.totalItems = mygridOptions.data.length;
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
40 });//end get_url
c03cf513baf3 planemo upload commit af9b813e424144b8bd7d9b9ce6e3a3c93bc9f549-dirty
eduardo
parents:
diff changeset
41 }])