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

#initialize(sequence_name, strand, motif, start_pos, end_pos, pvalue) ⇒ Motif

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

#end_posObject

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

#motifObject

Returns the value of attribute motif



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

def motif
  @motif
end

#pvalueObject

Returns the value of attribute pvalue



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

def pvalue
  @pvalue
end

#sequence_nameObject

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

#start_posObject

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

#strandObject

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

#lengthObject

Computes the motif length



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

def length
  @end_pos - @start_pos
end