Commit 6a08fdef authored by Daria Zenkova's avatar Daria Zenkova

everything had seemed to work, but again some fucking crap occurred with...

everything had seemed to work, but again some fucking crap occurred with "missing value where TRUE/FALSE expected", but R function works properly when I check it in R console. so the problem is somewhere with input to ocpu.call, but I can't still understand where it is
parent 97718960
This diff is collapsed.
......@@ -821,19 +821,27 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) {
var pDataArray = [];
var participantID = [];
var labelDescription = [];
console.log(dataset);
var columnMeta = dataset.getColumnMetadata();
var features = columnMeta.getMetadataCount();
var participants = dataset.getColumnCount();
var vecPartID = columnMeta.getByName("participant_id");
var vecPartID;
if (columnMeta.getByName("participant_id") != null) {
vecPartID = columnMeta.getByName("participant_id");
}
else {
vecPartID = columnMeta.getByName("id");
}
for (var i = 0; i < participants; i++) {
participantID.push({
strval : vecPartID.getValue(i),
isNA : false
strval: vecPartID.getValue(i),
isNA: false
});
}
for (var j = 0; j < features; j++) {
var vecJ = columnMeta.get(j);
if (vecJ.getName() == "participant_id") {
if (vecJ.getName() == "participant_id" || vecJ.getName() == "id") {
continue;
}
for (var l = 0; l < participants; l++) {
......@@ -862,6 +870,7 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) {
morpheus.DatasetUtil.toProtoMessage = function (dataset) {
var array = morpheus.DatasetUtil.getContentArray(dataset);
var meta = morpheus.DatasetUtil.getMetadataArray(dataset);
var messageJSON = {
rclass : "LIST",
rexpValue : [{
......@@ -878,7 +887,7 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) {
attrName : "dim",
attrValue : {
rclass : "INTEGER",
intValue : [dataset.getColumnCount(), dataset.getColumnMetadata().getMetadataCount() - 1]
intValue : [dataset.getColumnCount(), meta.pdata.length/dataset.getColumnCount()]
}
}, {
rclass : "STRING",
......@@ -917,6 +926,7 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) {
rexp = builder.build("rexp"),
REXP = rexp.REXP;
var proto = new REXP(messageJSON);
return proto;
/*var blob = new Blob([new Uint8Array((new REXP(messageJSON)).toArrayBuffer())], {type: "application/octet-stream"});
saveAs(blob, "test1.bin");*/
return new REXP(messageJSON);
};
\ No newline at end of file
......@@ -293,16 +293,6 @@ morpheus.PcaPlotTool.prototype = {
var project = this.project;
var dataset = _this.project.getSelectedDataset({
emptyToAll: false
});
_this.dataset = dataset;
if (dataset.getRowCount() * dataset.getColumnCount() === 0) {
$('<h4>Please select any number of rows and any number of columns in the heat map.</h4>')
.appendTo(_this.$chart);
return;
}
this.formBuilder.$form.find('[name="draw"]').on('click', function () {
var colorBy = _this.formBuilder.getValue('color');
......@@ -311,7 +301,7 @@ morpheus.PcaPlotTool.prototype = {
var pc2 = _this.formBuilder.getValue('y-axis');
console.log('draw plot button clicked');
dataset = _this.project.getSelectedDataset({
var dataset = _this.project.getSelectedDataset({
emptyToAll : false
});
_this.dataset = dataset;
......@@ -319,11 +309,16 @@ morpheus.PcaPlotTool.prototype = {
var expressionSet = project.getFullDataset().getESSession();
var columnIndices = dataset.columnIndices;
var rowIndices = dataset.rowIndices;
console.log(dataset);
console.log(columnIndices);
console.log(rowIndices);
console.log(colorBy, sizeBy, pc1, pc2);
var req = ocpu.call("pcaPlot", {
es : expressionSet,
columns : columnIndices,
columns : columnIndices.length > 0 ? columnIndices : null,
rows : rowIndices.length > 0 ? rowIndices : null,
c1 : pc1,
c2 : pc2,
colour : colorBy,
......
......@@ -250,6 +250,8 @@ morpheus.HeatMapToolBar = function (controller) {
toolbarHtml.push('<div class="morpheus-button-divider"></div>');
toolbarHtml.push('<button type="button" class="btn btn-default btn-xs" data-toggle="tooltip" title="PCAPlot" name="pca">PCA</button>');
toolbarHtml.push('<button type="button" class="btn btn-default btn-xs" data-toggle="tooltip" title="create ExpressionSet" name="es">ES</button>');
$buttons.on('click', '[name=pca]', function () {
console.log("test button clicked");
......@@ -257,6 +259,12 @@ morpheus.HeatMapToolBar = function (controller) {
});
$buttons.on('click', '[name=es]', function () {
console.log("es button clicked");
var session = controller.getProject().getFullDataset().getESSession();
});
var $lineOneColumn = $el.find('[data-name=lineOneColumn]');
$search.appendTo($lineOneColumn);
var $toolbarForm = $(toolbarHtml.join(''));
......
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