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
9fc1080e
Commit
9fc1080e
authored
17 years ago
by
Daniel Rios
Browse files
Options
Downloads
Patches
Plain Diff
AlignSlice can print sequences with different length, adding - when no base present
parent
0a312863
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/AlignStrainSlice.pm
+26
-0
26 additions, 0 deletions
modules/Bio/EnsEMBL/AlignStrainSlice.pm
modules/Bio/EnsEMBL/StrainSlice.pm
+8
-1
8 additions, 1 deletion
modules/Bio/EnsEMBL/StrainSlice.pm
with
34 additions
and
1 deletion
modules/Bio/EnsEMBL/AlignStrainSlice.pm
+
26
−
0
View file @
9fc1080e
...
...
@@ -302,7 +302,33 @@ sub get_all_Slices {
undef
$ref_strain
->
{'
alleleFeatures
'};
push
@strains
,
@
{
$self
->
strains
};
my
$new_feature
;
my
$indel
;
my
$aligned_features
;
my
$indels
=
();
#reference to a hash containing indels in the different strains
#we need to realign all Features in the different Slices and add '-' in the reference Slice
foreach
my
$strain
(
@
{
$self
->
strains
}){
foreach
my
$af
(
@
{
$strain
->
get_all_AlleleFeatures_Slice
()}){
$new_feature
=
$self
->
alignFeature
(
$af
);
#align feature in AlignSlice coordinates
push
@
{
$aligned_features
},
$new_feature
if
(
$new_feature
->
seq_region_start
<=
$strain
->
end
);
#some features might map outside slice
if
(
$af
->
start
!=
$af
->
end
){
#an indel, need to add to the reference, and realign in the strain
#make a shallow copy of the indel
%
{
$indel
}
=
%
{
$new_feature
};
bless
$indel
,
ref
(
$new_feature
);
$indel
->
allele_string
('
-
');
push
@
{
$indels
},
$indel
;
#and include in the list of potential indels
}
}
undef
$strain
->
{'
alleleFeatures
'};
#remove all features before adding new aligned features
push
@
{
$strain
->
{'
alleleFeatures
'}},
@
{
$aligned_features
};
undef
$aligned_features
;
}
push
@strains
,
$ref_strain
;
#need to add indels in the different strains, if not present
foreach
my
$strain
(
@strains
){
#inlcude the indels in the StrainSlice object
push
@
{
$strain
->
{'
alignIndels
'}},
@
{
$indels
};
}
return
\
@strains
;
}
...
...
This diff is collapsed.
Click to expand it.
modules/Bio/EnsEMBL/StrainSlice.pm
+
8
−
1
View file @
9fc1080e
...
...
@@ -243,13 +243,20 @@ sub seq {
my
$seqAdaptor
=
$self
->
adaptor
()
->
db
()
->
get_SequenceAdaptor
();
my
$reference_sequence
=
$seqAdaptor
->
fetch_by_Slice_start_end_strand
(
$self
,
1
,
undef
,
1
);
#get the reference sequence for that slice
#apply all differences to the reference sequence
#first, in case there are any indels, create the new sequence (containing the '-' bases)
# sort edits in reverse order to remove complication of
# adjusting downstream edits
my
@indels_ordered
=
sort
{
$b
->
start
()
<=>
$a
->
start
()}
@
{
$self
->
{'
alignIndels
'}}
if
(
defined
$self
->
{'
alignIndels
'});
foreach
my
$vf
(
@indels_ordered
){
$vf
->
apply_edit
(
$reference_sequence
);
#change, in the reference sequence, the vf
}
#need to find coverage information if diffe
# sort edits in reverse order to remove complication of
# adjusting downstream edits
my
@variation_features_ordered
=
sort
{
$b
->
start
()
<=>
$a
->
start
()}
@
{
$self
->
{'
alleleFeatures
'}}
if
(
defined
$self
->
{'
alleleFeatures
'});
foreach
my
$vf
(
@variation_features_ordered
){
next
if
(
$vf
->
start
!=
$vf
->
end
);
#quick fix to remove indels from sequence
$vf
->
apply_edit
(
$reference_sequence
);
#change, in the reference sequence, the vf
}
#need to find coverage information if different from reference
...
...
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