Module: BELParser::Language::Function

Included in:
Version1_0::Functions::Abundance, Version1_0::Functions::BiologicalProcess, Version1_0::Functions::CatalyticActivity, Version1_0::Functions::CellSecretion, Version1_0::Functions::CellSurfaceExpression, Version1_0::Functions::ChaperoneActivity, Version1_0::Functions::ComplexAbundance, Version1_0::Functions::CompositeAbundance, Version1_0::Functions::Degradation, Version1_0::Functions::Fusion, Version1_0::Functions::GTPBoundActivity, Version1_0::Functions::GeneAbundance, Version1_0::Functions::KinaseActivity, Version1_0::Functions::List, Version1_0::Functions::MicroRNAAbundance, Version1_0::Functions::MolecularActivity, Version1_0::Functions::Pathology, Version1_0::Functions::PeptidaseActivity, Version1_0::Functions::PhosphataseActivity, Version1_0::Functions::Products, Version1_0::Functions::ProteinAbundance, Version1_0::Functions::ProteinModification, Version1_0::Functions::RNAAbundance, Version1_0::Functions::Reactants, Version1_0::Functions::Reaction, Version1_0::Functions::RibosylationActivity, Version1_0::Functions::Substitution, Version1_0::Functions::TranscriptionalActivity, Version1_0::Functions::Translocation, Version1_0::Functions::TransportActivity, Version1_0::Functions::Truncation, Version2_0::Functions::Abundance, Version2_0::Functions::Activity, Version2_0::Functions::BiologicalProcess, Version2_0::Functions::CellSecretion, Version2_0::Functions::CellSurfaceExpression, Version2_0::Functions::ComplexAbundance, Version2_0::Functions::CompositeAbundance, Version2_0::Functions::Degradation, Version2_0::Functions::Fragment, Version2_0::Functions::FromLocation, Version2_0::Functions::Fusion, Version2_0::Functions::GeneAbundance, Version2_0::Functions::List, Version2_0::Functions::Location, Version2_0::Functions::MicroRNAAbundance, Version2_0::Functions::MolecularActivity, Version2_0::Functions::Pathology, Version2_0::Functions::Products, Version2_0::Functions::ProteinAbundance, Version2_0::Functions::ProteinModification, Version2_0::Functions::RNAAbundance, Version2_0::Functions::Reactants, Version2_0::Functions::Reaction, Version2_0::Functions::ToLocation, Version2_0::Functions::Translocation, Version2_0::Functions::Variant
Defined in:
lib/bel_parser/language/function.rb

Overview

Function allows you to describe the type of BEL Term.

BEL Terms are composed of BEL Functions and entity definitions referenced using BEL Namespace identifiers. Each BEL Term represents either an abundance of a biological entity, the abundance of human AKT1 for example, or a biological process such as cardiomyopathy.

Instance Method Summary collapse

Instance Method Details

#===(other) ⇒ Object



38
39
40
41
# File 'lib/bel_parser/language/function.rb', line 38

def ===(other)
  return false if other.nil?
  short == other || long == other
end

#=~(regexp) ⇒ Object



63
64
65
# File 'lib/bel_parser/language/function.rb', line 63

def =~(regexp)
  short =~ regexp || long =~ regexp
end

#deprecated?Boolean

Indicates whether this function is deprecated. Override in your function to mark as deprecated.

Returns:

  • (Boolean)

    false



34
35
36
# File 'lib/bel_parser/language/function.rb', line 34

def deprecated?
  false
end

#descriptionObject

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/bel_parser/language/function.rb', line 22

def description
  raise NotImplementedError, "#{__method__} is not implemented."
end

#longObject

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/bel_parser/language/function.rb', line 14

def long
  raise NotImplementedError, "#{__method__} is not implemented."
end

#return_typeObject

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/bel_parser/language/function.rb', line 18

def return_type
  raise NotImplementedError, "#{__method__} is not implemented."
end

#shortObject

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/bel_parser/language/function.rb', line 10

def short
  raise NotImplementedError, "#{__method__} is not implemented."
end

#signaturesObject

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/bel_parser/language/function.rb', line 26

def signatures
  raise NotImplementedError, "#{__method__} is not implemented."
end

#to_h(hash = {}) ⇒ Object



53
54
55
56
57
58
59
60
61
# File 'lib/bel_parser/language/function.rb', line 53

def to_h(hash = {})
  hash.merge!({
    'short'       => short,
    'long'        => long,
    'return_type' => return_type.to_sym.to_s,
    'signatures'  => signatures.map { |sig| sig.string_form },
    'description' => description
  })
end

#to_s(form = :short) ⇒ Object



47
48
49
50
51
# File 'lib/bel_parser/language/function.rb', line 47

def to_s(form = :short)
  value = _form_value(form)
  return nil unless value
  value.to_s
end

#to_sym(form = :short) ⇒ Object



43
44
45
# File 'lib/bel_parser/language/function.rb', line 43

def to_sym(form = :short)
  _form_value(form)
end