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
962d2c09
Commit
962d2c09
authored
Jul 20, 2016
by
jgould
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copy strings to avoid memory links
parent
a7aab923
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
20 deletions
+29
-20
js/morpheus-latest.min.js
js/morpheus-latest.min.js
+3
-3
src/io/gct_reader.js
src/io/gct_reader.js
+12
-12
src/util/util.js
src/util/util.js
+14
-5
No files found.
js/morpheus-latest.min.js
View file @
962d2c09
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/io/gct_reader.js
View file @
962d2c09
...
@@ -100,7 +100,7 @@ morpheus.GctReader.prototype = {
...
@@ -100,7 +100,7 @@ morpheus.GctReader.prototype = {
var
index
=
j
+
numRowAnnotations
+
1
;
var
index
=
j
+
numRowAnnotations
+
1
;
var
columnName
=
index
<
columnNamesArray
.
length
?
columnNamesArray
[
index
]
var
columnName
=
index
<
columnNamesArray
.
length
?
columnNamesArray
[
index
]
:
null
;
:
null
;
columnMetadata
[
0
].
push
(
String
(
columnName
));
columnMetadata
[
0
].
push
(
morpheus
.
Util
.
copy
String
(
columnName
));
}
}
for
(
var
j
=
0
;
j
<
numRowAnnotations
;
j
++
)
{
for
(
var
j
=
0
;
j
<
numRowAnnotations
;
j
++
)
{
...
@@ -119,7 +119,7 @@ morpheus.GctReader.prototype = {
...
@@ -119,7 +119,7 @@ morpheus.GctReader.prototype = {
columnMetadata
.
push
(
v
);
columnMetadata
.
push
(
v
);
columnMetadataNames
.
push
(
metadataName
);
columnMetadataNames
.
push
(
metadataName
);
for
(
var
j
=
0
;
j
<
ncols
;
j
++
)
{
for
(
var
j
=
0
;
j
<
ncols
;
j
++
)
{
v
.
push
(
String
(
tokens
[
j
+
dataColumnStart
]));
v
.
push
(
morpheus
.
Util
.
copy
String
(
tokens
[
j
+
dataColumnStart
]));
}
}
}
else
{
// data lines
}
else
{
// data lines
if
(
tokens
[
0
]
!==
''
)
{
if
(
tokens
[
0
]
!==
''
)
{
...
@@ -130,7 +130,7 @@ morpheus.GctReader.prototype = {
...
@@ -130,7 +130,7 @@ morpheus.GctReader.prototype = {
for
(
var
rowAnnotationIndex
=
0
;
rowAnnotationIndex
<=
numRowAnnotations
;
rowAnnotationIndex
++
)
{
for
(
var
rowAnnotationIndex
=
0
;
rowAnnotationIndex
<=
numRowAnnotations
;
rowAnnotationIndex
++
)
{
var
rowMetadataValue
=
tokens
[
rowAnnotationIndex
];
var
rowMetadataValue
=
tokens
[
rowAnnotationIndex
];
rowMetadata
[
rowAnnotationIndex
].
push
(
rowMetadata
[
rowAnnotationIndex
].
push
(
String
(
rowMetadataValue
));
morpheus
.
Util
.
copy
String
(
rowMetadataValue
));
}
}
...
@@ -256,7 +256,7 @@ morpheus.GctReader.prototype = {
...
@@ -256,7 +256,7 @@ morpheus.GctReader.prototype = {
var
index
=
j
+
numRowAnnotations
+
1
;
var
index
=
j
+
numRowAnnotations
+
1
;
var
columnName
=
index
<
columnNamesArray
.
length
?
columnNamesArray
[
index
]
var
columnName
=
index
<
columnNamesArray
.
length
?
columnNamesArray
[
index
]
:
null
;
:
null
;
columnMetadata
[
0
].
push
(
String
(
columnName
));
columnMetadata
[
0
].
push
(
morpheus
.
Util
.
copy
String
(
columnName
));
}
}
for
(
var
j
=
0
;
j
<
numRowAnnotations
;
j
++
)
{
for
(
var
j
=
0
;
j
<
numRowAnnotations
;
j
++
)
{
...
@@ -278,7 +278,7 @@ morpheus.GctReader.prototype = {
...
@@ -278,7 +278,7 @@ morpheus.GctReader.prototype = {
columnMetadata
.
push
(
v
);
columnMetadata
.
push
(
v
);
columnMetadataNames
.
push
(
metadataName
);
columnMetadataNames
.
push
(
metadataName
);
for
(
var
j
=
0
;
j
<
ncols
;
j
++
)
{
for
(
var
j
=
0
;
j
<
ncols
;
j
++
)
{
v
.
push
(
String
(
tokens
[
j
+
dataColumnStart
]));
v
.
push
(
morpheus
.
Util
.
copy
String
(
tokens
[
j
+
dataColumnStart
]));
}
}
}
}
}
}
...
@@ -296,7 +296,7 @@ morpheus.GctReader.prototype = {
...
@@ -296,7 +296,7 @@ morpheus.GctReader.prototype = {
for
(
var
rowAnnotationIndex
=
0
;
rowAnnotationIndex
<
numRowAnnotationsPlusOne
;
rowAnnotationIndex
++
)
{
for
(
var
rowAnnotationIndex
=
0
;
rowAnnotationIndex
<
numRowAnnotationsPlusOne
;
rowAnnotationIndex
++
)
{
var
rowMetadataValue
=
tokens
[
rowAnnotationIndex
];
var
rowMetadataValue
=
tokens
[
rowAnnotationIndex
];
rowMetadata
[
rowAnnotationIndex
].
push
(
rowMetadata
[
rowAnnotationIndex
].
push
(
String
(
rowMetadataValue
));
morpheus
.
Util
.
copy
String
(
rowMetadataValue
));
}
}
...
@@ -339,13 +339,13 @@ morpheus.GctReader.prototype = {
...
@@ -339,13 +339,13 @@ morpheus.GctReader.prototype = {
var
index
=
j
+
numRowAnnotations
+
1
;
var
index
=
j
+
numRowAnnotations
+
1
;
var
columnName
=
index
<
columnNamesArray
.
length
?
columnNamesArray
[
index
]
var
columnName
=
index
<
columnNamesArray
.
length
?
columnNamesArray
[
index
]
:
null
;
:
null
;
columnIds
.
setValue
(
j
,
String
(
columnName
));
columnIds
.
setValue
(
j
,
morpheus
.
Util
.
copy
String
(
columnName
));
}
}
}
else
{
}
else
{
for
(
var
j
=
0
;
j
<
ncols
;
j
++
)
{
for
(
var
j
=
0
;
j
<
ncols
;
j
++
)
{
var
columnName
=
columnNamesArray
[
j
+
numRowAnnotations
+
1
];
var
columnName
=
columnNamesArray
[
j
+
numRowAnnotations
+
1
];
columnIds
.
setValue
(
j
,
String
(
columnName
));
columnIds
.
setValue
(
j
,
morpheus
.
Util
.
copy
String
(
columnName
));
}
}
}
}
...
@@ -373,7 +373,7 @@ morpheus.GctReader.prototype = {
...
@@ -373,7 +373,7 @@ morpheus.GctReader.prototype = {
var
metadataName
=
tokens
[
0
];
var
metadataName
=
tokens
[
0
];
var
v
=
dataset
.
getColumnMetadata
().
add
(
metadataName
);
var
v
=
dataset
.
getColumnMetadata
().
add
(
metadataName
);
for
(
var
j
=
0
;
j
<
ncols
;
j
++
)
{
for
(
var
j
=
0
;
j
<
ncols
;
j
++
)
{
v
.
setValue
(
j
,
String
(
tokens
[
j
+
dataColumnStart
]));
v
.
setValue
(
j
,
morpheus
.
Util
.
copy
String
(
tokens
[
j
+
dataColumnStart
]));
}
}
}
}
}
}
...
@@ -388,19 +388,19 @@ morpheus.GctReader.prototype = {
...
@@ -388,19 +388,19 @@ morpheus.GctReader.prototype = {
}
}
var
tokens
=
s
.
split
(
tab
);
var
tokens
=
s
.
split
(
tab
);
if
(
version
===
2
)
{
if
(
version
===
2
)
{
rowAnnotationVectors
[
0
].
setValue
(
rowIndex
,
String
(
tokens
[
0
]));
rowAnnotationVectors
[
0
].
setValue
(
rowIndex
,
morpheus
.
Util
.
copy
String
(
tokens
[
0
]));
var
desc
=
tokens
[
1
];
var
desc
=
tokens
[
1
];
if
(
!
nonEmptyDescriptionFound
)
{
if
(
!
nonEmptyDescriptionFound
)
{
nonEmptyDescriptionFound
=
desc
!==
''
;
nonEmptyDescriptionFound
=
desc
!==
''
;
}
}
rowAnnotationVectors
[
1
].
setValue
(
rowIndex
,
String
(
desc
));
rowAnnotationVectors
[
1
].
setValue
(
rowIndex
,
morpheus
.
Util
.
copy
String
(
desc
));
}
else
{
}
else
{
// we iterate to numRowAnnotations + 1 to include id row
// we iterate to numRowAnnotations + 1 to include id row
// metadata field
// metadata field
for
(
var
rowAnnotationIndex
=
0
;
rowAnnotationIndex
<
numRowAnnotationsPlusOne
;
rowAnnotationIndex
++
)
{
for
(
var
rowAnnotationIndex
=
0
;
rowAnnotationIndex
<
numRowAnnotationsPlusOne
;
rowAnnotationIndex
++
)
{
var
rowMetadataValue
=
tokens
[
rowAnnotationIndex
];
var
rowMetadataValue
=
tokens
[
rowAnnotationIndex
];
rowAnnotationVectors
[
rowAnnotationIndex
].
setValue
(
rowIndex
,
rowAnnotationVectors
[
rowAnnotationIndex
].
setValue
(
rowIndex
,
String
(
rowMetadataValue
));
morpheus
.
Util
.
copy
String
(
rowMetadataValue
));
}
}
}
}
...
...
src/util/util.js
View file @
962d2c09
...
@@ -142,6 +142,13 @@ morpheus.Util.getWindowSearchObject = function () {
...
@@ -142,6 +142,13 @@ morpheus.Util.getWindowSearchObject = function () {
return
_
.
extend
(
hashObject
,
searchObject
);
return
_
.
extend
(
hashObject
,
searchObject
);
};
};
morpheus
.
Util
.
copyString
=
function
(
s
)
{
var
copy
=
''
;
for
(
var
i
=
0
,
end
=
s
.
length
;
i
<
end
;
i
++
)
{
copy
+=
s
[
i
];
}
return
copy
;
};
morpheus
.
Util
.
getQueryParams
=
function
(
s
)
{
morpheus
.
Util
.
getQueryParams
=
function
(
s
)
{
var
params
=
{};
var
params
=
{};
if
(
!
s
)
{
if
(
!
s
)
{
...
@@ -198,11 +205,7 @@ morpheus.Util.getFileName = function (fileOrUrl) {
...
@@ -198,11 +205,7 @@ morpheus.Util.getFileName = function (fileOrUrl) {
return
fileOrUrl
.
name
;
return
fileOrUrl
.
name
;
}
}
var
name
=
''
+
fileOrUrl
;
var
name
=
''
+
fileOrUrl
;
var
slash
=
name
.
lastIndexOf
(
'
/
'
);
if
(
slash
!==
-
1
&&
slash
<
name
.
length
-
1
)
{
// https://s3.amazonaws.com/data.clue.io/icv/dosval/BRD-K45711268_10_UM_24_H/pcl_cell.gct?AWSAccessKeyId=AKIAJZQISWLUKFS3VUKA&Expires=1455761050&Signature=HVle9MvXV3OGRZHOngdm2frqER8%3D
name
=
name
.
substring
(
slash
+
1
);
// get stuff after slash
}
var
question
=
name
.
indexOf
(
'
?
'
);
var
question
=
name
.
indexOf
(
'
?
'
);
if
(
question
!==
-
1
)
{
if
(
question
!==
-
1
)
{
var
params
=
name
.
substring
(
question
+
1
);
var
params
=
name
.
substring
(
question
+
1
);
...
@@ -216,6 +219,12 @@ morpheus.Util.getFileName = function (fileOrUrl) {
...
@@ -216,6 +219,12 @@ morpheus.Util.getFileName = function (fileOrUrl) {
break
;
break
;
}
}
}
}
}
else
{
var
slash
=
name
.
lastIndexOf
(
'
/
'
);
if
(
slash
!==
-
1
&&
slash
<
name
.
length
-
1
)
{
// https://s3.amazonaws.com/data.clue.io/icv/dosval/BRD-K45711268_10_UM_24_H/pcl_cell.gct?AWSAccessKeyId=AKIAJZQISWLUKFS3VUKA&Expires=1455761050&Signature=HVle9MvXV3OGRZHOngdm2frqER8%3D
name
=
name
.
substring
(
slash
+
1
);
// get stuff after slash
}
}
}
return
name
;
return
name
;
};
};
...
...
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