From 335232027e6670682f996cb90e60914ad0408c31 Mon Sep 17 00:00:00 2001
From: James Gilbert <jgrg@sanger.ac.uk>
Date: Thu, 30 Oct 2003 13:40:22 +0000
Subject: [PATCH] fixed CORE::length warnings in Transcript added TYPE
 parameter to DBAdaptor constructor

---
 modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm | 6 +++++-
 modules/Bio/EnsEMBL/Transcript.pm      | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm
index 7cc96fb25e..357341a58e 100755
--- a/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm
+++ b/modules/Bio/EnsEMBL/DBSQL/DBAdaptor.pm
@@ -57,6 +57,7 @@ use Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor;
   Arg [-DNADB]: (optional) Bio::EnsEMBL::DBSQL::DBAdaptor DNADB 
                All sequence, assembly, contig information etc, will be
                 retrieved from this database instead.              
+  Arg [-TYPE]: (optional) An assembly_type
   Arg [..]   : Other args are passed to superclass 
                Bio::EnsEMBL::DBSQL::DBConnection
   Example    : $db = new Bio::EnsEMBL::DBSQL::DBAdaptor(
@@ -77,11 +78,14 @@ sub new {
   #call superclass constructor
   my $self = $class->SUPER::new(@args);
   
-  my ( $dnadb ) = $self->_rearrange([qw(DNADB)],@args);  
+  my ( $dnadb, $assembly_type ) = $self->_rearrange([qw(DNADB TYPE)],@args);  
 
   if(defined $dnadb) {
     $self->dnadb($dnadb);
   }
+    if ($assembly_type) {
+      $self->assembly_type($assembly_type);
+    }
 
 	# $self here is actually a Container object
 	# so need to call _obj to get the DBAdaptor
diff --git a/modules/Bio/EnsEMBL/Transcript.pm b/modules/Bio/EnsEMBL/Transcript.pm
index ca55a82ded..4b01b092cd 100755
--- a/modules/Bio/EnsEMBL/Transcript.pm
+++ b/modules/Bio/EnsEMBL/Transcript.pm
@@ -1156,7 +1156,7 @@ sub five_prime_utr {
   my $self = shift;
 
   my $seq = substr($self->spliced_seq, 0, $self->cdna_coding_start - 1);
-  length $seq or return;
+  CORE::length($seq) or return;
 
   return Bio::Seq->new(
 	       -DISPLAY_ID => $self->stable_id,
@@ -1169,7 +1169,7 @@ sub three_prime_utr {
   my $self = shift;
 
   my $seq = substr($self->spliced_seq, $self->cdna_coding_end);
-  length $seq or return;
+  CORE::length($seq) or return;
 
   return Bio::Seq->new(
 	       -DISPLAY_ID => $self->stable_id,
-- 
GitLab