Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
2593a1f3
Commit
2593a1f3
authored
Apr 21, 2010
by
Andreas Kusalananda Kähäri
Browse files
Store the alternative translations later in store().
parent
7a53505d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
47 deletions
+50
-47
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
+50
-47
No files found.
modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm
View file @
2593a1f3
...
...
@@ -855,53 +855,6 @@ sub store {
$original_translation
->
adaptor
(
$translation
->
adaptor
()
);
}
## end if ( defined($translation...))
# Do the eqivalent of the above for all alternative translations, if
# there are any.
my
$alt_translations
=
$transcript
->
get_all_alternative_translations
();
if
(
defined
(
$alt_translations
)
&&
scalar
(
@
{
$alt_translations
}
)
>
0
)
{
foreach
my
$alt_translation
(
@
{
$alt_translations
}
)
{
my
$start_exon
=
$alt_translation
->
start_Exon
();
my
$end_exon
=
$alt_translation
->
end_Exon
();
if
(
!
defined
(
$start_exon
)
)
{
throw
("
Translation does not define a start exon.
");
}
elsif
(
!
defined
(
$end_exon
)
)
{
throw
("
Translation does not defined an end exon.
");
}
if
(
!
defined
(
$start_exon
->
dbID
()
)
)
{
my
$key
=
$start_exon
->
hashkey
();
(
$start_exon
)
=
grep
{
$_
->
hashkey
()
eq
$key
}
@
{
$exons
};
if
(
defined
(
$start_exon
)
)
{
$alt_translation
->
start_Exon
(
$start_exon
);
}
else
{
throw
(
"
Translation's start_Exon does not appear to be one of the
"
.
"
exons in its associated Transcript
"
);
}
}
elsif
(
!
defined
(
$end_exon
->
dbID
()
)
)
{
my
$key
=
$end_exon
->
hashkey
();
(
$end_exon
)
=
grep
{
$_
->
hashkey
()
eq
$key
}
@$exons
;
if
(
defined
(
$end_exon
)
)
{
$translation
->
end_Exon
(
$end_exon
);
}
else
{
throw
(
"
Translation's end_Exon does not appear to be one of the
"
.
"
exons in its associated Transcript.
"
);
}
}
$db
->
get_TranslationAdaptor
()
->
store
(
$alt_translation
,
$transc_dbID
);
}
## end foreach my $alt_translation...
}
## end if ( defined($alt_translations...))
#
# store the xrefs/object xref mapping
#
...
...
@@ -999,6 +952,56 @@ sub store {
$attr_adaptor
->
store_on_Transcript
(
$transc_dbID
,
$transcript
->
get_all_Attributes
);
#
# Store the alternative translations, if there are any.
#
my
$alt_translations
=
$transcript
->
get_all_alternative_translations
();
if
(
defined
(
$alt_translations
)
&&
scalar
(
@
{
$alt_translations
}
)
>
0
)
{
foreach
my
$alt_translation
(
@
{
$alt_translations
}
)
{
my
$start_exon
=
$alt_translation
->
start_Exon
();
my
$end_exon
=
$alt_translation
->
end_Exon
();
if
(
!
defined
(
$start_exon
)
)
{
throw
("
Translation does not define a start exon.
");
}
elsif
(
!
defined
(
$end_exon
)
)
{
throw
("
Translation does not defined an end exon.
");
}
if
(
!
defined
(
$start_exon
->
dbID
()
)
)
{
my
$key
=
$start_exon
->
hashkey
();
(
$start_exon
)
=
grep
{
$_
->
hashkey
()
eq
$key
}
@
{
$exons
};
if
(
defined
(
$start_exon
)
)
{
$alt_translation
->
start_Exon
(
$start_exon
);
}
else
{
throw
(
"
Translation's start_Exon does not appear to be one of the
"
.
"
exons in its associated Transcript
"
);
}
}
elsif
(
!
defined
(
$end_exon
->
dbID
()
)
)
{
my
$key
=
$end_exon
->
hashkey
();
(
$end_exon
)
=
grep
{
$_
->
hashkey
()
eq
$key
}
@$exons
;
if
(
defined
(
$end_exon
)
)
{
$translation
->
end_Exon
(
$end_exon
);
}
else
{
throw
(
"
Translation's end_Exon does not appear to be one of the
"
.
"
exons in its associated Transcript.
"
);
}
}
$db
->
get_TranslationAdaptor
()
->
store
(
$alt_translation
,
$transc_dbID
);
}
## end foreach my $alt_translation...
}
## end if ( defined($alt_translations...))
#update the original transcript object - not the transfered copy that
#we might have created
$original
->
dbID
(
$transc_dbID
);
...
...
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