Commit df1eee1b authored by Michael Baudis's avatar Michael Baudis
Browse files

improving dataset listing

parent dcfae313
// This is the list of all the datasets. Required in many places to check the
// dataset identifiers's validity for instance.
// Calling via localhost, since Beacon here always addresses the same host; safe for
// testing purposes (e.g. local usually via arraymap.test).
var request = require("request");
var url = "http://arraymap.org/qsubsets/?db=arraymap&collection=subsets&subsettype=ICDMORPHOLOGYCODE&querytext=8|9";
var url = "http://127.0.0.1/qsubsets/?db=arraymap&collection=subsets&subsettype=ICDMORPHOLOGYCODE&querytext=^8|9";
module.exports = {
getDatasetsFromArrayMap: function(callback) {
......@@ -45,6 +47,8 @@ function getDatasets(json) {
var datasets = [];
var array = json.subsetdata;
// TODO: sort array by SUBSETCODE (ATM done in the called CGI)
for (var i = 0; i < array.length; i++) {
var element = array[i];
......@@ -53,16 +57,19 @@ function getDatasets(json) {
// "UID":"80003","SUBSETCODE":"8000/3","SAMPLENO":7,"SUBSETTEXT":"8000/3: Neoplasm, malignant"
dataset.id = element.SUBSETCODE;
dataset.description = element.SUBSETTEXT;
dataset.description = element.SUBSETTEXT+" ("+element.SAMPLENO+")";
dataset.reference = "reference genome";
var size = {};
size.variants = "-1";
size.samples = element.SAMPLENO;
dataset.size = size;
if (size.samples > 0) {
datasets.push(dataset);
dataset.size = size;
datasets.push(dataset);
}
}
infoinfo.datasets = datasets;
......
......@@ -407,4 +407,4 @@
}
}
}
}
\ No newline at end of file
}
......@@ -22,7 +22,7 @@ arrayMap.factory('BeaconService', ['$http', '$q', function ($http, $q) {
function getDatasets() {
var defer = $q.defer();
// var url = "http://arraymap.org/api/?db=arraymap&api_out=icdmlist&api_out=icdmlist&api_doctype=json&icdm_m=8,9";
// var url = "http://arraymap.org/qsubsets/?db=arraymap&collection=subsets&subsettype=ICDMORPHOLOGYCODE&querytext=^8|9";
var url = "/dataset?id=all";
var req = {
......@@ -98,7 +98,7 @@ arrayMap.controller('BeaconController', ['$scope', '$location', 'BeaconService',
var conf = $scope.config;
return $location.absUrl() + "v0.2/query?chromosome=" +
return $location.absUrl() + "v0.4/query?chromosome=" +
conf.chromosome +
"&position=" + conf.position +
"&reference=" + conf.reference +
......
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