Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
e8f69431
Commit
e8f69431
authored
Feb 26, 2008
by
Andreas Kusalananda Kähäri
Browse files
Introduce a fetch_bins_by_Slice() method to slowly but surely making
binning work again.
parent
2f258ca6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
6 deletions
+30
-6
modules/Bio/EnsEMBL/Collection.pm
modules/Bio/EnsEMBL/Collection.pm
+30
-6
No files found.
modules/Bio/EnsEMBL/Collection.pm
View file @
e8f69431
...
...
@@ -14,6 +14,29 @@ use constant { FEATURE_DBID => 0,
FEATURE_END
=>
3
,
FEATURE_STRAND
=>
4
};
# ----------------------------------------------------------------------
# The public interface added by Feature Collection
sub
fetch_bins_by_Slice
{
my
$this
=
shift
;
my
(
$slice
,
$method
,
$nbins
,
$logic_name
)
=
rearrange
(
[
'
SLICE
',
'
METHOD
',
'
NBINS
',
'
LOGIC_NAME
'
],
@
_
);
# FIXME: Set lightweight
return
$this
->
_bin_features
(
-
slice
=>
$slice
,
-
nbins
=>
$nbins
,
-
method
=>
$method
,
-
features
=>
$this
->
fetch_by_Slice_constraint
(
$slice
,
undef
,
$logic_name
)
);
# FIXME: Unset lightweight
}
# ----------------------------------------------------------------------
# Specialization of methods in Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor
sub
_remap
{
my
(
$this
,
$features
,
$mapper
,
$slice
)
=
@_
;
...
...
@@ -61,6 +84,9 @@ sub _create_feature_fast {
return
$feature
;
}
# ----------------------------------------------------------------------
# Private methods
our
%VALID_BINNING_METHODS
=
(
'
count
'
=>
0
,
'
density
'
=>
0
,
# Same as 'count'.
...
...
@@ -72,14 +98,12 @@ our %VALID_BINNING_METHODS = (
'
weight
'
=>
3
,
# Same as 'fractional_count'.
'
coverage
'
=>
4
);
sub
get
_bins
{
sub
_bin
_feature
s
{
my
$this
=
shift
;
my
(
$nbins
,
$method_name
)
=
rearrange
(
[
'
NBINS
',
'
METHOD
'
],
@
_
);
my
(
$slice
,
$nbins
,
$method_name
,
$features
)
=
rearrange
(
[
'
SLICE
',
'
NBINS
',
'
METHOD
',
'
FEATURES
'
],
@
_
);
if
(
!
$this
->
is_populated
()
)
{
throw
(
'
Can not bin a feature collection
'
.
'
without first having called populate()
'
);
}
if
(
!
defined
(
$features
)
||
!
@
{
$features
}
)
{
return
[]
}
if
(
!
defined
(
$nbins
)
)
{
throw
('
Missing NBINS argument
');
...
...
Write
Preview
Markdown
is supported
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