Class: ODDB::Interaction::Cytochrome

Inherits:
Object
  • Object
show all
Defined in:
src/plugin/interaction.rb,
test/test_plugin/flockhart.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Cytochrome) initialize(cyt_name)

A new instance of Cytochrome



35
36
37
38
39
40
41
# File 'src/plugin/interaction.rb', line 35

def initialize(cyt_name)
  @cyt_name = cyt_name
  @substrates = []
  @inhibitors = []
  @inducers = []
  @interactions = {}
end

Instance Attribute Details

- (Object) cyt_name (readonly)

Returns the value of attribute cyt_name



34
35
36
# File 'src/plugin/interaction.rb', line 34

def cyt_name
  @cyt_name
end

- (Object) inducers

Returns the value of attribute inducers



33
34
35
# File 'src/plugin/interaction.rb', line 33

def inducers
  @inducers
end

- (Object) inhibitors

Returns the value of attribute inhibitors



33
34
35
# File 'src/plugin/interaction.rb', line 33

def inhibitors
  @inhibitors
end

- (Object) substrates

Returns the value of attribute substrates



33
34
35
# File 'src/plugin/interaction.rb', line 33

def substrates
  @substrates
end

Instance Method Details

- (Object) add_connection(conn)



42
43
44
45
46
47
48
49
50
51
# File 'src/plugin/interaction.rb', line 42

def add_connection(conn)
  case conn
  when ODDB::Interaction::SubstrateConnection
    @substrates.push(conn)
  when ODDB::Interaction::InhibitorConnection
    @inhibitors.push(conn)
  when ODDB::Interaction::InducerConnection
    @inducers.push(conn)
  end
end

- (Boolean) has_connection?(other)

Returns:

  • (Boolean)


52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'src/plugin/interaction.rb', line 52

def has_connection?(other)
  @inhibitors.each { |inhibitor|
    if(inhibitor.name == other.description('en'))
      @interactions.store(:inhibitor, inhibitor)
    end
  }
  @inducers.each { |inducers|
    if(inducers.name == other.description('en'))
      @interactions.store(:inducers, inducers)
    end
  }
  @interactions
end