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
368fe790
Commit
368fe790
authored
Feb 18, 2010
by
William McLaren
Browse files
Changed aligned_seq to seq
parent
6325d8a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
16 deletions
+31
-16
modules/Bio/EnsEMBL/MappedSlice.pm
modules/Bio/EnsEMBL/MappedSlice.pm
+31
-16
No files found.
modules/Bio/EnsEMBL/MappedSlice.pm
View file @
368fe790
...
...
@@ -508,42 +508,54 @@ sub is_toplevel {
}
sub
seq
{
}
=head2 seq
sub
subseq
{
}
Example : my $seq = $mapped_slice->seq()
Description : Retrieves the expanded sequence of this mapped slice,
including "-" characters where there are inserts in any other
mapped slices. This will align with the sequence returned by
the container's seq() method.
Return type : String
Exceptions : none
Caller : general
Status : At Risk
: under development
=cut
sub
aligned_
seq
{
sub
seq
{
my
$self
=
shift
;
my
$seq
=
'';
# create an empty string
my
$ms_seq
=
'';
# this coord represents the current position in the MS sequence
my
$start
=
0
;
# get slice/mapper pairs from mapped slice (usually only one anyway)
foreach
my
$pair
(
@
{
$self
->
get_all_Slice_Mapper_pairs
()})
{
my
(
$s
,
$m
)
=
@$pair
;
my
$
strain_
seq
=
$s
->
seq
();
my
$seq
=
$s
->
seq
();
# project from mapped slice to reference slice
foreach
my
$ref_coord
(
$m
->
map_coordinates
('
mapped_slice
',
1
,
CORE::
length
(
$
strain_
seq
),
$s
->
strand
,
'
mapped_slice
'))
{
# project from mapped slice to reference slice
using the mapper
foreach
my
$ref_coord
(
$m
->
map_coordinates
('
mapped_slice
',
1
,
CORE::
length
(
$seq
),
$s
->
strand
,
'
mapped_slice
'))
{
# normal coord
if
(
!
$ref_coord
->
isa
('
Bio::EnsEMBL::Mapper::IndelCoordinate
')
&&
!
$ref_coord
->
isa
('
Bio::EnsEMBL::Mapper::Gap
'))
{
# project from reference slice to container slice
# project from reference slice to container slice
using the container's mapper
foreach
my
$ms_coord
(
$self
->
container
->
mapper
->
map_coordinates
(
$self
->
container
->
ref_slice
->
seq_region_name
,
$ref_coord
->
start
,
$ref_coord
->
end
,
$ref_coord
->
strand
,
'
ref_slice
'))
{
# normal coord
if
(
!
$ms_coord
->
isa
('
Bio::EnsEMBL::Mapper::IndelCoordinate
')
&&
!
$ms_coord
->
isa
('
Bio::EnsEMBL::Mapper::Gap
'))
{
$seq
.=
substr
(
$
strain_
seq
,
$start
,
$ms_coord
->
length
);
$
ms_
seq
.=
substr
(
$seq
,
$start
,
$ms_coord
->
length
);
$start
+=
$ms_coord
->
length
();
}
# indel coord
else
{
$seq
.=
'
-
'
x
$ms_coord
->
length
();
$
ms_
seq
.=
'
-
'
x
$ms_coord
->
length
();
}
}
}
...
...
@@ -551,19 +563,22 @@ sub aligned_seq {
# indel / gap
else
{
# if there's a gap aswell, add sequence
# if there's a gap
here
aswell, add
corresponding
sequence
if
(
$ref_coord
->
gap_length
>
0
)
{
$seq
.=
substr
(
$
strain_
seq
,
$start
,
$ref_coord
->
gap_length
);
$
ms_
seq
.=
substr
(
$seq
,
$start
,
$ref_coord
->
gap_length
);
$start
+=
$ref_coord
->
gap_length
;
}
# add "-" to the sequence
$seq
.=
'
-
'
x
(
$ref_coord
->
length
()
-
$ref_coord
->
gap_length
());
$
ms_
seq
.=
'
-
'
x
(
$ref_coord
->
length
()
-
$ref_coord
->
gap_length
());
}
}
}
return
$seq
;
return
$ms_seq
;
}
sub
subseq
{
}
sub
get_repeatmasked_seq
{
...
...
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