diff --git a/modules/Bio/EnsEMBL/Exon.pm b/modules/Bio/EnsEMBL/Exon.pm index 587220b3e9b1657289c2fa4f342fbe76da1220d2..78826cc31c2367b625459d7c4ee109dd48589562 100755 --- a/modules/Bio/EnsEMBL/Exon.pm +++ b/modules/Bio/EnsEMBL/Exon.pm @@ -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 diff --git a/modules/Bio/EnsEMBL/Gene.pm b/modules/Bio/EnsEMBL/Gene.pm index 9c84b1bf10e0a22555042e708f90b76fc06b8a3f..e88514f9276cc6f63e1c858d6d3542cebc60049d 100755 --- a/modules/Bio/EnsEMBL/Gene.pm +++ b/modules/Bio/EnsEMBL/Gene.pm @@ -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 diff --git a/modules/Bio/EnsEMBL/Transcript.pm b/modules/Bio/EnsEMBL/Transcript.pm index bc96466d9316cf5af5d445e7bb2af04077c82de8..208ecf92f245d38a2e9fb14ccc9ce4be3b89c0eb 100755 --- a/modules/Bio/EnsEMBL/Transcript.pm +++ b/modules/Bio/EnsEMBL/Transcript.pm @@ -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 ########################### diff --git a/modules/Bio/EnsEMBL/Translation.pm b/modules/Bio/EnsEMBL/Translation.pm index f1ec6cdf16b2711ea3b72abfc0990ba1bb58483d..792109e183be4534f65617b9ebdabe95c463db88 100755 --- a/modules/Bio/EnsEMBL/Translation.pm +++ b/modules/Bio/EnsEMBL/Translation.pm @@ -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