1angular 2 .module('app') 3 .controller('geneInfoController', ['$scope','$filter','$state','$window','$location','$http','genes','modals','Utils','envService','ngMeta', 4 function($scope,$filter,$state,$window,$location,$http,genes,modals,Utils,envService,ngMeta) { 5 6 //internal functions 7 8 function onSuccessGetGeneInfo(result){ 9 // console.log("success"); 10 $scope.geneInfo=result; 11 $scope.geneSynonyms=result.synonyms.replaceAll("|",", "); 12 $scope.dbxrefs=result.dbxrefs.split("|"); 13 $scope.geneRefs = {}; 14 result.dbxrefs.split('|').forEach(function(x){ 15 var arr = x.split(':'); 16 arr[1] && ($scope.geneRefs[arr[0]] = arr[1]); 17 }); 18 // ngMeta.setTitle('Compound info page of '+$scope.compoundInfo.compound); 19 // ngMeta.setTag('Canonical','/ilincs'+$location.$$path); 20 // $scope.genes=genes.current.content; 21 // $scope.genesNotEmpty=genes.current.content.length; 22 // if (!$scope.genesNotEmpty) { 23 // onErrorGetGenes("Empty Genelist"); 24 // } else { 25 // $scope.resolved=true; 26 // } 27 ngMeta.setTag('keywords',result.symbol+","+result.synonyms.replaceAll("|",",")+","+result.dbxrefs.replaceAll("|",",")); 28 ngMeta.setTag('description','Gene '+result.symbol+' related signatures in iLINCS. '+result.description); 29 // console.log("test"); 30 // console.log($scope.geneInfo.geneid); 31 $scope.genesF.isL1000($scope.geneInfo.geneid,null,onSuccessIsL1000); 32 $scope.genesF.isP100($scope.geneInfo.geneid,null,onSuccessIsP100); 33 34 }; 35 36 function onSuccessIsL1000(result){ 37 $scope.geneInfo.L1000=result.L1000; 38 // console.log($scope.L1000); 39 } 40 41 function onSuccessIsP100(result){ 42 $scope.geneInfo.P100=result.P100; 43 } 44 45 46 function onSuccessGetGeneInfoFromHarmonizome(result){ 47 // console.log("Harmonizome success"); 48 $scope.geneInfoHarmonizome=result; 49 // $scope.geneInfoHarmonizomeProteins=result.proteins.map("symbol"); 50 // var myMap = new Map() 51 var proteins = result.proteins.map(function(a) {return a.symbol;}); 52 // console.log(proteins); 53 $scope.geneInfoHarmonizomeProteins=proteins.join(', '); 54 55 }; 56 // 57 function onErrorGetGeneInfo(err){ 58 console.log("error"); 59 $scope.errorMessage=err; 60 $scope.resolved=true; 61 }; 62 63 //scope functions 64 65 66//init function 67init = function() { 68// $scope.geneId=$state.params.id; 69$scope.geneName=$state.params.name; 70 71$scope.modalsF=modals; 72$scope.genesF=genes; 73 74genes.getGeneInfoBySymbolCb($scope.geneName,onSuccessGetGeneInfo,onErrorGetGeneInfo); 75genes.getGeneInfoFromHarmonizome($scope.geneName,onSuccessGetGeneInfoFromHarmonizome,onErrorGetGeneInfo); 76 77 // ngMeta.setTitle('Gene '+$state.params.name+' related datasets and signatures in'); 78 ngMeta.setTitle('Gene '+$state.params.name+' info and related signatures in'); 79 ngMeta.setTag('Canonical','/ilincs'+$location.$$path); 80// 81 if (envService.is('production')) { 82 $scope.environment="production"; 83 } 84 else { 85 $scope.environment="development"; 86 } 87// 88// $scope.modalsF=modals; 89// $scope.compoundsF=compoundsFactory; 90// 91// // $scope.libIDs = signatures.libIDs(); 92// 93// // $scope.term=$state.params.term; 94// $scope.LSMname=$state.params.name; 95// // $scope.results=signatures.results; 96// compoundsFactory.getOneCompoundCb($scope.LSMname,onSuccessGetOneCompound,onErrorGetOneCompound); 97// 98// 99// $scope.imgUrl="http://life.ccs.miami.edu/life/web/images/sm-images/400/"+$scope.LSMname+".png"; 100// // $scope.imageExist = function() { 101// Utils.isImage($scope.imgUrl).then(function(result) { 102// $scope.imageExist = result; 103// }); 104// // }; 105// 106// // if ($state.current.name=="signatures.search.pharmAction.action"){ 107// // $scope.activePharmAction=$state.params.action; 108// // } 109// // $scope.LDPdata = $resource('http://lincsportal.ccs.miami.edu/dcic/api/fetchentities?searchTerm=:searchTerm', 110// // {searchTerm:$scope.name}, { 111// // get: {method:'GET', params:{searchTerm:true}} 112// // }); 113// $http({ 114// url: 'http://lincsportal.ccs.miami.edu/dcic/api/fetchentities?searchTerm='+$scope.LSMname, 115// method: 'GET' 116// // data: $httpParamSerializer({input:payload}), 117// // headers: { 118// // 'Content-Type': 'application/x-www-form-urlencoded' 119// // } 120// }).then(function(response) { 121// $scope.status = response.status; 122// $scope.data = response.data; 123// $scope.LDPdata = response.data 124// $scope.PubChemId=$scope.LDPdata.results.documents[0].SM_PubChem_CID[0]; 125// ngMeta.setTag('keywords',$scope.LDPdata.results.documents[0].entityName[0]+', '+$scope.LDPdata.results.documents[0].SM_Alternative_Name.join(', ')); 126// ngMeta.setTag('description',$scope.LDPdata.results.documents[0].SM_Drug_Information[0].substr(0, 156)); 127// } 128// ,function(response) { 129// $scope.data = response.data || 'Request failed'; 130// $scope.status = response.status; 131// }); 132//
133// console.log($window.expressionAtlasHeatmapHighcharts); 134// $window.expressionAtlasHeatmapHighcharts.render({ 135// query: { 136// gene: $state.params.name 137// }, 138// isMultiExperiment: true, 139// target: "heatmapContainer" 140// }); 141 142} 143 144//begining of initializing PerturbagenController 145init(); 146 147 }]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.