class Bio::SiRNA

Bio::SiRNA

Designing siRNA.

This class implements the selection rules described by Kumiko Ui-Tei et al. (2004) and Reynolds et al. (2004).

Attributes

antisense_size[RW]

A parameter of size of antisense.

max_gc_percent[RW]

A parameter of maximal %GC.

min_gc_percent[RW]

A parameter of minimum %GC.

Public Class Methods

new(seq, antisense_size = 21, max_gc_percent = 60.0, min_gc_percent = 40.0) click to toggle source

Input is a Bio::Sequence::NA object (the target sequence). Output is a list of Bio::SiRNA::Pair object.

# File lib/bio/util/sirna.rb, line 65
def initialize(seq, antisense_size = 21, max_gc_percent = 60.0, min_gc_percent = 40.0)
  @seq = seq.rna!
  @pairs = Array.new
  @antisense_size = antisense_size
  @max_gc_percent = max_gc_percent
  @min_gc_percent = min_gc_percent
end

Public Instance Methods

design(rule = 'uitei') click to toggle source

rule can be one of 'uitei' (default) and 'reynolds'.

# File lib/bio/util/sirna.rb, line 146
def design(rule = 'uitei')
  @target_size = @antisense_size + 2

  target_start = 0
  @seq.window_search(@target_size) do |target|
    antisense = target.subseq(1, @target_size - 2).complement.rna
    sense     = target.subseq(3, @target_size)

    target_start += 1
    target_stop  = target_start + @target_size

    antisense_gc_percent = antisense.gc_percent
    next if antisense_gc_percent > @max_gc_percent
    next if antisense_gc_percent < @min_gc_percent
    
    case rule
    when 'uitei'
      next unless uitei?(target)
    when 'reynolds'
      next unless reynolds?(target)
    else
      raise NotImplementedError
    end

    pair = Bio::SiRNA::Pair.new(target, sense, antisense, target_start, target_stop, rule, antisense_gc_percent)
    @pairs.push(pair)
  end
  return @pairs
end
reynolds() click to toggle source

same as design('reynolds').

# File lib/bio/util/sirna.rb, line 141
def reynolds
  design('reynolds')
end
reynolds?(target) click to toggle source

Reynolds' rule.

# File lib/bio/util/sirna.rb, line 96
def reynolds?(target)
  return false if target.length != 23  # 21 nt target + 2 nt overhang

  seq19 = target[2..20]  # 19 nt double-stranded region of siRNA
  score = 0

  # criteria I
  gc_number = seq19.scan(/[GC]/i).size
  score += 1 if (7 <= gc_number and gc_number <= 10)

  # criteria II
  au_number = seq19[14..18].scan(/[AU]/i).size
  score += au_number

  # criteria III
  # NotImpremented: Tm

  # criteria IV
  score += 1 if seq19[18..18].match(/A/i)

  # criteria V
  score += 1 if seq19[2..2].match(/A/i)

  # criteria VI
  score += 1 if seq19[9..9].match(/[U]/i)

  # criteria VII
  score -= 1 if seq19[18..18].match(/[GC]/i)

  # criteria VIII
  score -= 1 if seq19[12..12].match(/G/i)

  if score >= 6
    return score
  else
    return false
  end
end
uitei() click to toggle source

same as design('uitei').

# File lib/bio/util/sirna.rb, line 136
def uitei
  design('uitei')
end
uitei?(target) click to toggle source

Ui-Tei's rule.

# File lib/bio/util/sirna.rb, line 74
def uitei?(target)
  return false if target.length != 23  # 21 nt target + 2 nt overhang

  seq19 = target[2..20]  # 19 nt double-stranded region of siRNA

  # criteria i
  return false unless seq19[18..18].match(/[AU]/i)

  # criteria ii
  return false unless seq19[0..0].match(/[GC]/i)

  # criteria iii
  au_number = seq19[12..18].scan(/[AU]/i).size
  return false unless au_number >= 4

  # criteria iv
  return false if seq19.match(/[GC]{10}/i)

  return true
end