Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
368fe790
Commit
368fe790
authored
15 years ago
by
William McLaren
Browse files
Options
Downloads
Patches
Plain Diff
Changed aligned_seq to seq
parent
6325d8a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/MappedSlice.pm
+31
-16
31 additions, 16 deletions
modules/Bio/EnsEMBL/MappedSlice.pm
with
31 additions
and
16 deletions
modules/Bio/EnsEMBL/MappedSlice.pm
+
31
−
16
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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment