Class: Bio::AssemblyGraphAlgorithms::Dijkstra::DistancedOrientedNode

Inherits:
Object
  • Object
show all
Defined in:
lib/assembly/dijkstra.rb

Overview

An oriented node some distance from the origin of exploration

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#distanceObject

Returns the value of attribute distance.



189
190
191
# File 'lib/assembly/dijkstra.rb', line 189

def distance
  @distance
end

#first_sideObject

Returns the value of attribute first_side.



189
190
191
# File 'lib/assembly/dijkstra.rb', line 189

def first_side
  @first_side
end

#nodeObject

Returns the value of attribute node.



189
190
191
# File 'lib/assembly/dijkstra.rb', line 189

def node
  @node
end

Instance Method Details

#inspectObject Also known as: to_s



211
212
213
# File 'lib/assembly/dijkstra.rb', line 211

def inspect
  "DistancedOrientedNode #{object_id}: node=#{@node.node_id} first=#{@first_side} distance=#{@distance}"
end

#next_neighbours(graph) ⇒ Object



204
205
206
207
208
209
# File 'lib/assembly/dijkstra.rb', line 204

def next_neighbours(graph)
  onode = Bio::Velvet::Graph::OrientedNodeTrail::OrientedNode.new
  onode.node = @node
  onode.first_side = @first_side
  return onode.next_neighbours(graph)
end

#second_sideObject

Which side of the node is not first?



198
199
200
201
202
# File 'lib/assembly/dijkstra.rb', line 198

def second_side
  @first_side == Bio::Velvet::Graph::OrientedNodeTrail::START_IS_FIRST ?
  Bio::Velvet::Graph::OrientedNodeTrail::END_IS_FIRST :
    Bio::Velvet::Graph::OrientedNodeTrail::START_IS_FIRST
end

#to_settableObject

Using Set object, often we want two separate objects to be considered equal even if they are distinct objects



193
194
195
# File 'lib/assembly/dijkstra.rb', line 193

def to_settable
  [@node.node_id, @first_side]
end