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
9edf71c8
Commit
9edf71c8
authored
19 years ago
by
Patrick Meidl
Browse files
Options
Downloads
Patches
Plain Diff
added check for same seq_region to overlaps(), now method is no longer deprectated
parent
fad9b099
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Feature.pm
+29
-20
29 additions, 20 deletions
modules/Bio/EnsEMBL/Feature.pm
with
29 additions
and
20 deletions
modules/Bio/EnsEMBL/Feature.pm
+
29
−
20
View file @
9edf71c8
...
...
@@ -1038,6 +1038,35 @@ sub get_all_alt_locations {
}
=head2 overlaps
Arg [1] : Bio::EnsEMBL::Feature $f
The other feature you want to check overlap with this feature
for.
Description: This method does a range comparison of this features start and
end and compares it with another features start and end. It will
return true if these ranges overlap and the features are on the
same seq_region.
Returntype : TRUE if features overlap, FALSE if they don't
Exceptions : warning if features are on different seq_regions
Caller : general
Status : At Risk
=cut
sub
overlaps
{
my
$self
=
shift
;
my
$f
=
shift
;
unless
(
$self
->
slice
->
seq_region_name
eq
$f
->
slice
->
seq_region_name
)
{
warning
("
Bio::EnsEMBL::Feature->overlaps(): features are on different seq_regions.
");
return
undef
;
}
return
(
$self
->
end
>=
$f
->
start
and
$self
->
start
<=
$f
->
end
);
}
##############################################
...
...
@@ -1157,24 +1186,4 @@ sub id {
}
=head2 overlaps
Description: This method is only for backwards compatibility and should not
be used. It does a range comparison of this features start and
and and compares it with another features start and end. It
Will return true if these ranges overlap but even if these
features are on different sequence regions! Do yourself a
favour and use a simple one line comparison instead:
$overlaps = ($f1->end() >= $f2->start() &&
$f1->start() <= $f2->end());
Status : At Risk
=cut
sub
overlaps
{
my
$self
=
shift
;
my
$f
=
shift
;
return
(
$self
->
end
()
>=
$f
->
start
()
&&
$self
->
start
()
<=
$f
->
end
());
}
1
;
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