1angular 2 .module('app') 3 .controller('HistoryController', ['$scope','$state','modals','SignatureMeta','GeneInfo','signatures','storageFactory','envService', 4 function($scope,$state,modals,SignatureMeta,GeneInfo,signatures,storageFactory,envService) { 5 6 //internal functions 7 function renderTable(sigs){ 8 // console.log(sigs); 9 SignatureMeta.findMany({signatures:sigs}, 10 function(data){//sigList = data.content; 11 // $scope.signatures=data; 12 // console.log(data); 13 // $scope.dataLoading=false; 14 // console.log(sigList); 15 $scope.customTheme = { 16 iconUp: 'fa fa-sort-amount-asc pull-right samplesHead', 17 iconDown: 'fa fa-sort-amount-desc pull-right samplesHead', 18 listItemsPerPage: [5,10,50], 19 itemsPerPage: 5, 20 loadOnInit: true 21 }; 22 23 $scope.resourceM = { 24 "header": //response.data.header, 25 [ 26 { "check": "" }, 27 { "signatureid": "Signature ID" }, 28 { "libraryid": "Library" }, 29 { "cellline":"Cell Line"}, 30 { "tissue":"Tissue"}, 31 { "factor": "Factor" } 32 ,{ "compound": "Compound"} 33 ], 34 "rows": data.data 35 }; 36 }, 37 function(errorResponse){console.log("Signature list not found."),console.log(errorResponse)}); 38 // $scope.signatures=sigs; 39 40 } 41 42 function getGeneInfo(geneList,check) { 43 // debugger; 44 // $scope.genelist =[]; 45 // $scope.list = localStorage.getObj("GeneList"); 46 // $scope.list=["1","2","3"]; 47 GeneInfo 48 //.find({ filter:{where: {or :[{geneid: {"inq": $scope.list}},{symbol: {"inq": $scope.list}}]}}}) 49 .findMany({genes:geneList}) 50 .$promise 51 .then(function(results) { 52 // console.log(results); 53 // $scope.genelist = results.data; 54 // $scope.allGenes(results.data); //?????? 55 // if ($state.current.name=="genes.list"){ 56 // $scope.defaultGenes(results.data); //?????? 57 // } 58 // console.log('get genes from API') 59 //sleep(5000); 60 // $scope.dataLoading = false; 61 getTasty(results.data,10,check); 62 // $scope.foundGeneIds = $scope.genelist.map(function(a) {return a.geneid;}); 63 // $scope.foundGenesStr = $scope.foundGeneIds.toString(); 64 }); 65 } 66 67 function getTasty(genelist,perPage,check) { 68 $scope.filterBy={"geneid":"","symbol":"","description":"","synonyms":""} 69 // console.log('initializing Tasty') 70 $scope.customGeneTheme = { 71 // iconSortable: 'fa fa-exchange fa-rotate-90 pull-right samplesHead', 72 iconUp: 'fa fa-sort-amount-asc pull-right samplesHead', 73 iconDown: 'fa fa-sort-amount-desc pull-right samplesHead', 74 listItemsPerPage: [5, 10, 25, 100],//[10, 20, 50, 100, 1000], 75 itemsPerPage: perPage, 76 loadOnInit: true 77 }; 78 if (check) { 79 $scope.resource = { 80 "header": //response.data.header, 81 [ 82 { "check": "" }, 83 { "geneid": "Gene ID" }, 84 { "symbol": "Symbol" }, 85 { "description":"Description"}, 86 { "synonyms": "Synonyms" } 87 ,{ "taxid": "Organism" } 88 ], 89 "rows": genelist 90 }; 91 } else { 92 $scope.resource = { 93 "header": //response.data.header, 94 [ 95 { "geneid": "Gene ID" }, 96 { "symbol": "Symbol" }, 97 { "description":"Description"}, 98 { "synonyms": "Synonyms" } 99 ,{ "taxid": "Organism" } 100 ], 101 "rows": genelist 102 } 103 }; 104 105} 106 107 function getSessionStorage(name) { 108 if (localStorage.getObj(name)) { 109 return localStorage.getObj(name); 110 } else { 111 return []; 112 } 113 114 } 115 //scope functions 116 117 $scope.modifyGenes = function(){ 118 // // console.info("geneListNum : ",$state.params.geneListNum); 119 // localStorage.setObj("GeneList",[]); 120 // localStorage.setItem('GeneString',[]); 121 // GeneList 122 // .findOne({filter:{where:{id:$state.params.geneListNum}}}) 123 // // .find({ filter:{where:{and:[{lincsDsgc:{neq:"NA"}},{lincsDsgc:{neq:null}}]}}}) 124 // // {"limit":10,"where":{"and":[{"lincsDsgc":{"neq":"NA"}},{"lincsDsgc":{"neq":null}}]}} //explorer 125 // // {"limit":10,"where":{"or":[{"lincsDsgc":{"neq":null}}]} 126 // //.find({ filter:{limit: 5}}) 127 // // Platforms 128 // // .inPortal({platform: "LINCS"}) 129 // .$promise 130 // .then(function(data) { 131 // $scope.geneListData = data; 132 $state.go('genes.list',{genes:$scope.localGenes}); 133 // // $scope.list =$scope.geneListData.content.split(','); 134 // // getGeneInfo() 135 // }); 136 137 } 138 139//init function 140init = function() { 141 if (envService.is('production')) { 142 $scope.environment="production"; 143 } 144 else { 145 $scope.environment="development"; 146 } 147 // console.log("History Controller in place"); 148 $scope.signaturesF=signatures; 149 $scope.modalsF=modals; 150 // if (envService.is('production')) { 151 // $scope.environment="production"; 152 // } 153 // else { 154 // $scope.environment="development"; 155 // } 156 if (localStorage.getObj("SignatureListStorage")) { 157 $scope.localSigs = localStorage.getObj("SignatureListStorage"); 158 } else { 159 $scope.localSigs = []; 160 } 161 renderTable($scope.localSigs); 162 $scope.filterBySig={} 163 164 //Uploaded Signatures 165 // if (localStorage.getObj("uploadedSignature")) { 166 // $scope.uploadedSignature = localStorage.getObj("uploadedSignature"); 167 // } else { 168 // $scope.uploadedSignature = {}; 169 // } 170 171 //////Genes 172 if (localStorage.getObj("GeneList")) { 173 $scope.localGenes = localStorage.getObj("GeneList"); 174 } else { 175 $scope.localGenes = []; 176 } 177 178 getGeneInfo($scope.localGenes); 179 // getTasty($scope.localGenes) 180 181 //////analysis results 182 // $scope.resultsHistory = getSessionStorage('resultsHistory'); 183 184 //////signature list history 185 // $scope.signatureListHistory = getSessionStorage('signatureListHistory'); 186 187 //////gene list history 188 // $scope.geneListHistory = getSessionStorage('geneListHistory'); 189 190 //////gene list current 191 // $scope.geneListCurrent = getSessionStorage('GeneList'); 192 193 $scope.currentDataset= storageFactory.getSessionStorage('currentDataset',true); 194 195 } 196 197//begining of initializing PerturbagenController 198init(); 199 200 }]);
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.