Class: Bioroebe::SiRNA

Inherits:
Object
  • Object
show all
Defined in:
lib/bioroebe/siRNA/siRNA.rb

Overview

Bioroebe::SiRNA

Instance Method Summary collapse

Constructor Details

#initialize(i = ARGV) ⇒ SiRNA

#

initialize

#


42
43
44
45
46
47
# File 'lib/bioroebe/siRNA/siRNA.rb', line 42

def initialize(i = ARGV)
  if i.is_a? Array
    i = i.join(' ').strip
  end
  @sequence = i
end

Instance Method Details

#reynolds?(i = @sequence, be_verbose = true) ⇒ Boolean Also known as: reynolds_rule?

#

reynolds?

This method implements the reynolds’ rule.

The Reynolds’ rule does not require to fulfill all the criteria simultaneously.

See: www.nature.com/articles/nbt936

#

Returns:

  • (Boolean)


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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/bioroebe/siRNA/siRNA.rb', line 108

def reynolds?(
    i          = @sequence,
    be_verbose = true
  )
  unless i.size == 23 # 21 nt target + 2 nt overhang
    if be_verbose
      puts 'The size should be 23; it is '+i.to_s.size.to_s+'.'
    end
    return false
  end
  score = 0
  seq19 = i[2 .. 20] # 19 nt double-stranded region of siRNA
  _complement_to_seq19 = ::Bioroebe.reverse_complement(seq19) # This is actually the reverse complement.
  # ======================================================================= #
  # === criterium 1
  # ======================================================================= #
  gc_number = seq19.scan(/[GC]/i).size
  if (7 <= gc_number and gc_number <= 10)
    score += 1
  end
  # ======================================================================= #
  # === criterium 2
  # ======================================================================= #
  au_number = seq19[14..18].scan(/[AU]/i).size
  score += au_number
  # ======================================================================= #
  # === criterium 3
  #
  # This is not yet implemented: Tm
  # ======================================================================= #
  # ======================================================================= #
  # === criterium 4
  # ======================================================================= #
  score += 1 if seq19[18..18].match(/A/i)
  # ======================================================================= #
  # === criterium 5
  # ======================================================================= #
  score += 1 if seq19[2..2].match(/A/i)
  # ======================================================================= #
  # === criterium 6
  # ======================================================================= #
  score += 1 if seq19[9..9].match(/[U]/i)
  # ======================================================================= #
  # === criterium 7
  # ======================================================================= #
  score -= 1 if seq19[18..18].match(/[GC]/i)
  # ======================================================================= #
  # === criterium V8
  # ======================================================================= #
  score -= 1 if seq19[12..12].match(/G/i)
  if score >= 6
    return score
  else
    return false
  end
end

#uitei?(i = @sequence, be_verbose = true) ⇒ Boolean Also known as: uitei_rule?

#

uitei?

#

Returns:

  • (Boolean)


52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/bioroebe/siRNA/siRNA.rb', line 52

def uitei?(
    i          = @sequence,
    be_verbose = true
  )
  unless i.size == 23 # 21 nt target + 2 nt overhang
    if be_verbose
      puts 'The size should be 23; it is '+i.to_s.size.to_s+'.'
    end
    return false
  end
  seq19 = i[2 .. 20] # 19 nt double-stranded region of siRNA
  complement_to_seq19 = ::Bioroebe.reverse_complement(seq19) # This is actually the reverse complement.
  # ======================================================================= #
  # === criterium 1
  #
  # (1) A/U at the 5' end of the antisense strand. This can be checked
  #     if we take the last nucleotide from the sense strand. Note
  #     that ineffective siRNAs are G or C here.
  # ======================================================================= #
  last_nucleotide = complement_to_seq19[0, 1]
  return false unless last_nucleotide.match(/T|A|U/i) # Match either T or A.
  # ======================================================================= #
  # === criterium 2
  #
  # (2) G/C at the 5' end of the sense strand
  # ======================================================================= #
  return false unless seq19.start_with?(/G|C/i)
  # ======================================================================= #
  # === criterium 3
  #
  # (3) at least five A/U residues in the 5' terminal one-third
  #     of the antisense strand (this means leading area, but
  #     on the antisense strand, so T and A there)
  # ======================================================================= #
  one_third = (seq19.size / 3)+1
  number_of_AU_residues = complement_to_seq19[0, one_third].scan(/A|T|U/i).size
  return false unless number_of_AU_residues > 4
  # ======================================================================= #
  # === criterium 4
  #
  # (4) the absence of any GC stretch of more than 9 nt in length
  # ======================================================================= #
  return false if seq19.match(/G{10}|C{10}/i)
  return true # This is then the new default return value here.
end