From fc2098b8f50745c28e730257bea398bb68168b3e Mon Sep 17 00:00:00 2001
From: Ian Longden <ianl@sanger.ac.uk>
Date: Fri, 4 Mar 2011 09:52:59 +0000
Subject: [PATCH] dbentries MUST have an analysis now due to INSERT IGNORE in
 dbentrie cahnged to just INSERT

---
 modules/t/dbEntries.t | 12 ++++++++----
 modules/t/gene.t      |  5 ++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/modules/t/dbEntries.t b/modules/t/dbEntries.t
index ffab63c3d3..0b2c081cf0 100644
--- a/modules/t/dbEntries.t
+++ b/modules/t/dbEntries.t
@@ -77,6 +77,8 @@ debug( "GoXrefs and IdentityXrefs: ".$goxref_count . " " . $ident_count);
 ok( $goxref_count == 48 );
 ok( $ident_count == 32 );
 
+my $analysis_adap = $db->get_AnalysisAdaptor();
+my $analysis = $analysis_adap->fetch_by_logic_name("RepeatMask");
 
 # try storing and retrieval
 
@@ -92,7 +94,8 @@ my $xref = Bio::EnsEMBL::DBEntry->new
    -db_display_name => "Nice friendly name",
    -info_type => "PROJECTION",
    -info_text => "from human gene ENSG0000011111",
-   -type => "ARRAY"
+   -type => "ARRAY",
+    -analysis => $analysis
    );
 
 
@@ -104,8 +107,8 @@ my $ident_xref = Bio::EnsEMBL::IdentityXref->new
    -primary_id => "1",
    -dbname => "Uniprot/SPTREMBL",
    -release => "1",
-   -display_id => "Ens related Ident"
-   );
+   -display_id => "Ens related Ident",
+   -analysis => $analysis   );
 
 $ident_xref->xref_identity( 100 );
 $ident_xref->ensembl_identity( 95 );
@@ -115,7 +118,8 @@ my $goref = Bio::EnsEMBL::OntologyXref->new
    -primary_id => "1",
    -dbname => "GO",
    -release => "1",
-   -display_id => "Ens related GO"
+   -display_id => "Ens related GO",
+   -analysis => $analysis
    );
 $goref->add_linkage_type( "IC" ); # Linkage type on own
 $goref->add_linkage_type( "ISS", $goref ); # Linkage type with source xref
diff --git a/modules/t/gene.t b/modules/t/gene.t
index 3566231d2a..f676157b8d 100644
--- a/modules/t/gene.t
+++ b/modules/t/gene.t
@@ -613,12 +613,15 @@ $multi->hide( "core", "gene", "transcript", "exon", 'xref', 'object_xref',
               "exon_transcript", "translation" );
 
 $gene->analysis($analysis);
+my $analysis_adap = $db->get_AnalysisAdaptor();
+my $analysis = $analysis_adap->fetch_by_logic_name("ensembl");
 
 my $dbe = Bio::EnsEMBL::DBEntry->new(-primary_id => 'test_id',
                                      -version    => 1,
                                      -dbname     => 'EMBL',
                                      -release    => 1,
-                                     -display_id => 'test_id');
+                                     -display_id => 'test_id',
+	                             -analysis   => $analysis);
 
 
 $gene->add_DBEntry($dbe);
-- 
GitLab