Class: Bio::SiRNA::ShRNA

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

Overview

Bio::SiRNA::ShRNA

Designing shRNA.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pair) ⇒ ShRNA

Input is a Bio::SiRNA::Pair object (the target sequence).



234
235
236
# File 'lib/bio/util/sirna.rb', line 234

def initialize(pair)
  @pair = pair
end

Instance Attribute Details

#bottom_strandObject

Bio::Sequence::NA



231
232
233
# File 'lib/bio/util/sirna.rb', line 231

def bottom_strand
  @bottom_strand
end

#top_strandObject

Bio::Sequence::NA



228
229
230
# File 'lib/bio/util/sirna.rb', line 228

def top_strand
  @top_strand
end

Instance Method Details

#block_it(method = 'piGENE') ⇒ Object

same as design(‘BLOCK-iT’). method can be one of ‘piGENE’ (default) and ‘BLOCK-iT’.



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/bio/util/sirna.rb', line 251

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

  case method
  when 'BLOCK-iT'
    # From BLOCK-iT's manual
    loop_fwd = Bio::Sequence::NA.new('CGAA')
    loop_rev = loop_fwd.complement
  when 'piGENE'
    # From piGENE document
    loop_fwd = Bio::Sequence::NA.new('GTGTGCTGTCC')
    loop_rev = loop_fwd.complement
  else
    raise NotImplementedError
  end

  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

#design(method = 'BLOCK-iT') ⇒ Object

only the ‘BLOCK-iT’ rule is implemented for now.



239
240
241
242
243
244
245
246
# File 'lib/bio/util/sirna.rb', line 239

def design(method = 'BLOCK-iT')
  case method
  when 'BLOCK-iT'
    block_it
  else
    raise NotImplementedError
  end
end

#reportObject

human readable report



280
281
282
283
284
285
286
# File 'lib/bio/util/sirna.rb', line 280

def report
  report = "### shRNA\n"
  report << "Top strand shRNA (#{@top_strand.length} nt):\n"
  report << "  5'-#{@top_strand.upcase}-3'\n"
  report << "Bottom strand shRNA (#{@bottom_strand.length} nt):\n"
  report << "      3'-#{@bottom_strand.reverse.upcase}-5'\n"
end