Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
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
Commits
aa0c1632
Commit
aa0c1632
authored
13 years ago
by
Monika Komorowska
Browse files
Options
Downloads
Patches
Plain Diff
BaseFeatureAdaptor.pm
parent
42e6fc2e
Branches
release/67
Tags
cvs/release/ensembl/67
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/DBSQL/ArchiveStableIdAdaptor.pm
+578
-1253
578 additions, 1253 deletions
modules/Bio/EnsEMBL/DBSQL/ArchiveStableIdAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
+61
-33
61 additions, 33 deletions
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
with
639 additions
and
1286 deletions
modules/Bio/EnsEMBL/DBSQL/ArchiveStableIdAdaptor.pm
+
578
−
1253
View file @
aa0c1632
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
+
61
−
33
View file @
aa0c1632
...
...
@@ -79,6 +79,29 @@ sub new {
return
$self
;
}
=head2 start_equals_end
Arg [1] : (optional) boolean $newval
Example : $bfa->start_equals_end(1);
Description: Getter/Setter for the start_equals_end flag. If set
to true sub _slice_fetch will use a simplified sql to retrieve 1bp slices.
Returntype : boolean
Exceptions : none
Caller : Pipeline
Status : Stable
=cut
sub
start_equals_end
{
my
(
$self
,
$value
)
=
@_
;
if
(
defined
(
$value
)
)
{
$self
->
{'
start_equals_end
'}
=
$value
;
}
return
$self
->
{'
start_equals_end
'};
}
=head2 clear_cache
Args : None
...
...
@@ -623,41 +646,46 @@ COORD_SYSTEM: foreach my $feat_cs (@feat_css) {
$constraint
.=
"
AND
"
if
(
$constraint
);
if
(
!
$slice
->
is_circular
()
)
{
# Deal with the default case of a non-circular chromosome.
$constraint
.=
"
${tab_syn}
.seq_region_id IN (
"
.
join
(
'
,
',
@sr_ids
)
.
"
) AND
"
.
"
${tab_syn}
.seq_region_start <=
$slice_end
AND
"
.
"
${tab_syn}
.seq_region_end >=
$slice_start
";
$constraint
.=
"
${tab_syn}
.seq_region_id IN (
"
.
join
(
'
,
',
@sr_ids
)
.
"
) AND
";
#faster query for 1bp slices where SNP data is not compressed
if
(
$self
->
start_equals_end
&&
$slice_start
==
$slice_end
)
{
$constraint
.=
"
AND
${tab_syn}
.seq_region_start =
$slice_end
"
.
"
AND
${tab_syn}
.seq_region_end =
$slice_start
";
}
else
{
# Deal with the case of a circular chromosome.
if
(
$slice_start
>
$slice_end
)
{
$constraint
.=
"
${tab_syn}
.seq_region_id IN (
"
.
join
(
'
,
',
@sr_ids
)
.
"
) AND (
${tab_syn}
.seq_region_start >=
$slice_start
"
.
"
OR
${tab_syn}
.seq_region_start <=
$slice_end
"
.
"
OR
${tab_syn}
.seq_region_end >=
$slice_start
"
.
"
OR
${tab_syn}
.seq_region_end <=
$slice_end
"
.
"
OR
${tab_syn}
.seq_region_start >
${tab_syn}
.seq_region_end)
";
}
else
{
$constraint
.=
"
${tab_syn}
.seq_region_id IN (
"
.
join
(
'
,
',
@sr_ids
)
.
"
) AND ((
${tab_syn}
.seq_region_start <=
$slice_end
"
.
"
AND
${tab_syn}
.seq_region_end >=
$slice_start
)
"
.
"
OR (
${tab_syn}
.seq_region_start >
${tab_syn}
.seq_region_end
"
.
"
AND (
${tab_syn}
.seq_region_start <=
$slice_end
"
.
"
OR
${tab_syn}
.seq_region_end >=
$slice_start
)))
";
}
}
if
(
$max_len
&&
!
$slice
->
is_circular
)
{
my
$min_start
=
$slice_start
-
$max_len
;
$constraint
.=
"
AND
${tab_syn}
.seq_region_start >=
$min_start
";
if
(
!
$slice
->
is_circular
()
)
{
# Deal with the default case of a non-circular chromosome.
$constraint
.=
"
${tab_syn}
.seq_region_start <=
$slice_end
AND
"
.
"
${tab_syn}
.seq_region_end >=
$slice_start
";
if
(
$max_len
)
{
my
$min_start
=
$slice_start
-
$max_len
;
$constraint
.=
"
AND
${tab_syn}
.seq_region_start >=
$min_start
";
}
}
else
{
# Deal with the case of a circular chromosome.
if
(
$slice_start
>
$slice_end
)
{
$constraint
.=
"
(
${tab_syn}
.seq_region_start >=
$slice_start
"
.
"
OR
${tab_syn}
.seq_region_start <=
$slice_end
"
.
"
OR
${tab_syn}
.seq_region_end >=
$slice_start
"
.
"
OR
${tab_syn}
.seq_region_end <=
$slice_end
"
.
"
OR
${tab_syn}
.seq_region_start >
${tab_syn}
.seq_region_end)
";
}
else
{
$constraint
.=
"
((
${tab_syn}
.seq_region_start <=
$slice_end
"
.
"
AND
${tab_syn}
.seq_region_end >=
$slice_start
)
"
.
"
OR (
${tab_syn}
.seq_region_start >
${tab_syn}
.seq_region_end
"
.
"
AND (
${tab_syn}
.seq_region_start <=
$slice_end
"
.
"
OR
${tab_syn}
.seq_region_end >=
$slice_start
)))
";
}
}
}
my
$fs
=
$self
->
generic_fetch
(
$constraint
,
undef
,
$slice
);
...
...
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