Commit a2456cf1 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

New method load() for Exon, Gene, Transcript, and Translation.

=head2 load

  Arg [1]       : Boolean $load_xrefs
                  Load (or don't load) xrefs.  Default is to load xrefs.
  Example       : $translation->load();
  Description   : The Ensembl API makes extensive use of
                  lazy-loading.  Under some circumstances (e.g.,
                  when copying genes between databases), all data of
                  an object needs to be fully loaded.  This method
                  loads the parts of the object that are usually
                  lazy-loaded.
  Returns       : Nothing.

=cut
parent 3898eb92
......@@ -1398,6 +1398,28 @@ sub display_id {
}
=head2 load
Args : None
Example : $exon->load();
Description : The Ensembl API makes extensive use of
lazy-loading. Under some circumstances (e.g.,
when copying genes between databases), all data of
an object needs to be fully loaded. This method
loads the parts of the object that are usually
lazy-loaded.
Returns : Nothing.
=cut
sub load {
my ($self) = @_;
$self->analysis();
$self->stable_id();
$self->get_all_supporting_features();
}
=head1 DEPRECATED METHODS
=cut
......
......@@ -1231,6 +1231,38 @@ sub remove_unconventional_transcript_associations {
}
=head2 load
Arg [1] : Boolean $load_xrefs
Load (or don't load) xrefs. Default is to load xrefs.
Example : $gene->load();
Description : The Ensembl API makes extensive use of
lazy-loading. Under some circumstances (e.g.,
when copying genes between databases), all data of
an object needs to be fully loaded. This method
loads the parts of the object that are usually
lazy-loaded.
Returns : Nothing.
=cut
sub load {
my ( $self, $load_xrefs ) = @_;
if ( !defined($load_xrefs) ) { $load_xrefs = 1 }
foreach my $transcript ( @{ $self->get_all_Transcripts() } ) {
$transcript->load($load_xrefs);
}
$self->analysis();
$self->get_all_Attributes();
$self->stable_id();
if ($load_xrefs) {
$self->get_all_DBEntries();
}
}
###########################
# DEPRECATED METHODS FOLLOW
......
......@@ -2355,6 +2355,53 @@ sub _compare_xrefs {
}
=head2 load
Arg [1] : Boolean $load_xrefs
Load (or don't load) xrefs. Default is to load xrefs.
Example : $transcript->load();
Description : The Ensembl API makes extensive use of
lazy-loading. Under some circumstances (e.g.,
when copying genes between databases), all data of
an object needs to be fully loaded. This method
loads the parts of the object that are usually
lazy-loaded.
Returns : Nothing.
=cut
sub load {
my ( $self, $load_xrefs ) = @_;
if ( !defined($load_xref) ) { $load_xrefs = 1 }
my $translation = $self->translation();
if ( defined($translation) ) {
$translation->load($load_xrefs);
foreach my $alt_translation (
@{ $transcript->get_all_alternative_translations() } )
{
$alt_translation->load($load_xrefs);
}
}
foreach my $exon ( @{ $transcript->get_all_Exons() } ) {
$exon->load();
}
$transcript->stable_id();
$transcript->analysis();
$transcript->get_all_Attributes();
$transcript->get_all_supporting_features();
if ($load_xrefs) {
$transcript->get_all_DBEntries();
}
} ## end sub load
###########################
# DEPRECATED METHODS FOLLOW
###########################
......
......@@ -1021,6 +1021,36 @@ sub modify_translation {
return $seq;
}
=head2 load
Arg [1] : Boolean $load_xrefs
Load (or don't load) xrefs. Default is to load xrefs.
Example : $translation->load();
Description : The Ensembl API makes extensive use of
lazy-loading. Under some circumstances (e.g.,
when copying genes between databases), all data of
an object needs to be fully loaded. This method
loads the parts of the object that are usually
lazy-loaded.
Returns : Nothing.
=cut
sub load {
my ( $self, $load_xrefs ) = @_;
if ( !defined($load_xref) ) { $load_xrefs = 1 }
$translation->seq();
$translation->stable_id();
$translation->get_all_Attributes();
$translation->get_all_ProteinFeatures();
if ($load_xrefs) {
$translation->get_all_DBEntries();
}
}
=head2 temporary_id
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment