Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
90517ee5
Commit
90517ee5
authored
Jul 06, 2018
by
Piotr Gawron
Browse files
opening genomics on submap fixed
parent
770e7fbf
Changes
9
Hide whitespace changes
Inline
Side-by-side
frontend-js/src/main/js/map/data/DataOverlay.js
View file @
90517ee5
...
...
@@ -210,7 +210,7 @@ DataOverlay.prototype.getFullAliasById = function (id) {
var
self
=
this
;
var
alias
=
self
.
getAliasById
(
id
);
if
(
alias
!==
undefined
)
{
if
(
alias
.
getType
()
===
LayoutAlias
.
LIG
T
H
)
{
if
(
alias
.
getType
()
===
LayoutAlias
.
LIGH
T
)
{
return
ServerConnector
.
getFullOverlayElement
({
element
:
new
IdentifiedElement
(
alias
),
overlay
:
self
...
...
frontend-js/src/main/js/map/data/LayoutAlias.js
View file @
90517ee5
...
...
@@ -15,7 +15,7 @@ function LayoutAlias(javaObject) {
this
.
setModelId
(
javaObject
.
modelId
);
this
.
setDescription
(
javaObject
.
description
);
if
(
javaObject
.
type
===
undefined
)
{
this
.
setType
(
LayoutAlias
.
LIG
T
H
);
this
.
setType
(
LayoutAlias
.
LIGH
T
);
}
else
if
(
javaObject
.
type
===
LayoutAlias
.
GENETIC_VARIANT
)
{
this
.
setType
(
LayoutAlias
.
GENETIC_VARIANT
);
}
else
if
(
javaObject
.
type
===
LayoutAlias
.
GENERIC
)
{
...
...
frontend-js/src/main/js/map/window/AliasInfoWindow.js
View file @
90517ee5
...
...
@@ -291,7 +291,7 @@ AliasInfoWindow.prototype.createGenomicDiv = function () {
if
(
data
!==
null
&&
data
!==
undefined
&&
data
.
getType
()
===
LayoutAlias
.
GENETIC_VARIANT
)
{
geneticInformation
=
true
;
return
Promise
.
each
(
data
.
getGeneVariants
(),
function
(
variant
)
{
return
self
.
getCustomMap
().
getReferenceGenome
(
variant
.
getReferenceGenomeType
(),
return
self
.
getCustomMap
().
getTopMap
().
getReferenceGenome
(
variant
.
getReferenceGenomeType
(),
variant
.
getReferenceGenomeVersion
()).
then
(
function
(
genome
)
{
if
(
genome
.
getUrl
()
!==
null
&&
genome
.
getUrl
()
!==
undefined
)
{
...
...
frontend-js/src/test/js/helper.js
View file @
90517ee5
...
...
@@ -220,6 +220,11 @@ Helper.prototype.createAlias = function (map) {
return
result
;
};
/**
*
* @param {Alias} [alias]
* @returns {LayoutAlias}
*/
Helper
.
prototype
.
createLayoutAlias
=
function
(
alias
)
{
var
id
;
var
modelId
;
...
...
@@ -237,7 +242,7 @@ Helper.prototype.createLayoutAlias = function (alias) {
a
:
23
},
modelId
:
modelId
,
geneVariations
:
[
{}
]
geneVariations
:
[]
});
};
...
...
frontend-js/src/test/js/map/window/AliasInfoWindow-test.js
View file @
90517ee5
...
...
@@ -7,6 +7,7 @@ var Promise = require("bluebird");
var
functions
=
require
(
'
../../../../main/js/Functions
'
);
var
Alias
=
require
(
'
../../../../main/js/map/data/Alias
'
);
var
LayoutAlias
=
require
(
'
../../../../main/js/map/data/LayoutAlias
'
);
var
Drug
=
require
(
'
../../../../main/js/map/data/Drug
'
);
var
GeneVariant
=
require
(
'
../../../../main/js/map/data/GeneVariant
'
);
var
AliasInfoWindow
=
require
(
'
../../../../main/js/map/window/AliasInfoWindow
'
);
...
...
@@ -220,107 +221,144 @@ describe('AliasInfoWindow', function () {
});
});
xit
(
"
createGeneticsDiv
"
,
function
()
{
var
map
;
var
overlay
;
var
layoutAlias
;
var
win
;
return
ServerConnector
.
getProject
().
then
(
function
(
project
)
{
map
=
helper
.
createCustomMap
(
project
);
overlay
=
new
DataOverlay
(
18077
,
"
xxx
"
);
return
overlay
.
init
();
}).
then
(
function
()
{
return
overlay
.
getFullAliasById
(
overlay
.
getAliases
()[
0
].
getId
());
}).
then
(
function
(
data
)
{
layoutAlias
=
data
;
return
map
.
getModel
().
getAliasById
(
layoutAlias
.
getId
());
}).
then
(
function
(
alias
)
{
win
=
new
AliasInfoWindow
({
alias
:
alias
,
map
:
map
,
marker
:
helper
.
createMarker
({
element
:
alias
,
map
:
map
})
describe
(
"
createGeneticsDiv
"
,
function
()
{
it
(
"
on top map
"
,
function
()
{
var
map
;
var
overlay
;
var
layoutAlias
;
var
win
;
return
ServerConnector
.
getProject
().
then
(
function
(
project
)
{
map
=
helper
.
createCustomMap
(
project
);
overlay
=
new
DataOverlay
(
18077
,
"
xxx
"
);
return
overlay
.
init
();
}).
then
(
function
()
{
return
overlay
.
getFullAliasById
(
overlay
.
getAliases
()[
0
].
getId
());
}).
then
(
function
(
data
)
{
layoutAlias
=
data
;
return
map
.
getModel
().
getAliasById
(
layoutAlias
.
getId
());
}).
then
(
function
(
alias
)
{
win
=
new
AliasInfoWindow
({
alias
:
alias
,
map
:
map
,
marker
:
helper
.
createMarker
({
element
:
alias
,
map
:
map
})
});
return
win
.
init
();
}).
then
(
function
()
{
win
.
layoutAliases
=
[
layoutAlias
];
win
.
layoutNames
=
[
"
xxx
"
];
return
win
.
createGenomicDiv
();
}).
then
(
function
(
div
)
{
assert
.
ok
(
div
);
assert
.
ok
(
div
.
innerHTML
.
indexOf
(
"
No reference genome data available on minerva platform
"
)
===
-
1
);
win
.
destroy
();
});
return
win
.
init
();
}).
then
(
function
()
{
win
.
layoutAliases
=
[
layoutAlias
];
win
.
layoutNames
=
[
"
xxx
"
];
return
win
.
createGenomicDiv
();
}).
then
(
function
(
div
)
{
assert
.
ok
(
div
);
assert
.
ok
(
div
.
innerHTML
.
indexOf
(
"
No reference genome data available on minerva platform
"
)
===
-
1
);
win
.
destroy
();
});
});
it
(
"
createGeneticsDiv with no genetic data
"
,
function
()
{
var
map
;
var
win
;
var
aliasId
=
329173
;
});
return
ServerConnector
.
getProject
().
then
(
function
(
project
)
{
map
=
helper
.
createCustomMap
(
project
);
var
overlay
=
new
DataOverlay
(
18077
,
"
xxx
"
);
return
overlay
.
init
();
}).
then
(
function
()
{
return
map
.
getModel
().
getAliasById
(
aliasId
);
}).
then
(
function
(
alias
)
{
win
=
new
AliasInfoWindow
({
alias
:
alias
,
map
:
map
,
marker
:
helper
.
createMarker
({
element
:
alias
,
map
:
map
})
it
(
"
on submap map
"
,
function
()
{
helper
.
setUrl
(
"
http://test/?id=complex_model_with_submaps
"
);
var
map
,
submap
,
overlay
,
win
,
alias
;
return
ServerConnector
.
getProject
().
then
(
function
(
project
)
{
map
=
helper
.
createCustomMap
(
project
);
submap
=
map
.
getSubmapById
(
16731
);
overlay
=
new
DataOverlay
(
18077
,
"
xxx
"
);
overlay
.
setInitialized
(
true
);
return
map
.
openSubmap
(
submap
.
getId
());
}).
then
(
function
()
{
return
submap
.
getModel
().
getAliasById
(
345337
);
}).
then
(
function
(
data
)
{
alias
=
data
;
win
=
new
AliasInfoWindow
({
alias
:
alias
,
map
:
submap
,
marker
:
helper
.
createMarker
({
element
:
alias
,
map
:
submap
})
});
return
win
.
init
();
}).
then
(
function
()
{
var
layoutAlias
=
helper
.
createLayoutAlias
(
alias
);
layoutAlias
.
setType
(
LayoutAlias
.
GENETIC_VARIANT
);
win
.
layoutAliases
=
[
layoutAlias
];
win
.
layoutNames
=
[
"
xxx
"
];
return
win
.
createGenomicDiv
();
}).
then
(
function
(
div
)
{
assert
.
ok
(
div
);
win
.
destroy
();
return
map
.
destroy
();
});
return
win
.
init
();
}).
then
(
function
()
{
win
.
layoutAliases
=
[
undefined
];
return
win
.
createGenomicDiv
();
}).
then
(
function
(
div
)
{
assert
.
ok
(
div
);
assert
.
ok
(
div
.
innerHTML
.
indexOf
(
"
No reference genome data available on minerva platform
"
)
===
-
1
);
win
.
destroy
();
});
});
});
it
(
"
createGeneticsDivForUnknownOrganism
"
,
function
()
{
var
map
;
var
overlay
;
it
(
"
with no genetic data
"
,
function
()
{
var
map
;
var
win
;
var
aliasId
=
329173
;
return
ServerConnector
.
getProject
().
then
(
function
(
project
)
{
map
=
helper
.
createCustomMap
(
project
);
var
overlay
=
new
DataOverlay
(
18077
,
"
xxx
"
);
return
overlay
.
init
();
}).
then
(
function
()
{
return
map
.
getModel
().
getAliasById
(
aliasId
);
}).
then
(
function
(
alias
)
{
win
=
new
AliasInfoWindow
({
alias
:
alias
,
map
:
map
,
marker
:
helper
.
createMarker
({
element
:
alias
,
map
:
map
})
});
return
win
.
init
();
}).
then
(
function
()
{
win
.
layoutAliases
=
[
undefined
];
return
win
.
createGenomicDiv
();
}).
then
(
function
(
div
)
{
assert
.
ok
(
div
);
assert
.
ok
(
div
.
innerHTML
.
indexOf
(
"
No reference genome data available on minerva platform
"
)
===
-
1
);
win
.
destroy
();
});
var
layoutAlias
;
var
win
;
});
return
ServerConnector
.
getProject
().
then
(
function
(
project
)
{
project
.
setOrganism
({
type
:
"
TAXONOMY
"
,
resource
:
"
123456
"
it
(
"
for unknown organism
"
,
function
()
{
var
map
;
var
overlay
;
var
layoutAlias
;
var
win
;
return
ServerConnector
.
getProject
().
then
(
function
(
project
)
{
project
.
setOrganism
({
type
:
"
TAXONOMY
"
,
resource
:
"
123456
"
});
map
=
helper
.
createCustomMap
(
project
);
overlay
=
new
DataOverlay
(
18077
,
"
xxx
"
);
return
overlay
.
init
();
}).
then
(
function
()
{
return
overlay
.
getFullAliasById
(
overlay
.
getAliases
()[
0
].
getId
());
}).
then
(
function
(
data
)
{
layoutAlias
=
data
;
return
map
.
getModel
().
getAliasById
(
layoutAlias
.
getId
());
}).
then
(
function
(
alias
)
{
win
=
new
AliasInfoWindow
({
alias
:
alias
,
map
:
map
,
marker
:
helper
.
createMarker
({
element
:
alias
,
map
:
map
})
});
return
win
.
init
();
}).
then
(
function
()
{
win
.
layoutAliases
=
[
layoutAlias
];
return
win
.
createGenomicDiv
();
}).
then
(
function
(
div
)
{
assert
.
ok
(
div
);
assert
.
ok
(
div
.
innerHTML
.
indexOf
(
"
No reference genome data available on minerva platform
"
)
>=
-
1
);
win
.
destroy
();
});
map
=
helper
.
createCustomMap
(
project
);
overlay
=
new
DataOverlay
(
18077
,
"
xxx
"
);
return
overlay
.
init
();
}).
then
(
function
()
{
return
overlay
.
getFullAliasById
(
overlay
.
getAliases
()[
0
].
getId
());
}).
then
(
function
(
data
)
{
layoutAlias
=
data
;
return
map
.
getModel
().
getAliasById
(
layoutAlias
.
getId
());
}).
then
(
function
(
alias
)
{
win
=
new
AliasInfoWindow
({
alias
:
alias
,
map
:
map
,
marker
:
helper
.
createMarker
({
element
:
alias
,
map
:
map
})
});
return
win
.
init
();
}).
then
(
function
()
{
win
.
layoutAliases
=
[
layoutAlias
];
return
win
.
createGenomicDiv
();
}).
then
(
function
(
div
)
{
assert
.
ok
(
div
);
assert
.
ok
(
div
.
innerHTML
.
indexOf
(
"
No reference genome data available on minerva platform
"
)
>=
-
1
);
win
.
destroy
();
});
});
});
it
(
"
createWaitingContentDiv
"
,
function
()
{
...
...
@@ -392,7 +430,7 @@ describe('AliasInfoWindow', function () {
referenceGenomeVersion
:
"
hg19
"
});
var
str
=
aliasWindow
.
createVcfString
([
variant
,
variant2
]);
assert
.
ok
(
str
.
indexOf
(
"
null
"
)
===
-
1
,
"
null shouldn't appear in vcf format
"
);
assert
.
ok
(
str
.
indexOf
(
"
null
"
)
===
-
1
,
"
null shouldn't appear in vcf format
"
);
});
});
frontend-js/testFiles/apiCalls/genomics/taxonomies/1570291/genomeTypes/UCSC/versions/eboVir3/token=MOCK_TOKEN_ID&
0 → 100644
View file @
90517ee5
{"downloadProgress":100.0,"geneMapping":[],"idObject":1830,"localUrl":"../minerva-big//9395/eboVir3.2bit","organism":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1150730,"link":"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=1570291","resource":"1570291","type":"TAXONOMY"},"sourceUrl":"ftp://hgdownload.cse.ucsc.edu/goldenPath/eboVir3/bigZips/eboVir3.2bit","type":"UCSC","version":"eboVir3"}
\ No newline at end of file
frontend-js/testFiles/apiCalls/projects/sample/PATCH_project.disease.resource=D010300&project.disease.type=MESH_2012&project.mapCanvasType=OPEN_LAYERS&project.name=UNKNOWN DISEASE MAP&project.organism.resource=
9606
&project.organism.type=TAXONOMY&project.version=2.01&token=MOCK_TOKEN_ID&
→
frontend-js/testFiles/apiCalls/projects/sample/PATCH_project.disease.resource=D010300&project.disease.type=MESH_2012&project.mapCanvasType=OPEN_LAYERS&project.name=UNKNOWN DISEASE MAP&project.organism.resource=
1570291
&project.organism.type=TAXONOMY&project.version=2.01&token=MOCK_TOKEN_ID&
View file @
90517ee5
File moved
frontend-js/testFiles/apiCalls/projects/sample/token=ADMIN_TOKEN_ID&
View file @
90517ee5
{"version":"0","disease":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104479,"link":"http://bioportal.bioontology.org/ontologies/1351?p=terms&conceptid=D010300","resource":"D010300","type":"MESH_2012"},"organism":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104480,"link":"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=9606","resource":"9606","type":"TAXONOMY"},"idObject":14898,"status":"Ok","directory":"5e8ff9bf55ba3508199d22e984129be6","progress":100.0,"notifyEmail":"","warnings":true,"errors":false,"name":"UNKNOWN DISEASE MAP","projectId":"sample","mapCanvasType":"OPEN_LAYERS","overviewImageViews":[],"topOverviewImage":null}
\ No newline at end of file
{"version":"0","disease":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104479,"link":"http://bioportal.bioontology.org/ontologies/1351?p=terms&conceptid=D010300","resource":"D010300","type":"MESH_2012"},"organism":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104480,"link":"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=1570291","resource":"1570291","type":"TAXONOMY"},"idObject":14898,"status":"Ok","directory":"5e8ff9bf55ba3508199d22e984129be6","progress":100.0,"notifyEmail":"","warnings":true,"errors":false,"name":"UNKNOWN DISEASE MAP","projectId":"sample","mapCanvasType":"OPEN_LAYERS","overviewImageViews":[],"topOverviewImage":null}
\ No newline at end of file
frontend-js/testFiles/apiCalls/projects/sample/token=MOCK_TOKEN_ID&
View file @
90517ee5
{"version":"0","disease":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104479,"link":"http://bioportal.bioontology.org/ontologies/1351?p=terms&conceptid=D010300","resource":"D010300","type":"MESH_2012"},"organism":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104480,"link":"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=9606","resource":"9606","type":"TAXONOMY"},"idObject":14898,"status":"Ok","directory":"5e8ff9bf55ba3508199d22e984129be6","progress":100.0,"notifyEmail":"","warnings":true,"errors":false,"name":"UNKNOWN DISEASE MAP","projectId":"sample","mapCanvasType":"OPEN_LAYERS","overviewImageViews":[],"topOverviewImage":null}
\ No newline at end of file
{"version":"0","disease":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104479,"link":"http://bioportal.bioontology.org/ontologies/1351?p=terms&conceptid=D010300","resource":"D010300","type":"MESH_2012"},"organism":{"annotatorClassName":"","descriptionByType":"","descriptionByTypeRelation":"","id":1104480,"link":"http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=1570291","resource":"1570291","type":"TAXONOMY"},"idObject":14898,"status":"Ok","directory":"5e8ff9bf55ba3508199d22e984129be6","progress":100.0,"notifyEmail":"","warnings":true,"errors":false,"name":"UNKNOWN DISEASE MAP","projectId":"sample","mapCanvasType":"OPEN_LAYERS","overviewImageViews":[],"topOverviewImage":null}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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