Class: Bio::AssemblyGraphAlgorithms::AllOrfsFinder::AllProblemTrailsFinder
- Inherits:
-
Object
- Object
- Bio::AssemblyGraphAlgorithms::AllOrfsFinder::AllProblemTrailsFinder
- Includes:
- FinishM::Logging
- Defined in:
- lib/assembly/all_orfs.rb
Instance Method Summary collapse
-
#initialize(graph, initial_paths) ⇒ AllProblemTrailsFinder
constructor
A new instance of AllProblemTrailsFinder.
- #pop ⇒ Object
- #push_next_neighbours(current_path) ⇒ Object
- #size ⇒ Object
Methods included from FinishM::Logging
Constructor Details
#initialize(graph, initial_paths) ⇒ AllProblemTrailsFinder
Returns a new instance of AllProblemTrailsFinder.
585 586 587 588 589 590 591 |
# File 'lib/assembly/all_orfs.rb', line 585 def initialize(graph, initial_paths) @stack = DS::Stack.new initial_paths.each do |path| @stack.push path end @graph = graph end |
Instance Method Details
#pop ⇒ Object
593 594 595 |
# File 'lib/assembly/all_orfs.rb', line 593 def pop @stack.pop end |
#push_next_neighbours(current_path) ⇒ Object
601 602 603 604 605 606 607 608 609 610 611 |
# File 'lib/assembly/all_orfs.rb', line 601 def push_next_neighbours(current_path) next_nodes = current_path.neighbours_of_last_node(@graph) log.debug "Pushing #{next_nodes.length} new neighbours of #{current_path.last}" if log.debug? #TODO: not neccessary to copy all paths, can just continue one of them next_nodes.each do |n| log.debug "Pushing neighbour to stack: #{n}" if log.debug? path = current_path.copy path.add_oriented_node n @stack.push path end end |
#size ⇒ Object
597 598 599 |
# File 'lib/assembly/all_orfs.rb', line 597 def size @stack.size end |