def rename_atoms_structure(self, pdbfile, gmx_path, forcefield):
        """
        Create a subprocess to rename the atoms of the PDB input file using pdb2gmx
        @type self: koala.RenameAtoms.RenameAtoms
        @type pdbfile: file
        @type gmx_path: string
        @type forcefield: string
        """
        delete_check_files(self.path_runs.get_path_execution())

        program = os.path.join(gmx_path, "pdb2gmx")
        process = Popen(
            [program, "-f", pdbfile, "-o", pdbfile, "-p", "check.top", "-water", "none", "-ff", forcefield],
            stdout=PIPE,
            stderr=PIPE,
        )
        stdout, stderr = process.communicate()
        process.wait()

        delete_check_files(self.path_runs.get_path_execution())
示例#2
0
    def check_structue_by_pdb2gmx(self, pdbfile, gmx_path, forcefield):
        """
        Create a subprocess to verify all the PDB input files
        @type self: koala.CheckPDBStructure.CheckPDBStructure
        @type pdbfile: file
        @type gmx_path: string
        @type forcefield: string
        """
        try:
            delete_check_files(self.path_runs.get_path_execution())

            program = os.path.join(gmx_path, "pdb2gmx")

            process = Popen([
                    program,
                    '-f',
                    pdbfile,
                    '-o',
                    'check.gro',
                    '-p',
                    'check.top',
                    '-water',
                    'none',
                    '-ff',
                    forcefield,
                    '-ignh'], stdout=PIPE, stderr=PIPE)

            stdout, stderr = process.communicate()
            process.wait()

            # Checking output of pdb2gmx of pdbfile
            if stderr.find('Fatal error') >= 0:
                self.log_by_pdb2gmx(pdbfile, stderr)
                self.move_structures(pdbfile)

            delete_check_files(self.path_runs.get_path_execution())

        except Exception, e:
            show_error_message(str(e))