[Bioperl-guts-l] bioperl-live/Bio/Tools Genemark.pm,1.18,1.19

Christopher John Fields cjfields at dev.open-bio.org
Mon Mar 19 16:23:45 EDT 2007


Update of /home/repository/bioperl/bioperl-live/Bio/Tools
In directory dev.open-bio.org:/tmp/cvs-serv10343

Modified Files:
	Genemark.pm 
Log Message:
bug 2240

Index: Genemark.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Tools/Genemark.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Genemark.pm	26 Sep 2006 22:03:17 -0000	1.18
--- Genemark.pm	19 Mar 2007 20:23:43 -0000	1.19
***************
*** 107,110 ****
--- 107,134 ----
  use base qw(Bio::Tools::AnalysisResult);
  
+ =head2 new
+ 
+  Title   : new
+  Usage   : my $obj = new Bio::Tools::Genemark();
+  Function: Builds a new Bio::Tools::Genemark object
+  Returns : an instance of Bio::Tools::Genemark
+  Args    : seqname
+ 
+ 
+ =cut
+ 
+ sub new {
+   my($class, at args) = @_;
+ 
+   my $self = $class->SUPER::new(@args);
+ 
+   my ($seqname) = $self->_rearrange([qw(SEQNAME)], @args);
+ 
+   # hardwire seq_id when creating gene and exon objects
+   $self->_seqname($seqname) if defined($seqname);
+ 
+   return $self;
+ }
+ 
  sub _initialize_state {
      my ($self, at args) = @_;
***************
*** 222,225 ****
--- 246,253 ----
      my $current_gene_no = -1;
  
+     # The prediction report does not contain a sequence identifier
+     # (at least the prokaryotic version doesn't)
+     my $seqname = $self->_seqname();
+     
      while(defined($_ = $self->_readline())) {
  
***************
*** 269,273 ****
  
      	    $predobj->is_coding(1);
! 		
  		
  	    # frame calculation as in the genscan module
--- 297,302 ----
  
      	    $predobj->is_coding(1);
! 
!             $predobj->seq_id($seqname) if (defined($seqname) && ($seqname ne 'unknown'));
  		
  	    # frame calculation as in the genscan module
***************
*** 289,292 ****
--- 318,322 ----
                  $self->_add_prediction($gene);		
  		$current_gene_no = $prednr;
+                 $gene->seq_id($seqname) if (defined($seqname) && ($seqname ne 'unknown'));
  	    }
  	
***************
*** 509,512 ****
--- 539,562 ----
  }
  
+ =head2 _seqname
+ 
+  Title   : _seqname
+  Usage   : $obj->_seqname($seqname)
+  Function: internal
+  Example :
+  Returns : String
+ 
+ =cut
+ 
+ sub _seqname {
+     my ($self, $val) = @_;
+ 
+     $self->{'_seqname'} = $val if $val;
+     if(! exists($self->{'_seqname'})) {
+         $self->{'_seqname'} = 'unknown';
+     }
+     return $self->{'_seqname'};
+ }
+ 
  1;
  



More information about the Bioperl-guts-l mailing list