Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl-rest
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl-rest
Commits
fdc5b341
Commit
fdc5b341
authored
8 years ago
by
Matthew Laird
Browse files
Options
Downloads
Plain Diff
Merge pull request #120 from at7/at7/postrelease84/ld_windowsize
At7/postrelease84/ld windowsize
parents
ddbd1697
bc0d30a9
No related branches found
No related tags found
1 merge request
!132
Update for Regulation Endpoint for e85 schema changes
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/EnsEMBL/REST/Model/LDFeatureContainer.pm
+5
-5
5 additions, 5 deletions
lib/EnsEMBL/REST/Model/LDFeatureContainer.pm
root/documentation/ld.conf
+3
-3
3 additions, 3 deletions
root/documentation/ld.conf
t/ld.t
+1
-1
1 addition, 1 deletion
t/ld.t
with
9 additions
and
9 deletions
lib/EnsEMBL/REST/Model/LDFeatureContainer.pm
+
5
−
5
View file @
fdc5b341
...
...
@@ -41,10 +41,10 @@ sub fetch_LDFeatureContainer_variation_name {
my
$va
=
$c
->
model
('
Registry
')
->
get_adaptor
(
$species
,
'
Variation
',
'
Variation
');
my
$ldfca
=
$c
->
model
('
Registry
')
->
get_adaptor
(
$species
,
'
Variation
',
'
LDFeatureContainer
');
my
$window_size
=
$c
->
request
->
param
('
window_size
')
||
10
00
;
# default is
1M
B
Catalyst::
Exception
->
throw
("
window_size needs to be a value between 0 and
10
00.
")
if
(
!
looks_like_number
(
$window_size
));
Catalyst::
Exception
->
throw
("
window_size needs to be a value between 0 and
10
00.
")
if
(
$window_size
>
10
00
);
Catalyst::
Exception
->
throw
("
window_size needs to be a value between 0 and
10
00.
")
if
(
$window_size
<
0
);
my
$window_size
=
$c
->
request
->
param
('
window_size
')
||
5
00
;
# default is
500K
B
Catalyst::
Exception
->
throw
("
window_size needs to be a value between 0 and
5
00.
")
if
(
!
looks_like_number
(
$window_size
));
Catalyst::
Exception
->
throw
("
window_size needs to be a value between 0 and
5
00.
")
if
(
$window_size
>
5
00
);
Catalyst::
Exception
->
throw
("
window_size needs to be a value between 0 and
5
00.
")
if
(
$window_size
<
0
);
$window_size
=
floor
(
$window_size
);
my
$max_snp_distance
=
(
$window_size
/
2
)
*
1000
;
$ldfca
->
max_snp_distance
(
$max_snp_distance
);
...
...
@@ -84,7 +84,7 @@ sub fetch_LDFeatureContainer_variation_name {
sub
fetch_LDFeatureContainer_slice
{
my
(
$self
,
$slice
)
=
@_
;
Catalyst::
Exception
->
throw
("
No region given. Please specify a region to retrieve from this service.
")
if
!
$slice
;
Catalyst::
Exception
->
throw
("
Specified region is too large. Maximum allowed size for region is
1Mb
.
")
if
(
$slice
->
length
>
1_0
00_000
);
Catalyst::
Exception
->
throw
("
Specified region is too large. Maximum allowed size for region is
500KB
.
")
if
(
$slice
->
length
>
5
00_000
);
my
$c
=
$self
->
context
();
my
$species
=
$c
->
stash
->
{
species
};
...
...
This diff is collapsed.
Click to expand it.
root/documentation/ld.conf
+
3
−
3
View file @
fdc5b341
<
endpoints
>
<
ld_id_get
>
description
=
Computes
and
returns
LD
values
between
the
given
variant
and
all
other
variants
in
a
window
centered
around
the
given
variant
.
The
window
size
is
set
to
10
00
kb
.
description
=
Computes
and
returns
LD
values
between
the
given
variant
and
all
other
variants
in
a
window
centered
around
the
given
variant
.
The
window
size
is
set
to
5
00
kb
.
endpoint
=
ld
/:
species
/:
id
/:
d_prime
/:
r2
/:
population_name
/:
window_size
method
=
GET
group
=
Linkage
Disequilibrium
...
...
@@ -40,8 +40,8 @@
</
population_name
>
<
window_size
>
type
=
Integer
description
=
Window
size
in
kb
.
The
maximum
allowed
value
for
the
window
size
is
10
00
kb
.
LD
is
computed
for
the
given
variant
and
all
variants
that
are
located
within
the
specified
window
.
default
=
10
00
description
=
Window
size
in
kb
.
The
maximum
allowed
value
for
the
window
size
is
5
00
kb
.
LD
is
computed
for
the
given
variant
and
all
variants
that
are
located
within
the
specified
window
.
default
=
5
00
example
=
__
VAR
(
window_size
)
__
</
window_size
>
</
params
>
...
...
This diff is collapsed.
Click to expand it.
t/ld.t
+
1
−
1
View file @
fdc5b341
...
...
@@ -88,7 +88,7 @@ $ld_get = '/ld/homo_sapiens/rs1333047?population_name=1000GENOMES:phase_1_ASW;d_
$json
=
json_GET
(
$ld_get
,
'
GET LD data for variant, population, d_prime and window_size
');
eq_or_diff
(
$json
,
$expected_output
,
"
Example variant, population, d_prime and window_size
");
$ld_get
=
'
/ld/homo_sapiens/rs1333047?population_name=1000GENOMES:phase_1_ASW;d_prime=1.0;window_size=
500
.123
';
$ld_get
=
'
/ld/homo_sapiens/rs1333047?population_name=1000GENOMES:phase_1_ASW;d_prime=1.0;window_size=
499
.123
';
$json
=
json_GET
(
$ld_get
,
'
GET LD data for variant, population, d_prime and window_size
');
eq_or_diff
(
$json
,
$expected_output
,
"
Example variant, population, d_prime and window_size
");
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment