Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
morpheus.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Daria Zenkova
morpheus.js
Commits
38664e95
Commit
38664e95
authored
Sep 01, 2016
by
Daria Zenkova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcaplot works better, synchronous request need to be fixed, but i still don't know why it's there
parent
e599771c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
47 deletions
+47
-47
js/morpheus-latest.min.js
js/morpheus-latest.min.js
+20
-20
src/matrix/dataset.js
src/matrix/dataset.js
+1
-2
src/matrix/dataset_util.js
src/matrix/dataset_util.js
+26
-25
No files found.
js/morpheus-latest.min.js
View file @
38664e95
This diff is collapsed.
Click to expand it.
src/matrix/dataset.js
View file @
38664e95
...
...
@@ -169,8 +169,7 @@ morpheus.Dataset.prototype = {
else
{
var
protoMessage
=
morpheus
.
DatasetUtil
.
toProtoMessage
(
this
);
var
blob
=
new
Blob
(
new
Uint8Array
(
protoMessage
),
{
type
:
"
application/octet-stream
"
});
saveAs
(
blob
,
"
test.bin
"
);
var
req
=
ocpu
.
call
(
"
createES
"
,
protoMessage
,
function
(
session
)
{
console
.
log
(
session
);
_this
.
esSession
=
session
;
...
...
src/matrix/dataset_util.js
View file @
38664e95
...
...
@@ -822,37 +822,36 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) {
var
participantID
=
[];
var
labelDescription
=
[];
var
columnMeta
=
dataset
.
getColumnMetadata
();
var
n
=
columnMeta
.
getMetadataCount
();
var
m
=
dataset
.
columns
;
for
(
var
i
=
0
;
i
<
n
;
i
++
)
{
var
vecI
=
columnMeta
.
get
(
i
);
if
(
vecI
.
getName
()
==
"
participant_id
"
)
{
for
(
var
j
=
0
;
j
<
m
;
j
++
)
{
participantID
.
push
({
strval
:
vecI
.
getValue
(
j
),
isNA
:
false
});
}
}
else
{
for
(
j
=
0
;
j
<
m
;
j
++
)
{
pDataArray
.
push
({
strval
:
vecI
.
getValue
(
j
).
toString
(),
isNA
:
false
});
}
labelDescription
.
push
({
strval
:
vecI
.
getName
(),
var
features
=
columnMeta
.
getMetadataCount
();
var
participants
=
dataset
.
getColumnCount
();
var
vecPartID
=
columnMeta
.
getByName
(
"
participant_id
"
);
for
(
var
i
=
0
;
i
<
participants
;
i
++
)
{
participantID
.
push
({
strval
:
vecPartID
.
getValue
(
i
),
isNA
:
false
});
}
for
(
var
j
=
0
;
j
<
features
;
j
++
)
{
var
vecJ
=
columnMeta
.
get
(
j
);
if
(
vecJ
.
getName
()
==
"
participant_id
"
)
{
continue
;
}
for
(
var
l
=
0
;
l
<
participants
;
l
++
)
{
pDataArray
.
push
({
strval
:
vecJ
.
getValue
(
l
).
toString
(),
isNA
:
false
});
}
labelDescription
.
push
({
strval
:
vecJ
.
getName
(),
isNA
:
false
});
}
var
rowMeta
=
dataset
.
getRowMetadata
();
var
rowNames
=
[];
var
rowNamesVec
=
rowMeta
.
getByName
(
"
id
"
);
for
(
j
=
0
;
j
<
dataset
.
rows
;
j
++
)
{
for
(
j
=
0
;
j
<
dataset
.
getRowCount
()
;
j
++
)
{
rowNames
.
push
({
strval
:
rowNamesVec
.
getValue
(
j
),
isNA
:
false
...
...
@@ -863,6 +862,7 @@ morpheus.DatasetUtil.getMetadataArray = function (dataset) {
morpheus
.
DatasetUtil
.
toProtoMessage
=
function
(
dataset
)
{
var
array
=
morpheus
.
DatasetUtil
.
getContentArray
(
dataset
);
var
meta
=
morpheus
.
DatasetUtil
.
getMetadataArray
(
dataset
);
console
.
log
(
meta
);
var
messageJSON
=
{
rclass
:
"
LIST
"
,
rexpValue
:
[{
...
...
@@ -879,7 +879,7 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) {
attrName
:
"
dim
"
,
attrValue
:
{
rclass
:
"
INTEGER
"
,
intValue
:
[
dataset
.
getColumn
Metadata
().
getMetadataCount
()
-
1
,
dataset
.
columns
]
intValue
:
[
dataset
.
getColumn
Count
(),
dataset
.
getColumnMetadata
().
getMetadataCount
()
-
1
]
}
},
{
rclass
:
"
STRING
"
,
...
...
@@ -918,5 +918,6 @@ morpheus.DatasetUtil.toProtoMessage = function (dataset) {
rexp
=
builder
.
build
(
"
rexp
"
),
REXP
=
rexp
.
REXP
;
return
new
REXP
(
messageJSON
);
var
proto
=
new
REXP
(
messageJSON
);
return
proto
;
};
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment