Ejemplo n.º 1
0
    def do_minimization(self, pdbPrefix=""):
        if not check_pdb(self.path_runs.get_path_execution(), self.opts.galaxyroot):
            raise Exception("The script to check the PDBs finished wrong.")

        if not prepare_pdb(self.path_runs.get_path_execution(), self.opts.galaxyroot):
            raise Exception("The script to prepare the PDBs finished wrong.")

        if not residue_renumber(self.path_runs.get_path_execution(), self.opts.galaxyroot):
            raise Exception("The script to renumber the residues finished wrong.")

        if not minimization(self.path_runs.get_path_execution(), self.opts.galaxyroot, pdbPrefix):
            raise Exception("The script of minimization finished wrong.")
        else:
                copy_pdbs_from_input(
                        self.path_runs.get_path_execution(),
                        self.opts.htmlfiledir,
                        self.opts.inputnames,
                        self.opts.inputPDBs)

        if(self.opts.renameAtoms == 'true'):
            if not rename_atoms(
                    self.path_runs.get_path_execution(),
                    self.opts.galaxyroot):
                raise Exception("The script to rename the atoms finished wrong.")

        if(self.opts.checkStructures == 'true'):
            if not check_pdb(
                    self.path_runs.get_path_execution(),
                    self.opts.galaxyroot):
                raise Exception("The script to check the structure finished wrong.")

        self.framework.set_command(
            self.path_runs.get_path_execution(),
            'protpred-Gromacs-Sort_Method_Files_by_Front_Dominance')

        cl = [self.framework.get_command(), config, '&']

        retProcess = subprocess.Popen(
            cl, 0, stdout=None,  stderr=None, shell=False)
        retCode = retProcess.wait()
        if(retCode != 0):
            show_error_message(
                "The 2PG framework finished wrong.\nContact the system administrator.")