[BioRuby-cvs] bioruby/lib/bio/util sirna.rb,1.4,1.5

Mitsuteru C. Nakao nakao at pub.open-bio.org
Mon Nov 14 09:48:01 EST 2005


Update of /home/repository/bioruby/bioruby/lib/bio/util
In directory pub.open-bio.org:/tmp/cvs-serv27618/lib/bio/util

Modified Files:
	sirna.rb 
Log Message:
* Changed to RDoc format.


Index: sirna.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/util/sirna.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sirna.rb	8 Sep 2005 01:22:12 -0000	1.4
--- sirna.rb	14 Nov 2005 14:47:59 -0000	1.5
***************
*** 1,6 ****
  #
! # bio/util/sirna.rb - Class for designing small inhibitory RNAs
  #
! #   Copyright (C) 2004, 2005  Itoshi NIKAIDO <dritoshi at gmail.com>
  #
  #  This library is free software; you can redistribute it and/or
--- 1,54 ----
  #
! # = bio/util/sirna.rb - Class for designing small inhibitory RNAs
  #
! # Copyright::    Copyright (C) 2004, 2005
! #        Itoshi NIKAIDO <dritoshi at gmail.com>
! # License::    LGPL
! #
! # $Id$
! #
! # = Bio::SiRNA - Designing siRNA.
! #
! # This class implements the selection rules described by Kumiko Ui-Tei
! # et al. (2004) and Reynolds et al. (2004).
! #
! # = Example
! #
! #  seq = Bio::Sequence::NA.new(ARGF.read)
! #  
! #  sirna = Bio::SiRNA.new(seq)
! #  pairs = sirna.design
! #  
! #  pairs.each do |pair|
! #    puts pair.report
! #    shrna = Bio::SiRNA::ShRNA.new(pair)
! #    shrna.design
! #    puts shrna.report
! #    
! #    puts shrna.top_strand.dna
! #    puts shrna.bottom_strand.dna
! #  end
! #
! # = References
! # 
! # * Kumiko Ui-Tei et al.  Guidelines for the selection of highly effective
! #   siRNA sequences for mammalian and chick RNA interference.
! #   Nucl. Acids. Res. 2004 32: 936-948.
! #    
! # * Angela Reynolds et al.  Rational siRNA design for RNA interference.
! #   Nature Biotech. 2004 22: 326-330.
! #
! # = ChangeLog
! #
! #   2005/03/21 Itoshi NIKAIDO <itoshi.nikaido at nifty.com>
! #   Bio::SiRNA#ShRNA_designer method was changed design method.
! #
! #   2004/06/25
! #   Bio::ShRNA class was added.
! #
! #   2004/06/17 Itoshi NIKAIDO <itoshi.nikaido at nifty.com>
! #   We can use shRNA loop sequence from piGene document.
! #
! # #--
  #
  #  This library is free software; you can redistribute it and/or
***************
*** 18,22 ****
  #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! # $Id$
  #
  
--- 66,70 ----
  #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  #
! #++
  #
  
***************
*** 25,30 ****
--- 73,91 ----
  module Bio
  
+   # = Bio::SiRNA
+   # Designing siRNA.
    class SiRNA
  
+     # A parameter of size of antisense.
+     attr_accessor :antisense_size
+ 
+     # A parameter of maximal %GC.
+     attr_accessor :max_gc_percent
+ 
+     # A parameter of minimum %GC.
+     attr_accessor :min_gc_percent
+ 
+     # Input is a Bio::Sequence::NA object (the target sequence).
+     # Output is a list of Bio::SiRNA::Pair object.
      def initialize(seq, antisense_size = 21, max_gc_percent = 60.0, min_gc_percent = 40.0)
        @seq = seq.rna!
***************
*** 34,39 ****
        @min_gc_percent = min_gc_percent
      end
-     attr_accessor :antisense_size, :max_gc_percent, :min_gc_percent
  
      def uitei?(target)
        return false unless /^.{2}[GC]/i =~ target
--- 95,100 ----
        @min_gc_percent = min_gc_percent
      end
  
+     # Ui-Tei's rule.
      def uitei?(target)
        return false unless /^.{2}[GC]/i =~ target
***************
*** 50,53 ****
--- 111,115 ----
      end
  
+     # Reynolds' rule.
      def reynolds?(target)
        return false if /[GC]{9}/i =~ target
***************
*** 56,67 ****
--- 118,132 ----
      end
  
+     # same as design('uitei').
      def uitei
        design('uitei')
      end
  
+     # same as design('reynolds').
      def reynolds
        design('reynolds')
      end
  
+     #  rule can be one of 'uitei' (default) and 'reynolds'.
      def design(rule = 'uitei')
        @target_size = @antisense_size + 2
***************
*** 81,87 ****
          case rule
          when 'uitei'
!   	  next unless uitei?(target)
          when 'reynolds'
!     	  next unless reynolds?(target)
          else
            raise NotImplementedError
--- 146,152 ----
          case rule
          when 'uitei'
!           next unless uitei?(target)
          when 'reynolds'
!           next unless reynolds?(target)
          else
            raise NotImplementedError
***************
*** 94,100 ****
      end
  
! 
      class Pair
  
        def initialize(target, sense, antisense, start, stop, rule, gc_percent)
          @target     = target
--- 159,179 ----
      end
  
!     # == Bio::SiRNA::Pair
      class Pair
  
+       attr_accessor :target
+ 
+       attr_accessor :sense
+ 
+       attr_accessor :antisense
+ 
+       attr_accessor :start
+ 
+       attr_accessor :stop
+ 
+       attr_accessor :rule
+ 
+       attr_accessor :gc_percent
+ 
        def initialize(target, sense, antisense, start, stop, rule, gc_percent)
          @target     = target
***************
*** 106,110 ****
          @gc_percent = gc_percent
        end
-       attr_accessor :target, :sense, :antisense, :start, :stop, :rule, :gc_percent
  
        # human readable report
--- 185,188 ----
***************
*** 125,138 ****
        #end
  
!     end #class Pair
  
!     
      class ShRNA
      
        def initialize(pair)
          @pair = pair
        end
-       attr_accessor :top_strand, :bottom_strand
  
        def design(method = 'BLOCK-iT')
          case method
--- 203,224 ----
        #end
  
!     end # class Pair
  
!     # == Bio::SiRNA::ShRNA
!     # Input is a Bio::SiRNA::Pair object (the target sequence).
      class ShRNA
+ 
+       # aBio::Sequence::NA
+       attr_accessor :top_strand
+ 
+       # aBio::Sequence::NA
+       attr_accessor :bottom_strand
      
        def initialize(pair)
          @pair = pair
        end
  
+ 
+       # only the 'BLOCK-iT' rule is implemented for now.
        def design(method = 'BLOCK-iT')
          case method
***************
*** 144,150 ****
        end
  
        def block_it(method = 'piGENE')
!         top = Bio::Sequence::NA.new('CACC')	# top_strand_shrna_overhang
!         bot = Bio::Sequence::NA.new('AAAA')	# bottom_strand_shrna_overhang
          fwd = @pair.sense
          rev = @pair.sense.complement
--- 230,239 ----
        end
  
+ 
+       # same as design('BLOCK-iT').
+       # method can be one of 'piGENE' (default) and 'BLOCK-iT'.
        def block_it(method = 'piGENE')
!         top = Bio::Sequence::NA.new('CACC') # top_strand_shrna_overhang
!         bot = Bio::Sequence::NA.new('AAAA') # bottom_strand_shrna_overhang
          fwd = @pair.sense
          rev = @pair.sense.complement
***************
*** 164,175 ****
  
          if /^G/i =~ fwd
!   	  @top_strand    = top + fwd + loop_fwd + rev
            @bottom_strand = bot + fwd + loop_rev + rev
          else
!   	  @top_strand    = top + 'G' + fwd + loop_fwd + rev
            @bottom_strand = bot + fwd + loop_rev + rev + 'C'
          end
        end
        
        def report
          report = "### shRNA\n"
--- 253,265 ----
  
          if /^G/i =~ fwd
!           @top_strand    = top + fwd + loop_fwd + rev
            @bottom_strand = bot + fwd + loop_rev + rev
          else
!           @top_strand    = top + 'G' + fwd + loop_fwd + rev
            @bottom_strand = bot + fwd + loop_rev + rev + 'C'
          end
        end
        
+       # human readable report
        def report
          report = "### shRNA\n"
***************
*** 180,188 ****
        end
  
!     end #class ShRNA
  
!   end #class SiRNA
  
! end #module bio
  
  
--- 270,278 ----
        end
  
!     end # class ShRNA
  
!   end # class SiRNA
  
! end # module Bio
  
  
***************
*** 192,196 ****
  
    sirna = Bio::SiRNA.new(seq)
!   pairs = sirna.design		# or .design('uitei') or .uitei or .reynolds
  
    pairs.each do |pair|
--- 282,286 ----
  
    sirna = Bio::SiRNA.new(seq)
!   pairs = sirna.design # or .design('uitei') or .uitei or .reynolds
  
    pairs.each do |pair|
***************
*** 198,202 ****
  
      shrna = Bio::SiRNA::ShRNA.new(pair)
!     shrna.design		# or .design('BLOCK-iT') or .block_it
      puts shrna.report
  
--- 288,292 ----
  
      shrna = Bio::SiRNA::ShRNA.new(pair)
!     shrna.design # or .design('BLOCK-iT') or .block_it
      puts shrna.report
  
***************
*** 208,290 ****
  end  
  
- =begin
- 
- = Bio::SiRNA
- 
-     Designing siRNA.
-     
-     Input is a Bio::Sequence::NA object (the target sequence).
-     Output is a list of Bio::SiRNA::Pair object.
-     
-     This class implements the selection rules described by Kumiko Ui-Tei
-     et al. (2004) and Reynolds et al. (2004)
- 
-     Kumiko Ui-Tei et al.  Guidelines for the selection of highly effective
-     siRNA sequences for mammalian and chick RNA interference.
-     Nucl. Acids. Res. 2004 32: 936-948.
-     
-     Angela Reynolds et al.  Rational siRNA design for RNA interference.
-     Nature Biotech. 2004 22: 326-330.
- 
- --- Bio::SiRNA.new(seq, antisense_size, max_gc_percent, min_gc_percent)
- 
- --- Bio::SiRNA#design(rule)
- 
-   rule can be one of 'uitei' (default) and 'reynolds'.
- 
- --- Bio::SiRNA#uitei
- 
-   same as design('uitei')
- 
- --- Bio::SiRNA#reynolds
- 
-   same as design('reynolds')
- 
- --- Bio::SiRNA#antisense_size
- --- Bio::SiRNA#max_gc_percent
- --- Bio::SiRNA#min_gc_percent
- 
- == Bio::SiRNA::Pair
- 
- --- Bio::SiRNA::Pair.new(target, sense, antisense, target_start, target_stop, rule, antisense_gc_percent)
- 
- --- Bio::SiRNA::Pair#target
- --- Bio::SiRNA::Pair#sense
- --- Bio::SiRNA::Pair#antisense
- --- Bio::SiRNA::Pair#start
- --- Bio::SiRNA::Pair#stop
- --- Bio::SiRNA::Pair#rule
- --- Bio::SiRNA::Pair#report
- 
- == Bio::SiRNA::ShRNA
- 
-     Input is a Bio::SiRNA::Pair object (the target sequence).
- 
- --- Bio::ShRNA.new(pair)
- 
- --- Bio::ShRNA#design(rule)
- 
-   only the 'BLOCK-iT' rule is implemented for now
- 
- --- Bio::ShRNA#block_it(method)
- 
-   same as design('BLOCK-iT').
-   method can be one of 'piGENE' (default) and 'BLOCK-iT'.
- 
- --- Bio::ShRNA#top_strand
- --- Bio::ShRNA#bottom_strand
- --- Bio::ShRNA#report
- 
- 
- === ChangeLog
- 
-   2005/03/21 Itoshi NIKAIDO <itoshi.nikaido at nifty.com>
-   Bio::SiRNA#ShRNA_designer method was changed design method.
- 
-   2004/06/25
-   Bio::ShRNA class was added.
- 
-   2004/06/17 Itoshi NIKAIDO <itoshi.nikaido at nifty.com>
-   We can use shRNA loop sequence from piGene document.
- 
- =end
--- 298,299 ----



More information about the bioruby-cvs mailing list