Commit 6853e4a2 authored by Severine Duvaud's avatar Severine Duvaud
Browse files

Do not allow minLength and maxLength to be compliant with 0.3

parent a632d519
......@@ -94,6 +94,8 @@ function checkPreconditions(params) {
};
}
// Do not allow minLength and maxLength to be compliant with 0.3
/*
if (params.minlength && !Number(params.minlength)) {
return {
hasError: true,
......@@ -106,7 +108,7 @@ function checkPreconditions(params) {
hasError: true,
msg: "max length not a number"
};
}
}*/
//TODO add additional checks
......@@ -142,6 +144,8 @@ function buildMongoQuery(params) {
var position = parseInt(params.start);
// Do not allow minLength and maxLength to be compliant with 0.3
/*
if(params.alternateBases == 'DEL') {
var minLength = params.minlength ? parseInt(params.minlength) : 0;
......@@ -151,7 +155,7 @@ function buildMongoQuery(params) {
minLength = 1;
}
}
}*/
var andConditions = [];
var orConditions = [];
......@@ -180,6 +184,8 @@ function buildMongoQuery(params) {
//elem match element
var condElemMatch = condition[convertedReference]['$elemMatch'];
// Do not allow minLength and maxLength to be compliant with 0.3
/*
if (minLength > 0) { //There is a minLength
if (maxLength > 0) { //There is always a minLenght, if there is a max length specified (see code above)
condElemMatch.SEGSIZE = { $gte: minLength,$lte: maxLength } // min. and max lengths
......@@ -189,9 +195,10 @@ function buildMongoQuery(params) {
condElemMatch.SEGSTART = position; // exact position
}
}else { //If there is a position specific
*/
condElemMatch.SEGSTOP = { $gte: position };
condElemMatch.SEGSTART = { $lte: position };
}
//}
andConditions.push(condition);
if (orConditions.length > 0) {
......@@ -219,7 +226,9 @@ function buildMongoQuery(params) {
function checkResultAndGetResponse(params, datasets) {
var length = 0;
// Do not allow minLength and maxLength to be compliant with 0.3
// var length = 0;
/*
if (typeof params.minlength != undefined && params.minlength != null && params.minlength != '')
{
length = parseInt(params.minlength);
......@@ -233,7 +242,7 @@ function checkResultAndGetResponse(params, datasets) {
{
maxLength = parseInt(params.maxlength);
}
*/
var responses = [];
// The query returns only datasets for which there is at least one sample with at least one matching SEGMENT...
......@@ -305,9 +314,12 @@ function checkResultAndGetResponse(params, datasets) {
"start": params.start,
"assemblyId": params.assemblyId,
"datasetIds": params.datasetIds,
"alternateBases": params.alternateBases,
"alternateBases": params.alternateBases
// Do not allow minLength and maxLength to be compliant with 0.3
/*
"length": length,
"maxlength": maxLength
*/
};
// BeaconAlleleResponse
......
......@@ -22,9 +22,12 @@ arrayMap.controller('BeaconController', ['$scope', '$location', function ($scope
"start": 34439881,
"assemblyId": "GRCh38",
"datasetIds": "8070/3",
"alternateBases": "DEL",
"alternateBases": "DEL"
// Do not allow minLength and maxLength to be compliant with 0.3
/*
"minlength": '',
"maxlength": ''
*/
};
......@@ -41,9 +44,12 @@ arrayMap.controller('BeaconController', ['$scope', '$location', function ($scope
"&start=" + conf.start +
"&assemblyId=" + conf.assemblyId +
"&datasetIds=" + conf.datasetIds +
((conf.alternateBases === "") ? "all" : "&alternateBases=" + conf.alternateBases) +
((conf.alternateBases === "") ? "all" : "&alternateBases=" + conf.alternateBases);
// Do not allow minLength and maxLength to be compliant with 0.3
/*
((conf.minlength === '') ? "" : "&minlength=" + conf.minlength) +
((conf.maxlength === '') ? "" : "&maxlength=" + conf.maxlength);
*/
};
$scope.getInfoUrl = function () {
......
......@@ -47,6 +47,8 @@
</select>
</div>
</div>
<!-- Do not allow minLength and maxLength to be compliant with 0.3
<div class="form-group">
<label for="minlength" class="col-sm-2 control-label">Minimal length</label>
<div class="col-sm-4">
......@@ -59,7 +61,7 @@
<div class="col-sm-4">
<input type="text" class="form-control" id="maxlength" ng-model="config.maxlength" placeholder="Max bases for the selected chromosome">
</div>
</div>
</div>-->
<div class="form-group">
<div class="col-sm-offset-2 col-sm-8">
......
Supports Markdown
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