Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
ga4gh-arraymap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Baudis
ga4gh-arraymap
Commits
576aa549
Commit
576aa549
authored
Apr 13, 2016
by
Severine Duvaud
Browse files
Options
Downloads
Patches
Plain Diff
Beacon version 0.3: Handling of datasetIds
parent
4817ee85
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/node-app/arraymap-beacon/v0.3/beacon-query.js
+23
-18
23 additions, 18 deletions
app/node-app/arraymap-beacon/v0.3/beacon-query.js
with
23 additions
and
18 deletions
app/node-app/arraymap-beacon/v0.3/beacon-query.js
+
23
−
18
View file @
576aa549
...
...
@@ -56,6 +56,13 @@ function checkPreconditions(params) {
};
}
if
(
!
params
.
datasetIds
)
{
return
{
hasError
:
true
,
msg
:
"
No dataset provided
"
};
}
console
.
log
(
Boolean
(
variantClassMap
[
params
.
variantClass
]));
if
(
!
params
.
variantClass
)
{
...
...
@@ -78,20 +85,21 @@ function checkPreconditions(params) {
}
function
buildMongoQuery
(
params
)
{
var
position
=
parseInt
(
params
.
start
);
var
conditions
=
[];
//add constraint on dataset if it exsits
if
(
params
.
dataset
)
conditions
.
push
({
ICDMORPHOLOGYCODE
:
params
.
dataset
var
andConditions
=
[];
var
orConditions
=
[];
//add constraint on datasets if required
if
(
params
.
datasetIds
){
var
identifiers
=
params
.
datasetIds
.
split
(
'
,
'
);
// comma separated list of datasets
identifiers
.
forEach
(
function
(
id
)
{
orConditions
.
push
({
ICDMORPHOLOGYCODE
:
id
});
});
}
var
segType
=
variantClassMap
[
params
.
variantClass
]
var
convertedReference
=
referenceMap
[
params
.
assemblyId
||
defaultReference
];
var
cond
=
{};
...
...
@@ -107,10 +115,11 @@ function buildMongoQuery(params) {
}
}
}
andConditions
.
push
(
cond
);
andConditions
.
push
({
$or
:
orConditions
});
conditions
.
push
(
cond
);
return
{
$and
:
c
onditions
$and
:
andC
onditions
};
}
...
...
@@ -142,7 +151,7 @@ function checkResultAndGetResponse(params, samples, countTotal) {
"
referenceName
"
:
params
.
referenceName
,
"
start
"
:
params
.
start
,
"
assemblyId
"
:
params
.
assemblyId
,
"
dataset
id
"
:
params
.
dataset
"
dataset
Ids
"
:
params
.
dataset
Ids
};
...
...
@@ -156,15 +165,13 @@ function checkResultAndGetResponse(params, samples, countTotal) {
function
checkResult
(
params
,
sample
)
{
var
convertedReference
=
referenceMap
[
params
.
reference
||
defaultReference
];
var
convertedReference
=
referenceMap
[
params
.
assemblyId
||
defaultReference
];
var
expectedSegType
=
variantClassMap
[
params
.
variantClass
]
var
position
=
parseInt
(
params
.
start
);
//TODO should check for dataset and genomre reference as well
//TODO should check for datasets and genome reference as well
var
foundSegment
;
sample
[
convertedReference
].
forEach
(
function
(
segment
)
{
if
(
segment
.
CHRO
===
params
.
referenceName
)
{
...
...
@@ -179,7 +186,6 @@ function checkResult(params, sample) {
}
})
var
result
=
{
matchedSampleUID
:
sample
.
UID
,
matchedDataSet
:
sample
.
ICDMORPHOLOGYCODE
,
...
...
@@ -188,7 +194,6 @@ function checkResult(params, sample) {
return
result
;
}
module
.
exports
.
checkPreconditions
=
checkPreconditions
;
module
.
exports
.
buildMongoQuery
=
buildMongoQuery
;
module
.
exports
.
checkResultAndGetResponse
=
checkResultAndGetResponse
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment