frag_pele/Covalent/pdb_corrector.py
def correct(self, reindexing=True):
        """
        It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the
        residue position of the PDB file. This makes it compatible with PELE.

        Parameters
        ----------
        reindexing : bool
            if it is true, it will reindex the atom IDs of the joining result
        """
        global residue_idx
        new_pdb_lines = []
        self._correct_ligand_to_be_residue()
        residue_corrected = self._join_ligand_and_residue(reindexing)
        index_filled = False
        for n, line in enumerate(self._pdb.lines):
            if line.startswith('ATOM') and \
                    line[21:22] == self._residue_chain and \
                    int(line[22:26].strip()) == self._residue_number:
                if not index_filled:
                    residue_idx = n
                    index_filled = True
                continue
            if line.startswith('HETATM') and \
                    line[21:22] == self._ligand_chain and \
                    line[17:20].strip() == self._ligand_resname:
                continue
            new_pdb_lines.append(line)
        new_pdb_lines[residue_idx:residue_idx] = residue_corrected  # Insert the residue in the correct index
        self._pdb.lines = new_pdb_lines
        self._pdb.content = ''.join(new_pdb_lines)

        It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the
        residue position of the PDB file. This makes it compatible with PELE.

        Parameters
        ----------
        reindexing : bool
            if it is true, it will reindex the atom IDs of the joining result
        
It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the
residue position of the PDB file. This makes it compatible with PELE.

Parameters

reindexing : bool
if it is true, it will reindex the atom IDs of the joining result
It joins the ligand and the amino - acid of a covalent ligand into a single residue and both are moved to the residue position of the PDB file . This makes it compatible with PELE . Parameters reindexing : bool if it is true it will reindex the atom IDs of the joining result
def correct(self, reindexing=True):
        global residue_idx
        new_pdb_lines = []
        self._correct_ligand_to_be_residue()
        residue_corrected = self._join_ligand_and_residue(reindexing)
        index_filled = False
        for n, line in enumerate(self._pdb.lines):
            if line.startswith('ATOM') and \
                    line[21:22] == self._residue_chain and \
                    int(line[22:26].strip()) == self._residue_number:
                if not index_filled:
                    residue_idx = n
                    index_filled = True
                continue
            if line.startswith('HETATM') and \
                    line[21:22] == self._ligand_chain and \
                    line[17:20].strip() == self._ligand_resname:
                continue
            new_pdb_lines.append(line)
        new_pdb_lines[residue_idx:residue_idx] = residue_corrected  
        self._pdb.lines = new_pdb_lines
        self._pdb.content = ''.join(new_pdb_lines)
def correct ( self , reindexing = True ) : global residue_idx new_pdb_lines = [ ] self . _correct_ligand_to_be_residue ( ) residue_corrected = self . _join_ligand_and_residue ( reindexing ) index_filled = False for n , line in enumerate ( self . _pdb . lines ) : if line . startswith ( 'ATOM' ) and line [ 21 : 22 ] == self . _residue_chain and int ( line [ 22 : 26 ] . strip ( ) ) == self . _residue_number : if not index_filled : residue_idx = n index_filled = True continue if line . startswith ( 'HETATM' ) and line [ 21 : 22 ] == self . _ligand_chain and line [ 17 : 20 ] . strip ( ) == self . _ligand_resname : continue new_pdb_lines . append ( line ) new_pdb_lines [ residue_idx : residue_idx ] = residue_corrected self . _pdb . lines = new_pdb_lines self . _pdb . content = '' . join ( new_pdb_lines )
It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the
residue position of the PDB file.
It joins the ligand and the amino - acid of a covalent ligand into a single residue and both are moved to the residue position of the PDB file .
"""
        It joins the ligand and the amino-acid of a covalent ligand into a single residue, and both are moved to the
        residue position of the PDB file. This makes it compatible with PELE.

        Parameters
        ----------
        reindexing : bool
            if it is true, it will reindex the atom IDs of the joining result
        """ # Insert the residue in the correct index
self
reindexing