Commit 442fdf7f authored by Severine Duvaud's avatar Severine Duvaud
Browse files

Added the new info + match type fields. This will be revised at some point...

Added the new info + match type fields. This will be revised at some point once PR 65 has been accepted
parent 928a643b
......@@ -138,12 +138,16 @@ function checkPreconditions(params) {
* */
function buildMongoQuery(params) {
/*
* ALTBASEINFO: 'END=42134902;SVLEN=85689;CIPOS=-500,500;CIEND=-500,500'
* MATCHTYPE: any
*/
console.log("ALTBASEINFO: " + params.alternateBasesInfo);
console.log("MATCHTYPE: " + params.matchType);
var position = parseInt(params.start, 10);
var length = params.alternateBases.replace(/(DUP|DEL)/, "") ? parseInt(params.alternateBases.replace(/(DUP|DEL)/, ""), 10) : 0;
var tmp2 = parseInt(params.start, 10);
console.log("TMP IS: " + tmp2);
var andConditions = [];
var orConditions = [];
......@@ -159,7 +163,7 @@ function buildMongoQuery(params) {
// Beacon 0.4
// alternate bases: DEL[0-9]* AND DUP[0-9]*
var segType = alternateBasesMap[params.alternateBases.replace(/\d+/, "")]
var segType = alternateBasesMap[params.alternateBases.replace(/\d+/, "")];
var convertedReference = referenceMap[params.assemblyId || defaultReference];
var condition = {};
......
......@@ -54,7 +54,10 @@ arrayMap.controller('BeaconController', ['$scope', '$location', 'BeaconService',
"assemblyId": "GRCh38",
"datasetIds": "8010/2",
"alternateBases": "DEL",
"length": '85689'
"length": '85689',
"confidenceIntervalStart": 500,
"confidenceIntervalEnd": 500,
"matchType": "any"
};
$scope.datasetConfig = {
......@@ -64,6 +67,7 @@ arrayMap.controller('BeaconController', ['$scope', '$location', 'BeaconService',
$scope.getNewApiUrl = function () {
var conf = $scope.config;
var end = parseInt(conf.start) + parseInt(conf.length) - 1;
return $location.absUrl() + "query?" +
"referenceName=" + conf.referenceName +
......@@ -71,7 +75,12 @@ arrayMap.controller('BeaconController', ['$scope', '$location', 'BeaconService',
"&assemblyId=" + conf.assemblyId +
"&datasetIds=" + conf.datasetIds +
((conf.alternateBases === "") ? "all" : "&alternateBases=" + conf.alternateBases) +
((conf.length === '') ? "" : conf.length);
"&alternateBasesInfo='" +
"END=" + end +
";SVLEN=" + conf.length +
";CIPOS=-" + conf.confidenceIntervalStart + "," + conf.confidenceIntervalStart +
";CIEND=-" + conf.confidenceIntervalEnd + "," + conf.confidenceIntervalEnd + "'" +
"&matchType=" + conf.matchType;
};
$scope.getInfoUrl = function () {
......
......@@ -11,12 +11,21 @@
<input type="text" class="form-control" id="referenceName" ng-model="config.referenceName" placeholder="corresponds to chromosome name, ex: 11">
</div>
</div>
<div class="form-group">
<label for="start" class="col-sm-2 control-label">Start</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="start" ng-model="config.start" placeholder="start position, ex: 34439881">
</div>
</div>
<div class="form-group">
<label for="length" class="col-sm-2 control-label">Length</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="length" ng-model="config.length" placeholder="">
</div>
</div>
<div class="form-group">
<label for="referenceSelect" class="col-sm-2 control-label">Assembly ID</label>
<div class="col-sm-4">
......@@ -25,6 +34,7 @@
</select>
</div>
</div>
<div class="form-group">
<label for="datasetSelect" class="col-sm-2 control-label">Dataset Ids</label>
<div class="col-sm-4">
......@@ -33,6 +43,7 @@
</select>
</div>
</div>
<div class="form-group">
<label for="alternateBases" class="col-sm-2 control-label">Alternate bases</label>
<div class="col-sm-4">
......@@ -44,26 +55,29 @@
</div>
<div class="form-group">
<label for="length" class="col-sm-2 control-label">Length</label>
<label for="confidenceIntervalStart" class="col-sm-2 control-label">Confidence Interval<br/>(Start position)</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="length" ng-model="config.length" placeholder="">
<input type="text" class="form-control" id="confidenceIntervalStart" ng-model="config.confidenceIntervalStart">
</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>
<label for="confidenceIntervalEnd" class="col-sm-2 control-label">Confidence Interval<br/>(End position)</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="minlength" ng-model="config.minlength" placeholder="1">
<input type="text" class="form-control" id="confidenceIntervalEnd" ng-model="config.confidenceIntervalEnd">
</div>
</div>
<div class="form-group">
<label for="maxlength" class="col-sm-2 control-label">Maximal length</label>
<label for="matchType" class="col-sm-2 control-label">Match type</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="maxlength" ng-model="config.maxlength" placeholder="Max bases for the selected chromosome">
<select id="matchType" ng-model="config.matchType" class="form-control">
<option value="any">Any</option>
<option value="complete">Complete</option>
<option value="precise">Precise</option>
</select>
</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