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.
639 640 641 642 643 644 645 |
# File 'lib/assembly/all_orfs.rb', line 639 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
647 648 649 |
# File 'lib/assembly/all_orfs.rb', line 647 def pop @stack.pop end |
#push_next_neighbours(current_path) ⇒ Object
655 656 657 658 659 660 661 662 663 664 665 |
# File 'lib/assembly/all_orfs.rb', line 655 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
651 652 653 |
# File 'lib/assembly/all_orfs.rb', line 651 def size @stack.size end |