[BioRuby-cvs] bioruby/lib/bio/db/genbank genbank.rb, 0.34, 0.35 genpept.rb, 1.8, 1.9

Katayama Toshiaki k at pub.open-bio.org
Mon Sep 26 09:24:27 EDT 2005


Update of /home/repository/bioruby/bioruby/lib/bio/db/genbank
In directory pub.open-bio.org:/tmp/cvs-serv17639

Modified Files:
	genbank.rb genpept.rb 
Log Message:
* 'seq_len' method is renamed to 'length' which returns the sequence
  length written in the LOCUS line
* 'seq_len' method is re-defined as a method to count the actual sequence
  length in ORIGIN line by calling Bio::Sequence#length (which is inherited
  from the Ruby's String class)


Index: genpept.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/genpept.rb,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** genpept.rb	26 Sep 2005 13:13:23 -0000	1.8
--- genpept.rb	26 Sep 2005 13:24:25 -0000	1.9
***************
*** 33,42 ****
      def initialize(locus_line)
        @entry_id = locus_line[12..27].strip
!       @seq_len  = locus_line[29..39].to_i
        @circular = locus_line[55..62].strip	# always linear
        @division = locus_line[63..66].strip
        @date     = locus_line[68..78].strip
      end
!     attr_accessor :entry_id, :seq_len, :circular, :division, :date
    end
  
--- 33,42 ----
      def initialize(locus_line)
        @entry_id = locus_line[12..27].strip
!       @length   = locus_line[29..39].to_i
        @circular = locus_line[55..62].strip	# always linear
        @division = locus_line[63..66].strip
        @date     = locus_line[68..78].strip
      end
!     attr_accessor :entry_id, :length, :circular, :division, :date
    end
  
***************
*** 45,49 ****
    end
    def entry_id;		locus.entry_id;		end
!   def seq_len;		locus.seq_len;		end
    def circular;		locus.circular;		end
    def division;		locus.division;		end
--- 45,49 ----
    end
    def entry_id;		locus.entry_id;		end
!   def length;		locus.length;		end
    def circular;		locus.circular;		end
    def division;		locus.division;		end
***************
*** 59,64 ****
    end
    alias aaseq seq
!   alias aalen seq_len
  
  
    # DBSOURCE
--- 59,67 ----
    end
    alias aaseq seq
!   alias aalen length
  
+   def seq_len
+     seq.length
+   end
  
    # DBSOURCE

Index: genbank.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/genbank.rb,v
retrieving revision 0.34
retrieving revision 0.35
diff -C2 -d -r0.34 -r0.35
*** genbank.rb	26 Sep 2005 13:00:07 -0000	0.34
--- genbank.rb	26 Sep 2005 13:24:25 -0000	0.35
***************
*** 33,37 ****
        if locus_line.length > 75 			# after Rel 126.0
          @entry_id = locus_line[12..27].strip
!         @seq_len  = locus_line[29..39].to_i
          @strand   = locus_line[44..46].strip
          @natype   = locus_line[47..52].strip
--- 33,37 ----
        if locus_line.length > 75 			# after Rel 126.0
          @entry_id = locus_line[12..27].strip
!         @length   = locus_line[29..39].to_i
          @strand   = locus_line[44..46].strip
          @natype   = locus_line[47..52].strip
***************
*** 41,45 ****
        else
          @entry_id = locus_line[12..21].strip
!         @seq_len  = locus_line[22..29].to_i
          @strand   = locus_line[33..35].strip
          @natype   = locus_line[36..39].strip
--- 41,45 ----
        else
          @entry_id = locus_line[12..21].strip
!         @length   = locus_line[22..29].to_i
          @strand   = locus_line[33..35].strip
          @natype   = locus_line[36..39].strip
***************
*** 49,53 ****
        end
      end
!     attr_accessor :entry_id, :seq_len, :strand, :natype, :circular,
        :division, :date
    end
--- 49,53 ----
        end
      end
!     attr_accessor :entry_id, :length, :strand, :natype, :circular,
        :division, :date
    end
***************
*** 57,61 ****
    end
    def entry_id;		locus.entry_id;		end
!   def seq_len;		locus.seq_len;		end
    def circular;		locus.circular;		end
    def division;		locus.division;		end
--- 57,61 ----
    end
    def entry_id;		locus.entry_id;		end
!   def length;		locus.length;		end
    def circular;		locus.circular;		end
    def division;		locus.division;		end
***************
*** 74,78 ****
    end
    alias naseq seq
!   alias nalen seq_len
  
  
--- 74,82 ----
    end
    alias naseq seq
!   alias nalen length
! 
!   def seq_len
!     seq.length
!   end
  
  



More information about the bioruby-cvs mailing list