Class: Bio::SiRNA

Inherits:
Object show all
Defined in:
lib/bio/util/sirna.rb

Overview

Bio::SiRNA

Designing siRNA.

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

Defined Under Namespace

Classes: Pair, ShRNA

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(seq, antisense_size = 21, max_gc_percent = 60.0, min_gc_percent = 40.0) ⇒ SiRNA

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



65
66
67
68
69
70
71
# 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

Instance Attribute Details

#antisense_sizeObject

A parameter of size of antisense.



55
56
57
# File 'lib/bio/util/sirna.rb', line 55

def antisense_size
  @antisense_size
end

#max_gc_percentObject

A parameter of maximal %GC.



58
59
60
# File 'lib/bio/util/sirna.rb', line 58

def max_gc_percent
  @max_gc_percent
end

#min_gc_percentObject

A parameter of minimum %GC.



61
62
63
# File 'lib/bio/util/sirna.rb', line 61

def min_gc_percent
  @min_gc_percent
end

Instance Method Details

#design(rule = 'uitei') ⇒ Object

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



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# 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

#reynoldsObject

same as design('reynolds').



141
142
143
# File 'lib/bio/util/sirna.rb', line 141

def reynolds
  design('reynolds')
end

#reynolds?(target) ⇒ Boolean

Reynolds' rule.

Returns:

  • (Boolean)


96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# 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

#uiteiObject

same as design('uitei').



136
137
138
# File 'lib/bio/util/sirna.rb', line 136

def uitei
  design('uitei')
end

#uitei?(target) ⇒ Boolean

Ui-Tei's rule.

Returns:

  • (Boolean)


74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# 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