Skip to content
Snippets Groups Projects
Commit 963088d3 authored by Andy Yates's avatar Andy Yates
Browse files

There are some circumstances where exon coordinate recalculation is not the...

There are some circumstances where exon coordinate recalculation is not the right thing to do and the user has them correctly set out (ori spanning transcription models). Rather than tie this directly into the coordinate recalculations we are allowing skipping this procedure. It is up to the user to do the right thing if using this module. It also does not alter any existing functionality
parent c75f8546
No related branches found
No related tags found
No related merge requests found
......@@ -1141,6 +1141,8 @@ sub store_alt_alleles {
The gene to store in the database
Arg [2] : ignore_release in xrefs [default 1] set to 0 to use release info
in external database references
Arg [3] : prevent coordinate recalculation if you are persisting
transcripts with this gene
Example : $gene_adaptor->store($gene);
Description: Stores a gene in the database.
Returntype : the database identifier (dbID) of the newly stored gene
......@@ -1152,7 +1154,7 @@ sub store_alt_alleles {
=cut
sub store {
my ($self, $gene, $ignore_release) = @_;
my ($self, $gene, $ignore_release, $skip_recalculating_coordinates) = @_;
if (!ref $gene || !$gene->isa('Bio::EnsEMBL::Gene')) {
throw("Must store a gene object, not a $gene");
......@@ -1281,7 +1283,7 @@ sub store {
my $new = $transcripts->[$i];
my $old = $original_transcripts->[$i];
$transcript_adaptor->store($new, $gene_dbID, $analysis_id);
$transcript_adaptor->store($new, $gene_dbID, $analysis_id, $skip_recalculating_coordinates);
if (!defined($new_canonical_transcript_id)
&& $new->is_canonical())
......
......@@ -749,6 +749,8 @@ sub fetch_all_by_biotype {
backward compatibility only and used to fall back to the gene
analysis_id if no analysis object is attached to the transcript
(which you should do for new code).
Arg [4] : prevent coordinate recalculation if you are persisting
transcripts with this gene
Example : $transID = $tr_adaptor->store($transcript, $gene->dbID);
Description: Stores a transcript in the database and returns the new
internal identifier for the stored transcript.
......@@ -760,7 +762,7 @@ sub fetch_all_by_biotype {
=cut
sub store {
my ( $self, $transcript, $gene_dbID, $analysis_id ) = @_;
my ( $self, $transcript, $gene_dbID, $analysis_id, $skip_recalculating_coordinates ) = @_;
if ( !ref($transcript)
|| !$transcript->isa('Bio::EnsEMBL::Transcript') )
......@@ -775,7 +777,12 @@ sub store {
}
# Force lazy-loading of exons and ensure coords are correct.
$transcript->recalculate_coordinates();
# If we have been told not to do this then skip doing this
# and we assume the user knows what they are doing. You have been
# warned
if(! $skip_recalculating_coordinates) {
$transcript->recalculate_coordinates();
}
my $is_current = ( defined( $transcript->is_current() )
? $transcript->is_current()
......
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