class MyWorkerManagerEst

Public Class Methods

end_work_manager() click to toggle source

close files

# File lib/full_lengther_next/my_worker_manager_EST.rb, line 23
def self.end_work_manager
        #VOID
end
get_array_seqs() click to toggle source

CUSTOM FUNCTIONS

# File lib/full_lengther_next/my_worker_manager_EST.rb, line 65
def self.get_array_seqs
        return @@match, @@unmatch
end
init_work_manager(putative_seqs, options, blast_path) click to toggle source

MANAGER INITIALIZATION

open files and prepare global data

# File lib/full_lengther_next/my_worker_manager_EST.rb, line 9
def self.init_work_manager(putative_seqs, options, blast_path)
        @@blast_path = blast_path
        @@options = options
        @@putative_seqs = putative_seqs
        @@match = []
        @@unmatch = []
        @@num_seqs = 0
end

Public Instance Methods

error_received(worker_error, obj) click to toggle source
# File lib/full_lengther_next/my_worker_manager_EST.rb, line 49
def error_received(worker_error, obj)
        puts "Error while processing object #{obj.inspect}\n" + worker_error.original_exception.message + ":\n" +worker_error.original_exception.backtrace.join("\n")
end
next_work() click to toggle source

this method is called every time a worker needs new data to work. This method is executed many times like the chunk size says. Return the work data or nil if no more data is available

# File lib/full_lengther_next/my_worker_manager_EST.rb, line 33
def next_work #Manage INput's worker
        if @@num_seqs == @@putative_seqs.length-1
                return nil
        else
                seq = @@putative_seqs[@@num_seqs]
                @@num_seqs += 1
                return seq
        end
end
too_many_errors_received() click to toggle source
# File lib/full_lengther_next/my_worker_manager_EST.rb, line 53
def too_many_errors_received
        $LOG.error "Too many errors: #{@@error_count} errors on #{@@count} executed sequences, exiting before finishing"
end
work_received(match_and_unmatch_array) click to toggle source

this method is ejecuted each time an obj is finished

# File lib/full_lengther_next/my_worker_manager_EST.rb, line 44
def work_received(match_and_unmatch_array) #Manage OUTput's worker
        @@match.concat(match_and_unmatch_array.first)
        @@unmatch.concat(match_and_unmatch_array.last)
end
worker_initial_config() click to toggle source

send initial config

# File lib/full_lengther_next/my_worker_manager_EST.rb, line 58
def worker_initial_config
        return [@@options, @@blast_path]
end