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
5d8fee01
Commit
5d8fee01
authored
Feb 27, 2008
by
Andreas Kusalananda Kähäri
Browse files
Add _lightweight() method and use it to (temporarily) set the
lightweight flag when creating objects for binning.
parent
e8f69431
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
20 deletions
+41
-20
modules/Bio/EnsEMBL/Collection.pm
modules/Bio/EnsEMBL/Collection.pm
+18
-3
modules/Bio/EnsEMBL/Collection/Exon.pm
modules/Bio/EnsEMBL/Collection/Exon.pm
+5
-3
modules/Bio/EnsEMBL/Collection/RepeatFeature.pm
modules/Bio/EnsEMBL/Collection/RepeatFeature.pm
+18
-14
No files found.
modules/Bio/EnsEMBL/Collection.pm
View file @
5d8fee01
...
...
@@ -22,8 +22,10 @@ sub fetch_bins_by_Slice {
my
(
$slice
,
$method
,
$nbins
,
$logic_name
)
=
rearrange
(
[
'
SLICE
',
'
METHOD
',
'
NBINS
',
'
LOGIC_NAME
'
],
@
_
);
# FIXME: Set lightweight
return
my
$old_value
=
$this
->
_lightweight
();
$this
->
_lightweight
(
1
);
my
$bins
=
$this
->
_bin_features
(
-
slice
=>
$slice
,
-
nbins
=>
$nbins
,
...
...
@@ -31,7 +33,10 @@ sub fetch_bins_by_Slice {
-
features
=>
$this
->
fetch_by_Slice_constraint
(
$slice
,
undef
,
$logic_name
)
);
# FIXME: Unset lightweight
$this
->
_lightweight
(
$old_value
);
return
$bins
;
}
# ----------------------------------------------------------------------
...
...
@@ -87,6 +92,16 @@ sub _create_feature_fast {
# ----------------------------------------------------------------------
# Private methods
sub
_lightweight
{
my
(
$this
,
$value
)
=
@_
;
if
(
defined
(
$value
)
)
{
$self
->
{'
lightweight
'}
=
(
$value
!=
0
);
}
return
$self
->
{'
lightweight
'}
||
0
;
}
our
%VALID_BINNING_METHODS
=
(
'
count
'
=>
0
,
'
density
'
=>
0
,
# Same as 'count'.
...
...
modules/Bio/EnsEMBL/Collection/Exon.pm
View file @
5d8fee01
...
...
@@ -16,10 +16,12 @@ sub _create_feature {
my
$feature
=
$this
->
SUPER::
_create_feature
(
$feature_type
,
$args
);
my
(
$analysis
,
$stable_id
,
$version
)
=
rearrange
(
[
'
STABLE_ID
',
'
VERSION
',
],
%
{
$args
}
);
if
(
!
$this
->
_lightweight
()
)
{
my
(
$analysis
,
$stable_id
,
$version
)
=
rearrange
(
[
'
STABLE_ID
',
'
VERSION
',
],
%
{
$args
}
);
push
(
@
{
$feature
},
$stable_id
,
$version
);
push
(
@
{
$feature
},
$stable_id
,
$version
);
}
return
$feature
;
}
...
...
modules/Bio/EnsEMBL/Collection/RepeatFeature.pm
View file @
5d8fee01
...
...
@@ -16,16 +16,18 @@ sub _create_feature {
my
$feature
=
$this
->
SUPER::
_create_feature
(
$feature_type
,
$args
);
my
(
$hstart
,
$hend
,
$score
,
$repeat_consensus
,
$analysis
)
=
rearrange
(
[
'
HSTART
',
'
HEND
',
'
SCORE
',
'
REPEAT_CONSENSUS
',
'
ANALYSIS
'
],
@
{
$args
}
);
push
(
@
{
$feature
},
$hstart
,
$hend
,
$score
,
$repeat_consensus
->
dbID
(),
$analysis
->
dbID
()
);
if
(
!
$this
->
_lightweight
()
)
{
my
(
$hstart
,
$hend
,
$score
,
$repeat_consensus
,
$analysis
)
=
rearrange
(
[
'
HSTART
',
'
HEND
',
'
SCORE
',
'
REPEAT_CONSENSUS
',
'
ANALYSIS
'
],
@
{
$args
}
);
push
(
@
{
$feature
},
$hstart
,
$hend
,
$score
,
$repeat_consensus
->
dbID
(),
$analysis
->
dbID
()
);
}
return
$feature
;
}
...
...
@@ -36,10 +38,12 @@ sub _create_feature_fast {
my
$feature
=
$this
->
SUPER::
_create_feature_fast
(
$feature_type
,
$args
);
push
(
@
{
$feature
},
$args
->
{'
hstart
'},
$args
->
{'
hend
'},
$args
->
{'
score
'},
$args
->
{'
repeat_consensus
'}
->
dbID
(),
$args
->
{'
analysis
'}
->
dbID
()
);
if
(
!
$this
->
_lightweight
()
)
{
push
(
@
{
$feature
},
$args
->
{'
hstart
'},
$args
->
{'
hend
'},
$args
->
{'
score
'},
$args
->
{'
repeat_consensus
'}
->
dbID
(),
$args
->
{'
analysis
'}
->
dbID
()
);
}
return
$feature
;
}
...
...
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