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
e7be881a
Commit
e7be881a
authored
Mar 10, 2008
by
Andreas Kusalananda Kähäri
Browse files
Call them 'features', not 'entries'.
Initialize the bins differently for different binning methods.
parent
f3a407cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
modules/Bio/EnsEMBL/Collection.pm
modules/Bio/EnsEMBL/Collection.pm
+17
-5
No files found.
modules/Bio/EnsEMBL/Collection.pm
View file @
e7be881a
...
...
@@ -107,8 +107,8 @@ our %VALID_BINNING_METHODS = (
'
density
'
=>
0
,
# Same as 'count'.
'
indices
'
=>
1
,
'
index
'
=>
1
,
# Same as 'indices'.
'
entri
es
'
=>
2
,
'
entry
'
=>
2
,
# Same as '
entri
es'.
'
featur
es
'
=>
2
,
'
feature
'
=>
2
,
# Same as '
featur
es'.
'
fractional_count
'
=>
3
,
'
weight
'
=>
3
,
# Same as 'fractional_count'.
'
coverage
'
=>
4
);
...
...
@@ -140,7 +140,19 @@ sub _bin_features {
my
$bin_length
=
(
$slice
->
end
()
-
$slice_start
+
1
)
/
$nbins
;
my
@bins
=
map
(
$_
=
undef
,
0
..
$nbins
-
1
);
my
@bins
;
if
(
$method
==
0
||
# 'count' or 'density'
$method
==
3
||
# 'fractional_count' or 'weight'
$method
==
4
# 'coverage'
)
{
# For binning methods where each bin contain numerical values.
@bins
=
map
(
$_
=
0
,
0
..
$nbins
-
1
);
}
else
{
# For binning methods where each bin does not contain numerical
# values.
@bins
=
map
(
$_
=
undef
,
0
..
$nbins
-
1
);
}
my
$feature_index
=
0
;
my
@bin_masks
;
...
...
@@ -153,7 +165,7 @@ sub _bin_features {
if
(
$end_bin
>=
$nbins
)
{
# This might happen for the very last entry.
#
$end_bin = $nbins - 1;
$end_bin
=
$nbins
-
1
;
}
if
(
$method
==
0
)
{
...
...
@@ -182,7 +194,7 @@ sub _bin_features {
}
elsif
(
$method
==
2
)
{
# For '
entri
es' and '
entry
'.
# For '
featur
es' and '
feature
'.
for
(
my
$bin_index
=
$start_bin
;
$bin_index
<=
$end_bin
;
...
...
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