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

Katayama Toshiaki k at pub.open-bio.org
Wed Sep 7 21:22:13 EDT 2005


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

Modified Files:
	report.rb 
Log Message:
* expanded tab at the line head


Index: report.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/targetp/report.rb,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** report.rb	26 Feb 2003 01:54:03 -0000	1.3
--- report.rb	8 Sep 2005 01:22:10 -0000	1.4
***************
*** 30,72 ****
  
        def initialize(str)
! 	@version                  = nil
! 	@query_sequences          = nil
! 	@cleavage_site_prediction = nil
! 	@networks                 = nil
! 	@prediction               = {}
! 	@cutoff                   = {}
! 	parse_entry(str)
        end
  
        attr_reader :version, :query_sequences, 
! 	:cleavage_site_prediction, :networks,
! 	:prediction, :cutoff
  
        alias :pred   :prediction
  
        def name
! 	@prediction['Name']
        end
        alias :entry_id :name 
  
        def query_len
! 	if @prediction['Len']
! 	  @prediction['Len']
! 	else
! 	  @prediction['Length']
! 	end
        end
        alias :length :query_len
  
        def loc
! 	if @prediction['Loc'] 
! 	  @prediction['Loc']   # version 1.0
! 	else
! 	  @prediction['Loc.']  # version 1.1
! 	end
        end
  
        def rc
! 	@prediction['RC']
        end
        
--- 30,72 ----
  
        def initialize(str)
!         @version                  = nil
!         @query_sequences          = nil
!         @cleavage_site_prediction = nil
!         @networks                 = nil
!         @prediction               = {}
!         @cutoff                   = {}
!         parse_entry(str)
        end
  
        attr_reader :version, :query_sequences, 
!         :cleavage_site_prediction, :networks,
!         :prediction, :cutoff
  
        alias :pred   :prediction
  
        def name
!         @prediction['Name']
        end
        alias :entry_id :name 
  
        def query_len
!         if @prediction['Len']
!           @prediction['Len']
!         else
!           @prediction['Length']
!         end
        end
        alias :length :query_len
  
        def loc
!         if @prediction['Loc'] 
!           @prediction['Loc']   # version 1.0
!         else
!           @prediction['Loc.']  # version 1.1
!         end
        end
  
        def rc
!         @prediction['RC']
        end
        
***************
*** 74,120 ****
  
        def parse_entry(str)
! 	labels = []
! 	cutoff = []
! 	values = []
  
! 	str.split("\n").each {|line|
! 	  case line
! 	  when /targetp v(\d+.\d+)/,/T A R G E T P\s+(\d+.\d+)/
! 	    @version = $1
  
! 	  when /Number of (query|input) sequences:\s+(\d+)/
! 	    @query_sequences = $1.to_i
  
! 	  when /Cleavage site predictions (\w.+)\./ 
! 	    @cleavage_site_prediction = $1
  
! 	  when /Using (\w+.+) networks/
! 	    @networks = $1
! 	  when /Name +Len/
! 	    labels = line.sub(/^\#\s*/,'').split(/\s+/)
  
! 	  when /cutoff/
! 	    cutoff = line.split(/\s+/)
! 	    cutoff.shift
! 	    labels[2, 4].each_with_index {|loc, i|
! 	      next if loc =~ /Loc/
! 	      @cutoff[loc] = cutoff[i].to_f
! 	    }
! 	  when /-----$/
! 	  when /^ +$/, ''
! 	  else
! 	    values = line.sub(/^\s*/,'').split(/\s+/)
! 	    values.each_with_index {|val, i|
! 	      label = labels[i]
! 	      case label
! 	      when 'RC', /Len/ 
! 		val = val.to_i
! 	      when 'SP','mTP','cTP','other'
! 		val = val.to_f
! 	      end
! 	      @prediction[label] = val
! 	    }
! 	  end
! 	}
        end
  
--- 74,120 ----
  
        def parse_entry(str)
!         labels = []
!         cutoff = []
!         values = []
  
!         str.split("\n").each {|line|
!           case line
!           when /targetp v(\d+.\d+)/,/T A R G E T P\s+(\d+.\d+)/
!             @version = $1
  
!           when /Number of (query|input) sequences:\s+(\d+)/
!             @query_sequences = $1.to_i
  
!           when /Cleavage site predictions (\w.+)\./ 
!             @cleavage_site_prediction = $1
  
!           when /Using (\w+.+) networks/
!             @networks = $1
!           when /Name +Len/
!             labels = line.sub(/^\#\s*/,'').split(/\s+/)
  
!           when /cutoff/
!             cutoff = line.split(/\s+/)
!             cutoff.shift
!             labels[2, 4].each_with_index {|loc, i|
!               next if loc =~ /Loc/
!               @cutoff[loc] = cutoff[i].to_f
!             }
!           when /-----$/
!           when /^ +$/, ''
!           else
!             values = line.sub(/^\s*/,'').split(/\s+/)
!             values.each_with_index {|val, i|
!               label = labels[i]
!               case label
!               when 'RC', /Len/ 
!                 val = val.to_i
!               when 'SP','mTP','cTP','other'
!                 val = val.to_f
!               end
!               @prediction[label] = val
!             }
!           end
!         }
        end
  



More information about the bioruby-cvs mailing list