Class: Bio::AssemblyGraphAlgorithms::HeightFinder::CyclicTraversalNode
- Inherits:
-
TraversalNode
- Object
- TraversalNode
- Bio::AssemblyGraphAlgorithms::HeightFinder::CyclicTraversalNode
- Defined in:
- lib/assembly/height_finder.rb
Defined Under Namespace
Classes: CyclePath
Instance Attribute Summary collapse
-
#cycles ⇒ Object
Returns the value of attribute cycles.
Attributes inherited from TraversalNode
#height, #nodes_in, #nodes_out, #onode
Instance Method Summary collapse
Methods inherited from TraversalNode
Instance Attribute Details
#cycles ⇒ Object
Returns the value of attribute cycles.
175 176 177 |
# File 'lib/assembly/height_finder.rb', line 175 def cycles @cycles end |
Instance Method Details
#initiate_cycle(onode) ⇒ Object
177 178 179 180 181 |
# File 'lib/assembly/height_finder.rb', line 177 def initiate_cycle(onode) cycle = CyclePath.new cycle.onodes = [onode] merge_unclosed_cycle cycle end |
#merge_unclosed_cycle(cycle) ⇒ Object
183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
# File 'lib/assembly/height_finder.rb', line 183 def merge_unclosed_cycle(cycle) return if cycle.closed? if cycle.onodes.last == @onode cycle.closed = true else cycle.onodes.unshift @onode end if @cycles.nil? @cycles = [cycle] else @cycles.push(cycle) end return cycle end |