Class: Bio::Tree::Node

Inherits:
Object show all
Defined in:
lib/bio/tree.rb

Overview

Node object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ Node

Creates a new node.



140
141
142
# File 'lib/bio/tree.rb', line 140

def initialize(name = nil)
  @name = name if name
end

Instance Attribute Details

#bootstrapObject

bootstrap value



148
149
150
# File 'lib/bio/tree.rb', line 148

def bootstrap
  @bootstrap
end

#bootstrap_stringObject

bootstrap value as a string



151
152
153
# File 'lib/bio/tree.rb', line 151

def bootstrap_string
  @bootstrap_string
end

#ec_numberObject

EC number (EC_number in PhyloXML, or :E in NHX)



207
208
209
# File 'lib/bio/tree.rb', line 207

def ec_number
  @ec_number
end

#nameObject

name of the node



145
146
147
# File 'lib/bio/tree.rb', line 145

def name
  @name
end

#order_numberObject

the order of the node (lower value, high priority)



191
192
193
# File 'lib/bio/tree.rb', line 191

def order_number
  @order_number
end

#scientific_nameObject

scientific name (scientific_name in PhyloXML, or :S in NHX)



210
211
212
# File 'lib/bio/tree.rb', line 210

def scientific_name
  @scientific_name
end

#taxonomy_idObject

taxonomy identifier (taxonomy_identifier in PhyloXML, or :T in NHX)



213
214
215
# File 'lib/bio/tree.rb', line 213

def taxonomy_id
  @taxonomy_id
end

Instance Method Details

#eventsObject

Phylogenetic events. Returns an Array of one (or more?) of the following symbols

:gene_duplication
:speciation


201
202
203
204
# File 'lib/bio/tree.rb', line 201

def events
  @events ||= []
  @events
end

#inspectObject

visualization of this object



173
174
175
176
177
178
179
180
181
182
# File 'lib/bio/tree.rb', line 173

def inspect
  if @name and !@name.empty? then
    str = "(Node:#{@name.inspect}"
  else
    str = sprintf('(Node:%x', (self.__id__ << 1) & 0xffffffff)
  end
  str += " bootstrap=#{@bootstrap.inspect}" if @bootstrap
  str += ")"
  str
end

#nhx_parametersObject

Other NHX parameters. Returns a Hash. Note that :D, :E, :S, and :T are not stored here but stored in the proper attributes in this class. However, if you force to set these parameters in this hash, the parameters in this hash are preferred when generating NHX.



220
221
222
223
# File 'lib/bio/tree.rb', line 220

def nhx_parameters
  @nhx_parameters ||= {}
  @nhx_parameters
end

#to_sObject

string representation of this object



185
186
187
# File 'lib/bio/tree.rb', line 185

def to_s
  @name.to_s
end