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
61efc170
Commit
61efc170
authored
Feb 18, 2010
by
William McLaren
Browse files
Added seq method to get aligned sequence
parent
368fe790
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
modules/Bio/EnsEMBL/MappedSliceContainer.pm
modules/Bio/EnsEMBL/MappedSliceContainer.pm
+42
-0
No files found.
modules/Bio/EnsEMBL/MappedSliceContainer.pm
View file @
61efc170
...
...
@@ -591,6 +591,48 @@ sub expanded {
return
$self
->
{'
expanded
'};
}
=head2 seq
Example : my $seq = $container->seq()
Description : Retrieves the expanded sequence of the artificial container
slice, including "-" characters where there are inserts in any
of the attached mapped slices.
Return type : String
Exceptions : none
Caller : general
Status : At Risk
: under development
=cut
sub
seq
{
my
$self
=
shift
;
my
$container_seq
=
'';
# check there's a mapper
if
(
defined
(
$self
->
mapper
))
{
my
$start
=
0
;
my
$slice
=
$self
->
ref_slice
();
my
$seq
=
$slice
->
seq
();
foreach
my
$coord
(
$self
->
mapper
->
map_coordinates
(
$slice
->
seq_region_name
,
$slice
->
start
,
$slice
->
end
,
$slice
->
strand
,
'
ref_slice
'))
{
# if it is a normal coordinate insert sequence
if
(
!
$coord
->
isa
('
Bio::EnsEMBL::Mapper::IndelCoordinate
'))
{
$container_seq
.=
substr
(
$seq
,
$start
,
$coord
->
length
());
$start
+=
$coord
->
length
;
}
# if it is a gap or indel insert "-"
else
{
$container_seq
.=
'
-
'
x
$coord
->
length
();
}
}
}
return
$container_seq
;
}
1
;
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