Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ST
ga4gh-arraymap
Commits
7047dc4f
Commit
7047dc4f
authored
May 23, 2016
by
Daniel Teixeira
Browse files
adding back genome HG 36
parent
51d2cd77
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/node-app/arraymap-beacon/v0.3/beacon-query.js
View file @
7047dc4f
var
info
=
require
(
'
./beacon-info.js
'
).
info
//check https://genome.ucsc.edu/FAQ/FAQreleases.html
var
referenceMap
=
{
'
GRCh38
'
:
'
SEGMENTS_HG38
'
,
'
GRCh37
'
:
'
SEGMENTS_HG19
'
};
/*
var referenceMap = {
'GRCh38': 'SEGMENTS_HG38',
'GRCh37': 'SEGMENTS_HG19'
};
*/
/*
var referenceMap = {
var
referenceMap
=
{
'
GRCh38
'
:
'
SEGMENTS_HG38
'
,
'
GRCh37
'
:
'
SEGMENTS_HG19
'
,
'
GRCh36
'
:
'
SEGMENTS_HG18
'
};
*/
//correspondence to arraymap class
var
alternateBasesMap
=
{
"
DEL
"
:
-
1
,
...
...
@@ -24,7 +24,7 @@ var alternateBasesMap = {
var
defaultReference
=
'
GRCh38
'
;
function
checkPreconditions
(
params
)
{
if
(
!
params
.
referenceName
)
{
return
{
hasError
:
true
,
...
...
@@ -101,21 +101,15 @@ function buildMongoQuery(params) {
var
position
=
parseInt
(
params
.
start
);
var
length
=
0
;
var
maxLength
=
0
;
if
(
params
.
alternateBases
==
'
DEL
'
)
{
if
(
typeof
params
.
length
!=
undefined
&&
params
.
length
!=
null
&&
params
.
length
!=
''
)
// min. length is provided
{
length
=
(
params
.
length
.
length
==
0
?
0
:
parseInt
(
params
.
length
));
}
if
(
typeof
params
.
maxLength
!=
undefined
&&
params
.
maxLength
!=
null
&&
params
.
maxLength
!=
''
)
// max length is provided
{
maxLength
=
(
params
.
maxLength
.
length
==
0
?
0
:
parseInt
(
params
.
maxLength
));
if
(
length
==
0
)
{
length
++
;
// force min. length in case none is given
}
var
minLength
=
params
.
minlength
?
parseInt
(
params
.
minlength
)
:
0
;
var
maxLength
=
params
.
maxlength
?
parseInt
(
params
.
maxlength
)
:
0
;
if
(
!
minLength
&&
(
maxLength
>
0
)){
minLength
=
1
;
}
}
var
andConditions
=
[];
...
...
@@ -136,49 +130,32 @@ function buildMongoQuery(params) {
var
segType
=
alternateBasesMap
[
params
.
alternateBases
]
var
convertedReference
=
referenceMap
[
params
.
assemblyId
||
defaultReference
];
var
cond
=
{};
if
(
length
>
0
)
{
if
(
maxLength
>
0
)
{
cond
[
convertedReference
]
=
{
'
$elemMatch
'
:
{
'
CHRO
'
:
params
.
referenceName
,
'
SEGTYPE
'
:
segType
,
'
SEGSIZE
'
:
{
$gte
:
length
,
$lte
:
maxLength
},
// min. and max lengths
'
SEGSTART
'
:
position
// exact position
}
}
var
condition
=
{};
condition
[
convertedReference
]
=
{
'
$elemMatch
'
:
{
'
CHRO
'
:
params
.
referenceName
,
'
SEGTYPE
'
:
segType
}
else
{
cond
[
convertedReference
]
=
{
'
$elemMatch
'
:
{
'
CHRO
'
:
params
.
referenceName
,
'
SEGTYPE
'
:
segType
,
'
SEGSIZE
'
:
{
$gte
:
length
},
// min. length
'
SEGSTART
'
:
position
// exact position
}
}
}
}
else
{
cond
[
convertedReference
]
=
{
'
$elemMatch
'
:
{
'
CHRO
'
:
params
.
referenceName
,
'
SEGTYPE
'
:
segType
,
'
SEGSTOP
'
:
{
$gte
:
position
},
'
SEGSTART
'
:
{
$lte
:
position
}
}
};
//elem match element
var
condElemMatch
=
condition
[
convertedReference
][
'
$elemMatch
'
];
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
condElemMatch
.
SEGSTART
=
position
// exact position
}
else
{
//If there is no max length specified
condElemMatch
.
SEGSIZE
=
{
$gte
:
minLength
};
// min. length
condElemMatch
.
SEGSTART
=
position
;
// exact position
}
}
else
{
//If there is a position specifiec
condElemMatch
.
SEGSTOP
=
{
$gte
:
position
};
condElemMatch
.
SEGSTART
=
{
$lte
:
position
};
}
andConditions
.
push
(
cond
);
andConditions
.
push
(
condition
);
if
(
orConditions
.
length
>
0
)
{
andConditions
.
push
({
$or
:
orConditions
});
}
...
...
app/node-app/public/js/index.js
View file @
7047dc4f
...
...
@@ -15,17 +15,16 @@ arrayMap.config(['$routeProvider', '$locationProvider',
arrayMap
.
controller
(
'
BeaconController
'
,
[
'
$scope
'
,
'
$location
'
,
function
(
$scope
,
$location
)
{
//$scope.references = ['GRCh38','GRCh37','GRCh36'];
$scope
.
references
=
[
'
GRCh38
'
,
'
GRCh37
'
];
$scope
.
references
=
[
'
GRCh38
'
,
'
GRCh37
'
,
'
GRCh36
'
];
$scope
.
config
=
{
"
chromoso
me
"
:
""
,
"
position
"
:
''
,
"
reference
"
:
"
GRCh38
"
,
"
dataset
"
:
"
all
"
,
"
referenceNa
me
"
:
"
11
"
,
"
start
"
:
34439881
,
"
assemblyId
"
:
"
GRCh38
"
,
"
dataset
Ids
"
:
"
8070/3
"
,
"
alternateBases
"
:
"
DEL
"
,
"
length
"
:
''
,
"
max
L
ength
"
:
''
"
min
length
"
:
''
,
"
max
l
ength
"
:
''
}
$scope
.
getNewApiUrl
=
function
()
{
...
...
@@ -33,13 +32,13 @@ arrayMap.controller('BeaconController', ['$scope', '$location', function ($scope
var
conf
=
$scope
.
config
;
return
$location
.
absUrl
()
+
"
v0.3/query?
"
+
"
referenceName=
"
+
conf
.
chromoso
me
+
"
&start=
"
+
conf
.
position
+
"
&assemblyId=
"
+
conf
.
reference
+
"
&datasetIds=
"
+
conf
.
dataset
+
"
referenceName=
"
+
conf
.
referenceNa
me
+
"
&start=
"
+
conf
.
start
+
"
&assemblyId=
"
+
conf
.
assemblyId
+
"
&datasetIds=
"
+
conf
.
dataset
Ids
+
((
conf
.
alternateBases
===
""
)
?
"
all
"
:
"
&alternateBases=
"
+
conf
.
alternateBases
)
+
"
&
length=
"
+
conf
.
length
+
((
conf
.
max
L
ength
===
''
)
?
""
:
"
&max
L
ength=
"
+
conf
.
max
L
ength
);
((
conf
.
minlength
===
''
)
?
""
:
"
&min
length=
"
+
conf
.
min
length
)
+
((
conf
.
max
l
ength
===
''
)
?
""
:
"
&max
l
ength=
"
+
conf
.
max
l
ength
);
};
$scope
.
getInfoUrl
=
function
()
{
...
...
app/node-app/public/partials/beacon-home.html
View file @
7047dc4f
...
...
@@ -7,29 +7,29 @@
</div>
<form
class=
"form-horizontal"
>
<div
class=
"form-group"
>
<label
for=
"
chromoso
me"
class=
"col-sm-2 control-label"
>
Reference name
</label>
<label
for=
"
referenceNa
me"
class=
"col-sm-2 control-label"
>
Reference name
</label>
<div
class=
"col-sm-4"
>
<input
type=
"text"
class=
"form-control"
id=
"
chromoso
me"
ng-model=
"config.
chromoso
me"
placeholder=
"
Chromosome
"
>
<input
type=
"text"
class=
"form-control"
id=
"
referenceNa
me"
ng-model=
"config.
referenceNa
me"
placeholder=
"
corresponds to chromosome name, ex: 11
"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"
position
"
class=
"col-sm-2 control-label"
>
Start
</label>
<label
for=
"
start
"
class=
"col-sm-2 control-label"
>
Start
</label>
<div
class=
"col-sm-4"
>
<input
type=
"text"
class=
"form-control"
id=
"
position
"
ng-model=
"config.
position
"
placeholder=
"
Position
"
>
<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=
"referenceSelect"
class=
"col-sm-2 control-label"
>
Assembly ID
</label>
<div
class=
"col-sm-4"
>
<select
id=
"referenceSelect"
ng-model=
"config.
reference
"
class=
"form-control"
>
<select
id=
"referenceSelect"
ng-model=
"config.
assemblyId
"
class=
"form-control"
>
<option
ng-repeat=
"ref in references"
value=
"{{ref}}"
>
{{ref}}
</option>
</select>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"datasetSelect"
class=
"col-sm-2 control-label"
>
Dataset
</label>
<label
for=
"datasetSelect"
class=
"col-sm-2 control-label"
>
Dataset
Ids
</label>
<div
class=
"col-sm-4"
>
<select
id=
"datasetSelect"
ng-model=
"config.dataset"
class=
"form-control"
>
<select
id=
"datasetSelect"
ng-model=
"config.dataset
Ids
"
class=
"form-control"
>
<option
ng-repeat=
"ds in datasets"
value=
"{{ds.code}}"
>
({{ds.code}}) {{ds.description}}
</option>
</select>
</div>
...
...
@@ -49,22 +49,16 @@
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"
position
"
class=
"col-sm-2 control-label"
>
Minimal length
</label>
<label
for=
"
minlength
"
class=
"col-sm-2 control-label"
>
Minimal length
</label>
<div
class=
"col-sm-4"
>
<input
type=
"text"
class=
"form-control"
id=
"length"
ng-model=
"config.length"
placeholder=
"1"
>
<input
type=
"text"
class=
"form-control"
id=
"
min
length"
ng-model=
"config.
min
length"
placeholder=
"1"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"
position
"
class=
"col-sm-2 control-label"
>
Maximal length
</label>
<label
for=
"
maxlength
"
class=
"col-sm-2 control-label"
>
Maximal length
</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"
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-8"
>
<a
target=
"beacon"
ng-href=
"/v0.3/query?referenceName=11&start=34439881&assemblyId=GRCh38&datasetIds=8070/3&alternateBases=DEL"
>
Example query
</a>
<input
type=
"text"
class=
"form-control"
id=
"maxlength"
ng-model=
"config.maxlength"
placeholder=
"Max bases for the selected chromosome"
>
</div>
</div>
...
...
@@ -86,15 +80,11 @@
</div>
</div>
<!--
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-2 col-sm-8"
>
<a target="beacon" ng-href="{{getApiUrl()}}">{{getApiUrl()}}</a>
</div>
<div class="col-sm-2">
<a target="beacon" ng-href="{{getApiUrl()}}" class="btn btn-info">Beacon v0.2</a>
<a
target=
"beacon"
href=
"/samples?limit=10"
>
Get 10 samples
</a>
</div>
</div>
-->
</form>
</div>
\ No newline at end of file
app/php-app/README.md
deleted
100644 → 0
View file @
51d2cd77
app/pyhton-app/README.md
deleted
100644 → 0
View file @
51d2cd77
This can easily be achieved by using the implementation of Maximilen
https://github.com/maximilianh/ucscBeacon
Write
Preview
Supports
Markdown
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