def run_SortByFront(self): """ Run the 2PG Sort algorithm to calculate the Pareto fronts and sorting @type self: koala.SortByFront.SortByFront """ self.path_runs.set_path_execute() self.path_runs.set_execution_directory() copy_necessary_files( self.path_runs.get_path_execute(), self.path_runs.get_path_execution(), self.framework.get_framework()) self.framework.set_parameter( 'objective_analisys_dimo_source', '/home/%s/programs/dimo/DIMO2' % get_logged_user()) self.framework.set_parameter('Local_Execute', self.path_runs.get_path_execution()) self.framework.set_parameter( 'Path_Gromacs_Programs', get_path_gromacs()) self.framework.set_parameter( 'NativeProtein', '%s1VII.pdb' % self.path_runs.get_path_execution()) NumberObjective, Fitness_Energy = format_fitness(self.opts.inputFitness) self.framework.set_parameter('NumberObjective', NumberObjective) self.framework.set_parameter('Fitness_Energy', Fitness_Energy) create_configuration_file( self.path_runs.get_path_execution(), self.framework) config = 'configuration.conf' if self.opts.compressedFile == '1': inputFiles = self.opts.inputPDBs.split(",") for input_f in inputFiles: if zipfile.is_zipfile(input_f): extract_zip_file(input_f, self.path_runs.get_path_execution()) else: try: inF = gzip.GzipFile(input_f, 'rb') f = inF.read() inF.close() if f: extract_gz_file(input_f, self.path_runs.get_path_execution()) except Exception, e: raise Exception("The input file could not be read.\n%s" % e)
def run_SortByFront(self): """ Run the 2PG Sort Method algorithm to calculate the Pareto fronts and sorting @type self: koala.SortByFront.SortByFront """ self.path_runs.set_path_execute() self.path_runs.set_execution_directory() copy_necessary_files( self.path_runs.get_path_execute(), self.path_runs.get_path_execution(), self.framework.get_framework()) self.framework.set_parameter( 'objective_analisys_dimo_source', '/home/%s/programs/dimo/DIMO2' % get_logged_user()) self.framework.set_parameter('Local_Execute', self.path_runs.get_path_execution()) self.framework.set_parameter( 'Path_Gromacs_Programs', get_path_gromacs()) self.framework.set_parameter( 'NativeProtein', '%s1VII.pdb' % self.path_runs.get_path_execution()) create_configuration_file( self.path_runs.get_path_execution(), self.framework) self.loadMatrixFile(self.opts.inputTxt) objFile = os.path.join(self.path_runs.get_path_execution(), 'objectivies.txt') self.framework.set_command( self.path_runs.get_path_execution(), 'protpred-Gromacs-Sort_Method_by_Front_Dominance') cl = ['nohup', self.framework.get_command(), objFile, '&'] retProcess = subprocess.Popen(cl, 0, None, None, None, False) retProcess.wait() self.getBetterPDBs(self.path_runs.get_path_execution()) result, filesHtml = get_result_files( self.path_runs.get_path_execution(), self.opts.toolname) send_output_files_html(self.opts.htmlfiledir, filesHtml) send_output_files_html(self.opts.htmlfiledir, [result]) self.makeHtml()
def build_rankingDominance(self): """ Create the 2PG Sort configuration file and build the dominance @type self: koala.DominanceRanking.DominanceRanking """ self.path_runs.set_path_execute() self.path_runs.set_execution_directory() copy_necessary_files( self.path_runs.get_path_execute(), self.path_runs.get_path_execution(), self.framework.get_framework()) self.framework.set_parameter( 'objective_analisys_dimo_source', '/home/%s/programs/dimo/DIMO2' % get_logged_user()) self.framework.set_parameter('Local_Execute', self.path_runs.get_path_execution()) self.framework.set_parameter('Path_Gromacs_Programs', get_path_gromacs()) self.framework.set_parameter( 'NativeProtein', '%s1VII.pdb' % self.path_runs.get_path_execution()) self.combinations = format_fitness(self.opts.inputFitness, self.opts.toolname) if self.opts.compressedFile == '1': inputFiles = self.opts.inputPDBs.split(",") for input_f in inputFiles: if zipfile.is_zipfile(input_f): extract_zip_file(input_f, self.path_runs.get_path_execution()) else: try: inF = gzip.GzipFile(input_f, 'rb') f = inF.read() inF.close() if f: extract_gz_file(input_f, self.path_runs.get_path_execution()) except Exception, e: raise Exception("The input file could not be read.\n%s" % e)
def get_path_algorithms(framework): try: return "/home/%s/programs/%s/" % (get_logged_user(), framework) except Exception, e: show_error_message("Error when getPathAlgorithms\n%s" % e)
def set_path_execute(self): try: self.path_execute = "/home/%s/execute/" % get_logged_user() # self.path_execute = "/dados/%s/execute/" % get_logged_user() except Exception, e: show_error_message("Error when getPathExecute\n%s" % e)
def get_path_gromacs(): pathGromacs = "/home/%s/programs/gmx-4.6.5/no_mpi/bin/" % get_logged_user() return pathGromacs