frag_pele/Covalent/pdb_corrector.py
def write_file(self, output_file, extract_ligand=True):
        """
        It writes the content into an output PDB file.

        Parameters
        ----------
        output_file : str
            path of the output PDB file
        extract_ligand : bool
            if true it extracts the ligand in a separated PDB file
        """
        with open(output_file, "w") as out_pdb:
            out_pdb.write(self._pdb.content)
            print("PDB saved in {}.".format(output_file))
        if extract_ligand:
            lig_lines = self._pdb.get_atoms_of_resname(f"{self._ligand_resname}")
            ligand_block = "".join(lig_lines)
            out_path = os.path.dirname(output_file)
            with open(os.path.join(out_path, f"{self._ligand_resname}.pdb"), "w") as out_lig:
                out_lig.write(ligand_block)
                print("Ligand PDB saved in {}.".format(os.path.join(out_path, 
                                                       f"{self._ligand_resname}.pdb")))

        It writes the content into an output PDB file.

        Parameters
        ----------
        output_file : str
            path of the output PDB file
        extract_ligand : bool
            if true it extracts the ligand in a separated PDB file
        
It writes the content into an output PDB file.
Parameters

output_file : str
path of the output PDB file
extract_ligand : bool
if true it extracts the ligand in a separated PDB file
It writes the content into an output PDB file . Parameters output_file : str path of the output PDB file extract_ligand : bool if true it extracts the ligand in a separated PDB file
def write_file(self, output_file, extract_ligand=True):
        with open(output_file, "w") as out_pdb:
            out_pdb.write(self._pdb.content)
            print("PDB saved in {}.".format(output_file))
        if extract_ligand:
            lig_lines = self._pdb.get_atoms_of_resname(f"{self._ligand_resname}")
            ligand_block = "".join(lig_lines)
            out_path = os.path.dirname(output_file)
            with open(os.path.join(out_path, f"{self._ligand_resname}.pdb"), "w") as out_lig:
                out_lig.write(ligand_block)
                print("Ligand PDB saved in {}.".format(os.path.join(out_path, 
                                                       f"{self._ligand_resname}.pdb")))
def write_file ( self , output_file , extract_ligand = True ) : with open ( output_file , "w" ) as out_pdb : out_pdb . write ( self . _pdb . content ) print ( "PDB saved in {}." . format ( output_file ) ) if extract_ligand : lig_lines = self . _pdb . get_atoms_of_resname ( f"{self._ligand_resname}" ) ligand_block = "" . join ( lig_lines ) out_path = os . path . dirname ( output_file ) with open ( os . path . join ( out_path , f"{self._ligand_resname}.pdb" ) , "w" ) as out_lig : out_lig . write ( ligand_block ) print ( "Ligand PDB saved in {}." . format ( os . path . join ( out_path , f"{self._ligand_resname}.pdb" ) ) )
It writes the content into an output PDB file.
It writes the content into an output PDB file .
"""
        It writes the content into an output PDB file.

        Parameters
        ----------
        output_file : str
            path of the output PDB file
        extract_ligand : bool
            if true it extracts the ligand in a separated PDB file
        """
self
output_file
extract_ligand