Class: Bio::SiRNA::ShRNA

Inherits:
Object
  • 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).



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

def initialize(pair)
  @pair = pair
end

Instance Attribute Details

#bottom_strandObject

Bio::Sequence::NA



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

def bottom_strand
  @bottom_strand
end

#top_strandObject

Bio::Sequence::NA



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

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’.



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
278
# File 'lib/bio/util/sirna.rb', line 252

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.



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

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

#reportObject

human readable report

Raises:

  • (NoMethodError)


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

def report
  # raise NomethodError for compatibility
  raise NoMethodError if !defined?(@top_strand) || !@top_strand
  report = "### shRNA\n".dup
  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