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 source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -821,19 +821,27 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) { ...@@ -821,19 +821,27 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) {
var pDataArray = []; var pDataArray = [];
var participantID = []; var participantID = [];
var labelDescription = []; var labelDescription = [];
console.log(dataset);
var columnMeta = dataset.getColumnMetadata(); var columnMeta = dataset.getColumnMetadata();
var features = columnMeta.getMetadataCount(); var features = columnMeta.getMetadataCount();
var participants = dataset.getColumnCount(); 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++) { for (var i = 0; i < participants; i++) {
participantID.push({ participantID.push({
strval : vecPartID.getValue(i), strval: vecPartID.getValue(i),
isNA : false isNA: false
}); });
} }
for (var j = 0; j < features; j++) { for (var j = 0; j < features; j++) {
var vecJ = columnMeta.get(j); var vecJ = columnMeta.get(j);
if (vecJ.getName() == "participant_id") { if (vecJ.getName() == "participant_id" || vecJ.getName() == "id") {
continue; continue;
} }
for (var l = 0; l < participants; l++) { for (var l = 0; l < participants; l++) {
...@@ -862,6 +870,7 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) { ...@@ -862,6 +870,7 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) {
morpheus.DatasetUtil.toProtoMessage = function (dataset) { morpheus.DatasetUtil.toProtoMessage = function (dataset) {
var array = morpheus.DatasetUtil.getContentArray(dataset); var array = morpheus.DatasetUtil.getContentArray(dataset);
var meta = morpheus.DatasetUtil.getMetadataArray(dataset); var meta = morpheus.DatasetUtil.getMetadataArray(dataset);
var messageJSON = { var messageJSON = {
rclass : "LIST", rclass : "LIST",
rexpValue : [{ rexpValue : [{
...@@ -878,7 +887,7 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) { ...@@ -878,7 +887,7 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) {
attrName : "dim", attrName : "dim",
attrValue : { attrValue : {
rclass : "INTEGER", rclass : "INTEGER",
intValue : [dataset.getColumnCount(), dataset.getColumnMetadata().getMetadataCount() - 1] intValue : [dataset.getColumnCount(), meta.pdata.length/dataset.getColumnCount()]
} }
}, { }, {
rclass : "STRING", rclass : "STRING",
...@@ -917,6 +926,7 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) { ...@@ -917,6 +926,7 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) {
rexp = builder.build("rexp"), rexp = builder.build("rexp"),
REXP = rexp.REXP; REXP = rexp.REXP;
var proto = new REXP(messageJSON); /*var blob = new Blob([new Uint8Array((new REXP(messageJSON)).toArrayBuffer())], {type: "application/octet-stream"});
return proto; saveAs(blob, "test1.bin");*/
return new REXP(messageJSON);
}; };
\ No newline at end of file
...@@ -293,16 +293,6 @@ morpheus.PcaPlotTool.prototype = { ...@@ -293,16 +293,6 @@ morpheus.PcaPlotTool.prototype = {
var project = this.project; 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 () { this.formBuilder.$form.find('[name="draw"]').on('click', function () {
var colorBy = _this.formBuilder.getValue('color'); var colorBy = _this.formBuilder.getValue('color');
...@@ -311,7 +301,7 @@ morpheus.PcaPlotTool.prototype = { ...@@ -311,7 +301,7 @@ morpheus.PcaPlotTool.prototype = {
var pc2 = _this.formBuilder.getValue('y-axis'); var pc2 = _this.formBuilder.getValue('y-axis');
console.log('draw plot button clicked'); console.log('draw plot button clicked');
dataset = _this.project.getSelectedDataset({ var dataset = _this.project.getSelectedDataset({
emptyToAll : false emptyToAll : false
}); });
_this.dataset = dataset; _this.dataset = dataset;
...@@ -319,11 +309,16 @@ morpheus.PcaPlotTool.prototype = { ...@@ -319,11 +309,16 @@ morpheus.PcaPlotTool.prototype = {
var expressionSet = project.getFullDataset().getESSession(); var expressionSet = project.getFullDataset().getESSession();
var columnIndices = dataset.columnIndices; var columnIndices = dataset.columnIndices;
var rowIndices = dataset.rowIndices;
console.log(dataset);
console.log(columnIndices);
console.log(rowIndices);
console.log(colorBy, sizeBy, pc1, pc2); console.log(colorBy, sizeBy, pc1, pc2);
var req = ocpu.call("pcaPlot", { var req = ocpu.call("pcaPlot", {
es : expressionSet, es : expressionSet,
columns : columnIndices, columns : columnIndices.length > 0 ? columnIndices : null,
rows : rowIndices.length > 0 ? rowIndices : null,
c1 : pc1, c1 : pc1,
c2 : pc2, c2 : pc2,
colour : colorBy, colour : colorBy,
......
...@@ -250,6 +250,8 @@ morpheus.HeatMapToolBar = function (controller) { ...@@ -250,6 +250,8 @@ morpheus.HeatMapToolBar = function (controller) {
toolbarHtml.push('<div class="morpheus-button-divider"></div>'); 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="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 () { $buttons.on('click', '[name=pca]', function () {
console.log("test button clicked"); console.log("test button clicked");
...@@ -257,6 +259,12 @@ morpheus.HeatMapToolBar = function (controller) { ...@@ -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]'); var $lineOneColumn = $el.find('[data-name=lineOneColumn]');
$search.appendTo($lineOneColumn); $search.appendTo($lineOneColumn);
var $toolbarForm = $(toolbarHtml.join('')); 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