Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl
Commits
c31e8a56
Commit
c31e8a56
authored
Feb 16, 2010
by
William McLaren
Browse files
Added StrainSlice methods
parent
420b66f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
2 deletions
+46
-2
modules/Bio/EnsEMBL/MappedSliceContainer.pm
modules/Bio/EnsEMBL/MappedSliceContainer.pm
+46
-2
No files found.
modules/Bio/EnsEMBL/MappedSliceContainer.pm
View file @
c31e8a56
...
...
@@ -353,13 +353,27 @@ sub get_AlignSliceAdaptor {
# [todo]
sub
set_StrainSliceAdaptor
{
throw
("
Not implemented yet!
");
my
$self
=
shift
;
my
$strain_slice_adaptor
=
shift
;
unless
(
$strain_slice_adaptor
and
ref
(
$strain_slice_adaptor
)
and
$strain_slice_adaptor
->
isa
('
Bio::EnsEMBL::DBSQL::StrainSliceAdaptor
'))
{
throw
("
Need a Bio::EnsEMBL::StrainSliceAdaptor.
");
}
$self
->
{'
adaptors
'}
->
{'
StrainSlice
'}
=
$strain_slice_adaptor
;
}
# [todo]
sub
get_StrainSliceAdaptor
{
throw
("
Not implemented yet!
");
my
$self
=
shift
;
unless
(
$self
->
{'
adaptors
'}
->
{'
StrainSlice
'})
{
warning
("
No StrainSliceAdaptor attached to MappedSliceContainer.
");
}
return
$self
->
{'
adaptors
'}
->
{'
StrainSlice
'};
}
...
...
@@ -392,6 +406,36 @@ sub attach_AssemblySlice {
}
=head2 attach_StrainSlice
Arg[1] : String $strain - name of strain to attach
Example : $msc->attach_StrainSlice('Watson');
Description : Attaches a MappedSlice for an alternative strain to this
container.
Return type : none
Exceptions : thrown on missing argument
Caller : general, Bio::EnsEMBL::DBSQL::StrainSliceAdaptor
Status : At Risk
: under development
=cut
sub
attach_StrainSlice
{
my
$self
=
shift
;
my
$strain
=
shift
;
throw
("
Need a strain.
")
unless
(
$strain
);
my
$ssa
=
$self
->
get_StrainSliceAdaptor
;
return
unless
(
$ssa
);
my
@mapped_slices
=
@
{
$ssa
->
fetch_by_name
(
$self
,
$strain
)
};
push
@
{
$self
->
{'
mapped_slices
'}
},
@mapped_slices
;
}
=head2 get_all_MappedSlices
Example : foreach my $mapped_slice (@{ $msc->get_all_MappedSlices }) {
...
...
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