diff --git a/misc-scripts/frameshift_transcript_attribs.pl b/misc-scripts/frameshift_transcript_attribs.pl index 2eb599229619f22cd3a018e4520106bf5120e724..d1805c073aa4c58009efde6a167debcf4a6b421b 100644 --- a/misc-scripts/frameshift_transcript_attribs.pl +++ b/misc-scripts/frameshift_transcript_attribs.pl @@ -96,7 +96,7 @@ for my $dbname ( @dbnames ) { my $transcript = $transcript_adaptor->fetch_by_dbID($transcript_id); - $attribute_adaptor->store_on_Transcript($transcript, \@attribs) if (!$nostore); + $attribute_adaptor->store_on_Transcript($transcript->dbID, \@attribs) if (!$nostore); print join("\t", $stable_id, $start, $end, $strand, $intron_length, $seq_region_name, "\n") if ($locations); diff --git a/misc-scripts/surgery/shortintrons2frameshifts.pl b/misc-scripts/surgery/shortintrons2frameshifts.pl index 5e5e25c4785b12515874f1d0ad2f611e57f3e70c..c8a0178d8d66dcf422d9e9f4b87b456a7f3e1ea2 100644 --- a/misc-scripts/surgery/shortintrons2frameshifts.pl +++ b/misc-scripts/surgery/shortintrons2frameshifts.pl @@ -165,7 +165,7 @@ foreach my $gene_id (@gene_ids) { -START => $cdna_start, -END => $cdna_start + $fs->length() - 1, -ALT_SEQ => ''); - $aa->store_on_Transcript($tr, [$seqed->get_Attribute]); + $aa->store_on_Transcript($tr->dbID, [$seqed->get_Attribute]); # adjust cdna coordinates for frameshifted basepairs if($tr->translation) { diff --git a/modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm index 89e3a1581b7eb0e39022b0f0e03de45a7718181f..d1800be2aea40f346e000815ff323e799e3f8192 100644 --- a/modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/AttributeAdaptor.pm @@ -414,14 +414,13 @@ sub store_on_MiscFeature { =head2 store_on_Gene - Arg [1] : Bio::EnsEMBL::Gene $gene + Arg [1] : Int $gene_id - the dbID of the gene to store the attributes for Arg [2] : listref Bio::EnsEMBL::Attribute $attribs Example : $attribute_adaptor->store_on_Gene($my_gene, $attributes) Description: Stores all the attributes on the Gene. Will duplicate things if called twice. Returntype : none Exceptions : throw on incorrect arguments - throw if provided Gene is not stored in this database Caller : general, GeneAdaptor Status : Stable @@ -429,25 +428,16 @@ sub store_on_MiscFeature { sub store_on_Gene { my $self = shift; - my $gene = shift; + my $gene_id = shift; my $attributes = shift; - if(!ref($gene) || !$gene->isa('Bio::EnsEMBL::Gene')) { - throw("Gene argument expected"); - } + my $gene_dbID = $self->_id_check($gene_id); if(ref($attributes) ne 'ARRAY') { throw("Reference to list of Bio::EnsEMBL::Attribute objects argument " . "expected"); } - my $db = $self->db(); - if(!$gene->is_stored($db)) { - throw("Gene is not stored in this DB - cannot store attributes."); - } - - my $gene_id = $gene->dbID(); - my $sth = $self->prepare( "INSERT into gene_attrib ". "SET gene_id = ?, attrib_type_id = ?, ". "value = ? " ); @@ -457,8 +447,8 @@ sub store_on_Gene { throw("Reference to list of Bio::EnsEMBL::Attribute objects " . "argument expected."); } - my $atid = $self->_store_type( $attrib ); - $sth->execute( $gene_id, $atid, $attrib->value() ); + my $atid = $self->_store_type($attrib); + $sth->execute($gene_dbID, $atid, $attrib->value); } return; @@ -467,54 +457,44 @@ sub store_on_Gene { =head2 store_on_Transcript - Arg [1] : Bio::EnsEMBL::Transcript $transcript + Arg [1] : Int $trans_id + The dbID of the transcript to store the attributes for Arg [2] : listref Bio::EnsEMBL::Attribute $attribs - Example : $attribute_adaptor->store_on_Transcript($my_transcript, - $attributes) + Example : $attribute_adaptor->store_on_Transcript($trans_id, $attributes) Description: Stores all the attributes on the Transcript. Will duplicate things if called twice. Returntype : none Exceptions : throw on incorrect arguments - throw if provided Transcript is not stored in this database Caller : general, TranscriptAdaptor Status : Stable =cut sub store_on_Transcript { - my $self = shift; - my $transcript = shift; + my $self = shift; + my $trans_id = shift; my $attributes = shift; - if(!ref($transcript) || !$transcript->isa('Bio::EnsEMBL::Transcript')) { - throw("Transcript argument expected"); - } - - if(ref($attributes) ne 'ARRAY') { + my $trans_dbID = $self->_id_check($trans_id); + + if (ref($attributes) ne 'ARRAY') { throw("Reference to list of Bio::EnsEMBL::Attribute objects argument " . "expected"); } - my $db = $self->db(); - if(!$transcript->is_stored($db)) { - throw("Transcript is not stored in this DB - cannot store attributes."); - } - - my $transcript_id = $transcript->dbID(); - my $sth = $self->prepare( "INSERT into transcript_attrib ". "SET transcript_id = ?, attrib_type_id = ?, ". "value = ? " ); - for my $attrib ( @$attributes ) { - if(!ref($attrib) && $attrib->isa('Bio::EnsEMBL::Attribute')) { + for my $attrib (@$attributes) { + if (!ref($attrib) && $attrib->isa('Bio::EnsEMBL::Attribute')) { throw("Reference to list of Bio::EnsEMBL::Attribute objects " . "argument expected."); } - my $atid = $self->_store_type( $attrib ); - $sth->bind_param(1,$transcript_id,SQL_INTEGER); - $sth->bind_param(2,$atid,SQL_INTEGER); - $sth->bind_param(3,$attrib->value,SQL_VARCHAR); + my $atid = $self->_store_type($attrib); + $sth->bind_param(1,$trans_dbID, SQL_INTEGER); + $sth->bind_param(2,$atid, SQL_INTEGER); + $sth->bind_param(3,$attrib->value, SQL_VARCHAR); $sth->execute(); } @@ -525,54 +505,44 @@ sub store_on_Transcript { =head2 store_on_Translation - Arg [1] : Bio::EnsEMBL::Translation $translation + Arg [1] : Int $transl_id + The dbID of the translation to store the attributes for Arg [2] : listref Bio::EnsEMBL::Attribute $attribs - Example : $attribute_adaptor->store_on_Translation($my_translation, - $attributes) + Example : $attribute_adaptor->store_on_Translation($transl_id, $attributes) Description: Stores all the attributes on the Translation. Will duplicate things if called twice. Returntype : none Exceptions : throw on incorrect arguments - throw if provided Translation is not stored in this database Caller : general, TranslationAdaptor Status : Stable =cut sub store_on_Translation { - my $self = shift; - my $translation = shift; - my $attributes = shift; - - if(!ref($translation) || !$translation->isa('Bio::EnsEMBL::Translation')) { - throw("Translation argument expected"); - } + my $self = shift; + my $transl_id = shift; + my $attributes = shift; - if(ref($attributes) ne 'ARRAY') { + my $transl_dbID = $self->_id_check($transl_id); + + if (ref($attributes) ne 'ARRAY') { throw("Reference to list of Bio::EnsEMBL::Attribute objects argument " . "expected"); } - my $db = $self->db(); - if(!$translation->is_stored($db)) { - throw("Translation is not stored in this DB - cannot store attributes."); - } - - my $translation_id = $translation->dbID(); - my $sth = $self->prepare( "INSERT into translation_attrib ". "SET translation_id = ?, attrib_type_id = ?, ". "value = ? " ); - for my $attrib ( @$attributes ) { - if(!ref($attrib) && $attrib->isa('Bio::EnsEMBL::Attribute')) { + for my $attrib (@$attributes) { + if (!ref($attrib) && $attrib->isa('Bio::EnsEMBL::Attribute')) { throw("Reference to list of Bio::EnsEMBL::Attribute objects " . "argument expected."); } - my $atid = $self->_store_type( $attrib ); - $sth->bind_param(1,$translation_id,SQL_INTEGER); - $sth->bind_param(2,$atid,SQL_INTEGER); - $sth->bind_param(3,$attrib->value,SQL_VARCHAR); + my $atid = $self->_store_type($attrib); + $sth->bind_param(1,$transl_dbID, SQL_INTEGER); + $sth->bind_param(2,$atid, SQL_INTEGER); + $sth->bind_param(3,$attrib->value, SQL_VARCHAR); $sth->execute(); } @@ -823,8 +793,37 @@ sub remove_from_Translation { } +# +# _id_check +# +# backwards compatibility check: +# check if $ensID is an object; if so, return $obj->dbID +# + +sub _id_check { + my $self = shift; + my $ensID = shift; + if ($ensID =~ /^\d+$/) { + return $ensID; + + } elsif (ref($ensID) eq 'Bio::EnsEMBL::Gene' or + ref($ensID) eq 'Bio::EnsEMBL::Transcript' or + ref($ensID) eq 'Bio::EnsEMBL::Translation') { + warning("You should pass a dbID rather than an ensembl object to store the attribute on"); + + if ($ensID->dbID) { + return $ensID->dbID; + } else { + throw("Ensembl object ".$ensID->display_id." doesn't have a dbID, can't store attribute"); + } + + } else { + throw("Invalid dbID"); + } + +} # _store_type @@ -865,13 +864,10 @@ sub _store_type { $sth1->finish(); - return $atid; } - - sub _obj_from_sth { my $self = shift; my $sth = shift; diff --git a/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm index 7ce2013edc14debe89a4cd0684381cd8129eca27..401b346e13d4464aba9194a73b5094603251ebc3 100644 --- a/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/DBEntryAdaptor.pm @@ -203,33 +203,56 @@ sub fetch_by_db_accession { } - =head2 store Arg [1] : Bio::EnsEMBL::DBEntry $exObj The DBEntry (xref) to be stored - Arg [2] : Bio::EnsEMBL::Transcript, Bio::EnsEMBL::Gene or - Bio::EnsEMBL::Translation $ensObject - An EnsEMBL object to associate with this external database entry - Arg [3] : string $ensType ('Transcript', 'Translation', 'Gene'); + Arg [2] : Int $ensID + The dbID of an EnsEMBL object to associate with this external + database entry + Arg [3] : string $ensType ('Transcript', 'Translation', 'Gene') The type of EnsEMBL object that this external database entry is being associated with. - Example : $dbea->store($db_entry, $transcript, 'Transcript'); + Example : $dbea->store($db_entry, $transcript_id, 'Transcript'); Description: Stores a reference to an external database (if it is not stored already) and associates an EnsEMBL object of a specified type with the external identifier. - Returntype : int - the identifier of the newly created external refernce - Exceptions : none - Caller : scripts which load Xrefs and ObjectXrefs, etc. into EnsEMBL. + Returntype : int - the dbID of the newly created external refernce + Exceptions : thrown when invalid dbID is passed to this method + Caller : scripts which load Xrefs and ObjectXrefs, etc. into Ensembl Status : Stable =cut - sub store { - my ( $self, $exObj, $ensObject, $ensType ) = @_; + my ( $self, $exObj, $ensID, $ensType ) = @_; my $dbJustInserted; + # + # backwards compatibility check: + # check if $ensID is an object; if so, use $obj->dbID + # + my $ensembl_id; + + if ($ensID =~ /^\d+$/) { + $ensembl_id = $ensID; + + } elsif ( ref($ensID) eq 'Bio::EnsEMBL::Gene' or + ref($ensID) eq 'Bio::EnsEMBL::Transcript' or + ref($ensID) eq 'Bio::EnsEMBL::Translation') { + + warning("You should pass DBEntryAdaptor->store() a dbID rather than an ensembl object to store the xref on"); + + if ($ensID->dbID) { + $ensembl_id = $ensID->dbID; + } else { + throw("$ensType ".$ensID->display_id." doesn't have a dbID, can't store xref"); + } + + } else { + throw("Invalid dbID passed to DBEntryAdaptor->store()"); + } + # # Check for the existance of the external_db, throw if it does not exist # @@ -328,7 +351,7 @@ sub store { AND ensembl_id = ?"); $sth->bind_param(1,$dbX,SQL_INTEGER); $sth->bind_param(2,$ensType,SQL_VARCHAR); - $sth->bind_param(3,$ensObject->dbID,SQL_INTEGER); + $sth->bind_param(3,$ensembl_id,SQL_INTEGER); $sth->execute(); my ($tst) = $sth->fetchrow_array; $sth->finish(); @@ -342,7 +365,7 @@ sub store { $sth->bind_param(1,$dbX,SQL_INTEGER); $sth->bind_param(2,$ensType,SQL_VARCHAR); - $sth->bind_param(3,$ensObject->dbID,SQL_INTEGER); + $sth->bind_param(3,$ensembl_id,SQL_INTEGER); $sth->execute(); $exObj->dbID( $dbX ); @@ -630,7 +653,7 @@ sub remove_from_object { =head2 _fetch_by_object_type - Arg [1] : string $ensObj + Arg [1] : string $ensID Arg [2] : string $ensType (object type to be returned) Example : $self->_fetch_by_object_type( $translation_id, 'Translation' ) @@ -646,10 +669,10 @@ sub remove_from_object { =cut sub _fetch_by_object_type { - my ( $self, $ensObj, $ensType ) = @_; + my ( $self, $ensID, $ensType ) = @_; my @out; - if (!defined($ensObj)) { + if (!defined($ensID)) { throw("Can't fetch_by_EnsObject_type without an object"); } if (!defined($ensType)) { @@ -677,7 +700,7 @@ sub _fetch_by_object_type { AND oxr.ensembl_object_type = ? "); - $sth->bind_param(1,$ensObj,SQL_INTEGER); + $sth->bind_param(1,$ensID,SQL_INTEGER); $sth->bind_param(2,$ensType,SQL_VARCHAR); $sth->execute(); my (%seen, %linkage_types, %synonyms); diff --git a/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm index db17e8dbd03f9adc7fe92ae0c22fa4b56e0ba8de..a428da13b630988dbec06f692d972f114799cfc1 100644 --- a/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/GeneAdaptor.pm @@ -823,10 +823,6 @@ sub store { my $gene_dbID = $sth->{'mysql_insertid'}; - # set dbID and adaptor of gene here - you'll need this when storing xrefs - $gene->dbID($gene_dbID); - $gene->adaptor($self); - # store stable ids if they are available if (defined($gene->stable_id)) { @@ -834,18 +830,10 @@ sub store { SET gene_id = ?, stable_id = ?, version = ?, "; - $statement .= "created_date = " . $self->db->dbc->from_seconds_to_date($gene->created_date()) . ","; -# if( $gene->created_date() ) { -# $statement .= "created_date = from_unixtime( ".$gene->created_date()."),"; -# } else { -# $statement .= "created_date = \"0000-00-00 00:00:00\","; -# } - $statement .= "modified_date = " . $self->db->dbc->from_seconds_to_date($gene->modified_date()); -# if( $gene->modified_date() ) { -# $statement .= "modified_date = from_unixtime( ".$gene->modified_date().")"; -# } else { -# $statement .= "modified_date = \"0000-00-00 00:00:00\""; -# } + $statement .= "created_date = " . + $self->db->dbc->from_seconds_to_date($gene->created_date()) . ","; + $statement .= "modified_date = " . + $self->db->dbc->from_seconds_to_date($gene->modified_date()); $sth = $self->prepare($statement); $sth->bind_param(1,$gene_dbID,SQL_INTEGER); @@ -859,7 +847,7 @@ sub store { my $dbEntryAdaptor = $db->get_DBEntryAdaptor(); foreach my $dbe ( @{$gene->get_all_DBEntries} ) { - $dbEntryAdaptor->store( $dbe, $gene, "Gene" ); + $dbEntryAdaptor->store($dbe, $gene_dbID, "Gene"); } # we allow transcripts not to share equal exons and instead have copies @@ -928,15 +916,14 @@ sub store { } } - # set the adaptor and dbID on the original passed in gene not the - # transfered copy - $original->adaptor( $self ); - $original->dbID( $gene_dbID ); - # store gene attributes if there are any my $attr_adaptor = $db->get_AttributeAdaptor(); - $attr_adaptor->store_on_Gene($gene, - $gene->get_all_Attributes); + $attr_adaptor->store_on_Gene($gene_dbID, $gene->get_all_Attributes); + + # set the adaptor and dbID on the original passed in gene not the + # transfered copy + $original->adaptor($self); + $original->dbID($gene_dbID); return $gene_dbID; } diff --git a/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm index 485acb06b3a34364eaf6dda560490d3f8d0b9886..307074c427decaecb2d4a5aeef88d75fa9c90b48 100644 --- a/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/TranscriptAdaptor.pm @@ -604,11 +604,6 @@ sub store { my $transc_dbID = $tst->{'mysql_insertid'}; - # set dbID and adaptor of transcript here - you'll need this when storing - # xrefs - $transcript->dbID($transc_dbID); - $transcript->adaptor($self); - # # store translation # @@ -666,7 +661,7 @@ sub store { my $dbEntryAdaptor = $db->get_DBEntryAdaptor(); foreach my $dbe ( @{$transcript->get_all_DBEntries} ) { - $dbEntryAdaptor->store( $dbe, $transcript, "Transcript" ); + $dbEntryAdaptor->store($dbe, $transc_dbID, "Transcript"); } # @@ -791,18 +786,16 @@ sub store { $sf_sth->execute(); } - - - #update the original transcript object - not the transfered copy that - #we might have created - $original->dbID( $transc_dbID ); - $original->adaptor( $self ); - # store transcript attributes if there are any my $attr_adaptor = $db->get_AttributeAdaptor(); - $attr_adaptor->store_on_Transcript($transcript, + $attr_adaptor->store_on_Transcript($transc_dbID, $transcript->get_all_Attributes); + #update the original transcript object - not the transfered copy that + #we might have created + $original->dbID($transc_dbID); + $original->adaptor($self); + return $transc_dbID; } diff --git a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm index be72c5f7ee5e5d56f32a9e5ffdeb5d15016ae204..14c4fc7356e8ed3b9bbf7b835c4b814c67727a32 100644 --- a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm +++ b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm @@ -237,15 +237,13 @@ sub store { my $transl_dbID = $sth->{'mysql_insertid'}; - $translation->dbID($transl_dbID); - $translation->adaptor($self); - - #store object xref mappings to translations - + # + # store object xref mappings to translations + # my $dbEntryAdaptor = $self->db()->get_DBEntryAdaptor(); - #store each of the xrefs for this translation + # store each of the xrefs for this translation foreach my $dbl ( @{$translation->get_all_DBEntries} ) { - $dbEntryAdaptor->store( $dbl, $translation, "Translation" ); + $dbEntryAdaptor->store( $dbl, $transl_dbID, "Translation" ); } @@ -259,19 +257,10 @@ sub store { "SET translation_id = ?, ". " stable_id = ?, ". "version = ?, "; - $statement .= "created_date = " . $self->db->dbc->from_seconds_to_date($translation->created_date()) . ","; - -# if( $translation->created_date() ) { -# $statement .= "created_date = from_unixtime( ".$translation->created_date()."),"; -# } else { -# $statement .= "created_date = \"0000-00-00 00:00:00\","; -# } - $statement .= "modified_date = " . $self->db->dbc->from_seconds_to_date($translation->modified_date()) ; -# if( $translation->modified_date() ) { -# $statement .= "modified_date = from_unixtime( ".$translation->modified_date().")"; -# } else { -# $statement .= "modified_date = \"0000-00-00 00:00:00\""; -# } + $statement .= "created_date = " . + $self->db->dbc->from_seconds_to_date($translation->created_date()) . ","; + $statement .= "modified_date = " . + $self->db->dbc->from_seconds_to_date($translation->modified_date()) ; my $sth = $self->prepare($statement); @@ -287,9 +276,11 @@ sub store { # store any translation attributes that are defined my $attr_adaptor = $self->db->get_AttributeAdaptor(); - $attr_adaptor->store_on_Translation($translation, + $attr_adaptor->store_on_Translation($transl_dbID, $translation->get_all_Attributes()); + $translation->dbID($transl_dbID); + $translation->adaptor($self); return $transl_dbID; } diff --git a/modules/t/dbEntries.t b/modules/t/dbEntries.t index 8152408221c4bd623e6f9edcecb02acf02ebf226..7e939f56be849d387563f6ba7d9c6dd8c6b7d444 100644 --- a/modules/t/dbEntries.t +++ b/modules/t/dbEntries.t @@ -73,7 +73,7 @@ ok( $db_entry_count == $xref_count ); # # 4,5 correct number of GoXrefs and IdentityXrefs # -print $goxref_count . " " . $ident_count . "\n"; +debug( "GoXrefs and IdentityXrefs: ".$goxref_count . " " . $ident_count); ok( $goxref_count == 48 ); ok( $ident_count == 32 ); @@ -126,11 +126,11 @@ my $gene = $ga->fetch_by_dbID( $all_gene_ids->[0] ); my $tr = $gene->get_all_Transcripts()->[0]; my $tl = $tr->translation(); -$dbEntryAdaptor->store( $xref, $gene, "Gene" ); -$dbEntryAdaptor->store( $xref, $tr, "Transcript" ); -$dbEntryAdaptor->store( $goref, $tl, "Translation" ); -$dbEntryAdaptor->store( $ident_xref, $tl, "Translation" ); -$dbEntryAdaptor->store( $ident_xref, $tr, "Transcript" ); +$dbEntryAdaptor->store( $xref, $gene->dbID, "Gene" ); +$dbEntryAdaptor->store( $xref, $tr->dbID, "Transcript" ); +$dbEntryAdaptor->store( $goref, $tl->dbID, "Translation" ); +$dbEntryAdaptor->store( $ident_xref, $tl->dbID, "Translation" ); +$dbEntryAdaptor->store( $ident_xref, $tr->dbID, "Transcript" ); my ( $oxr_count, $go_count ); diff --git a/modules/t/gene.t b/modules/t/gene.t index 7d5d6177d4984908abe8b38534ad71f36d7010c6..87ee6388d44031b7efeb5ed4a148b7b170980026 100644 --- a/modules/t/gene.t +++ b/modules/t/gene.t @@ -110,7 +110,9 @@ ok($analysis); $gene = Bio::EnsEMBL::Gene->new(); my $transcript1 = Bio::EnsEMBL::Transcript->new(); +$transcript1->analysis($analysis); my $transcript2 = Bio::EnsEMBL::Transcript->new(); +$transcript2->analysis($analysis); my $ex1 = Bio::EnsEMBL::Exon->new(); my $ex2 = Bio::EnsEMBL::Exon->new(); @@ -563,10 +565,11 @@ my $second_ex = Bio::EnsEMBL::Exon->new $transcript1 = Bio::EnsEMBL::Transcript->new (-EXONS => [$first_ex, $second_ex]); +$transcript1->analysis($analysis); $transcript2 = Bio::EnsEMBL::Transcript->new (-EXONS => [$first_ex]); - +$transcript2->analysis($analysis); $gene->add_Transcript($transcript1); $gene->add_Transcript($transcript2); diff --git a/modules/t/transcript.t b/modules/t/transcript.t index 167edabfbedb5b9caaab0888b73bca90e1701e54..7c35b3acdf014fcd8512b7f5da308f85da5417a5 100644 --- a/modules/t/transcript.t +++ b/modules/t/transcript.t @@ -410,7 +410,7 @@ ok($tr->translateable_seq() eq $tlseq1); $multi->hide( "core", "transcript_attrib" ); my $attribAdaptor = $db->get_AttributeAdaptor(); -$attribAdaptor->store_on_Transcript( $tr, $tr->get_all_Attributes() ); +$attribAdaptor->store_on_Transcript($tr->dbID, $tr->get_all_Attributes); $tr = $ta->fetch_by_stable_id( "ENST00000217347" ); $tr->edits_enabled(1); diff --git a/modules/t/translation.t b/modules/t/translation.t index 326256c2ee844e8131f46f39db44c8a255e00998..13ba721b62d9d11f7b36b3a2342aa28c4f126ec6 100644 --- a/modules/t/translation.t +++ b/modules/t/translation.t @@ -200,7 +200,7 @@ $multi->hide( "core", "translation_attrib" ); my $tl = $tr->translation(); my $attrAdaptor = $db->get_AttributeAdaptor(); -$attrAdaptor->store_on_Translation( $tl, $tl->get_all_Attributes() ); +$attrAdaptor->store_on_Translation($tl->dbID, $tl->get_all_Attributes); $tr = $tra->fetch_by_stable_id( "ENST00000217347" );