Class: Bio::Meme::Motif

Inherits:
Object show all
Defined in:
lib/bio/appl/meme/motif.rb

Overview

Description

This class minimally represents a sequence motif according to the MEME program

TODO: integrate with Bio::Sequence class TODO: parse PSSM data

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Motif) initialize(sequence_name, strand, motif, start_pos, end_pos, pvalue)

Creates a new Bio::Meme::Motif object arguments are



31
32
33
34
35
36
37
38
# File 'lib/bio/appl/meme/motif.rb', line 31

def initialize(sequence_name, strand, motif, start_pos, end_pos, pvalue)
  @sequence_name = sequence_name.to_s
  @strand = strand.to_s
  @motif = motif.to_i
  @start_pos = start_pos.to_i
  @end_pos = end_pos.to_i
  @pvalue = pvalue.to_f
end

Instance Attribute Details

- (Object) end_pos

Returns the value of attribute end_pos



27
28
29
# File 'lib/bio/appl/meme/motif.rb', line 27

def end_pos
  @end_pos
end

- (Object) motif

Returns the value of attribute motif



27
28
29
# File 'lib/bio/appl/meme/motif.rb', line 27

def motif
  @motif
end

- (Object) pvalue

Returns the value of attribute pvalue



27
28
29
# File 'lib/bio/appl/meme/motif.rb', line 27

def pvalue
  @pvalue
end

- (Object) sequence_name

Returns the value of attribute sequence_name



27
28
29
# File 'lib/bio/appl/meme/motif.rb', line 27

def sequence_name
  @sequence_name
end

- (Object) start_pos

Returns the value of attribute start_pos



27
28
29
# File 'lib/bio/appl/meme/motif.rb', line 27

def start_pos
  @start_pos
end

- (Object) strand

Returns the value of attribute strand



27
28
29
# File 'lib/bio/appl/meme/motif.rb', line 27

def strand
  @strand
end

Instance Method Details

- (Object) length

Computes the motif length



41
42
43
# File 'lib/bio/appl/meme/motif.rb', line 41

def length
  @end_pos - @start_pos
end