[BioRuby-cvs] bioruby/lib/bio/appl/bl2seq report.rb,1.3,1.4

Naohisa Goto ngoto at pub.open-bio.org
Mon Oct 31 09:37:32 EST 2005


Update of /home/repository/bioruby/bioruby/lib/bio/appl/bl2seq
In directory pub.open-bio.org:/tmp/cvs-serv32761

Modified Files:
	report.rb 
Log Message:
Changes to follow modifications of Bio::Blast::Default::Report classes.
Added RDoc documents.


Index: report.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/bl2seq/report.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** report.rb	8 Sep 2005 01:22:08 -0000	1.3
--- report.rb	31 Oct 2005 14:37:30 -0000	1.4
***************
*** 1,7 ****
  #
! # bio/appl/bl2seq/report.rb - bl2seq (BLAST 2 sequences) parser
  # 
! #   Copyright (C) 2005 GOTO Naohisa <ng at bioruby.org>
  #
  #  This library is free software; you can redistribute it and/or
  #  modify it under the terms of the GNU Lesser General Public
--- 1,9 ----
  #
! # = bio/appl/bl2seq/report.rb - bl2seq (BLAST 2 sequences) parser
  # 
! # Copyright:: Copyright (C) 2005 GOTO Naohisa <ng at bioruby.org>
! # Licence::   LGPL
  #
+ #--
  #  This library is free software; you can redistribute it and/or
  #  modify it under the terms of the GNU Lesser General Public
***************
*** 17,36 ****
  #  License along with this library; if not, write to the Free Software
  #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
  #  $Id$
  #
! #  Acknowledgements:
! #    Thanks to Tomoaki NISHIYAMA <tomoakin at kenroku.kanazawa-u.ac.jp> 
! #    for providing bl2seq parser patches based on
! #    lib/bio/appl/blast/format0.rb.
  #
  
  require 'bio/appl/blast/format0'
  
! module Bio
! class Blast
  
!   class Bl2seq
      class Report < Bio::Blast::Default::Report
        DELIMITER = RS = nil
  
--- 19,50 ----
  #  License along with this library; if not, write to the Free Software
  #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ #++
  #
  #  $Id$
  #
! # Bio::Bl2seq::Report is a NCBI bl2seq (BLAST 2 sequences) output parser.
! #
! # = Acknowledgements
! #
! # Thanks to Tomoaki NISHIYAMA <tomoakin __at__ kenroku.kanazawa-u.ac.jp> 
! # for providing bl2seq parser patches based on
! # lib/bio/appl/blast/format0.rb.
  #
  
  require 'bio/appl/blast/format0'
  
! module Bio #:nodoc:
! class Blast #:nodoc:
  
!   class Bl2seq #:nodoc:
! 
!     # Bio::Bl2seq::Report is a NCBI bl2seq (BLAST 2 sequences) output parser.
!     # It inherits Bio::Blast::Default::Report.
!     # Most of its methods are the same as Bio::Blast::Default::Report,
!     # but it lacks many methods.
      class Report < Bio::Blast::Default::Report
+ 
+       # Delimiter of each entry. Bio::FlatFile uses it.
+       # In Bio::Bl2seq::Report, it it nil (1 entry 1 file).
        DELIMITER = RS = nil
  
***************
*** 39,46 ****
--- 53,63 ----
          message, converged?, reference, db
  
+       # Splits headers.
        def format0_split_headers(data)
          @f0query = data.shift
        end
+       private :format0_split_headers
  
+       # Splits the search results.
        def format0_split_search(data)
          iterations = []
***************
*** 53,58 ****
          iterations
        end
  
!       class F0dbstat < Bio::Blast::Default::Report::F0dbstat
          def db_num
            unless defined?(@db_num)
--- 70,79 ----
          iterations
        end
+       private :format0_split_search
  
!       # Stores format0 database statistics.
!       # Internal use only. Users must not use the class.
!       class F0dbstat < Bio::Blast::Default::Report::F0dbstat #:nodoc:
!         # Returns number of sequences in database.
          def db_num
            unless defined?(@db_num)
***************
*** 63,66 ****
--- 84,88 ----
          end
  
+         # Returns number of letters in database.
          def db_len
            unless defined?(@db_len)
***************
*** 72,79 ****
        end #class F0dbstat
  
        class Iteration < Bio::Blast::Default::Report::Iteration
          def initialize(data)
            @f0stat = []
!           @f0dbstat = nil
            @hits = []
            @num = 1
--- 94,111 ----
        end #class F0dbstat
  
+       # Bio::Bl2seq::Report::Iteration stores information about
+       # a iteration.
+       # Normally, it may contain some Bio::Bl2seq::Report::Hit objects.
+       #
+       # Note that its main existance reason is to keep complatibility
+       # between Bio::Blast::Default::Report::* classes.
        class Iteration < Bio::Blast::Default::Report::Iteration
+         # Creates a new Iteration object.
+         # It is designed to be called only internally from
+         # the Bio::Blast::Default::Report class.
+         # Users shall not use the method directly.
          def initialize(data)
            @f0stat = []
!           @f0dbstat = Bio::Blast::Default::Report::AlwaysNil.instance
            @hits = []
            @num = 1
***************
*** 83,88 ****
          end
  
          def hits; @hits; end
!         undef message, pattern_in_database, f0message, f0hitlist,
            pattern, pattern_positions, hits_found_again,
            hits_newly_found, hits_for_pattern, parse_hitlist,
--- 115,123 ----
          end
  
+         # Returns the hits of the iteration.
+         # It returns an array of Bio::Bl2seq::Report::Hit objects.
          def hits; @hits; end
! 
!         undef message, pattern_in_database, 
            pattern, pattern_positions, hits_found_again,
            hits_newly_found, hits_for_pattern, parse_hitlist,
***************
*** 90,97 ****
        end #class Iteration
  
        class Hit < Bio::Blast::Default::Report::Hit
        end #class Hit
  
!       # NOTE: HSP class below is NOT used!!
        class HSP < Bio::Blast::Default::Report::HSP
        end #class HSP
--- 125,141 ----
        end #class Iteration
  
+       # Bio::Bl2seq::Report::Hit contains information about a hit.
+       # It may contain some Bio::Blast::Default::Report::HSP objects.
+       # All methods are the same as Bio::Blast::Default::Report::Hit class.
+       # Please refer to Bio::Blast::Default::Report::Hit.
        class Hit < Bio::Blast::Default::Report::Hit
        end #class Hit
  
!       # Bio::Bl2seq::Report::HSP holds information about the hsp
!       # (high-scoring segment pair).
!       # NOTE that the HSP class below is NOT used because
!       # Ruby's constants namespace are normally statically determined
!       # and HSP object is created in Bio::Blast::Default::Report::Hit class.
!       # Please refer to Bio::Blast::Default::Report::HSP.
        class HSP < Bio::Blast::Default::Report::HSP
        end #class HSP



More information about the bioruby-cvs mailing list