frag_pele/Helpers/checker.py
def check_if_atom_exists_in_ligand(pdb_file, atom_name, ligand_chain="L"):
    """
    It checks if an atom is found in a certain PDB file.
    :param pdb_file: PDB file. str
    :param atom_name: PDB atom name. str(len <= 4)
    :return: if the atom is found it prints a text and if not raise an exception.
    """
    try:
        ligand = addfr.extract_atoms_pdbs(pdb_file, create_file=False, chain=ligand_chain, get_atoms=True)
    except OSError:
        raise OSError("Check filepath {} exists".format(pdb_file))
    atom = ligand.select("name {}".format(atom_name))
    try:
        print("PDB ATOM NAME selected: {} in {}.".format(atom.getNames(), pdb_file))
    except Exception as e:
        logger.critical(e)
        sys.exit("Check if the selected atom '{}' exists in '{}'".format(atom_name, pdb_file))

    It checks if an atom is found in a certain PDB file.
    :param pdb_file: PDB file. str
    :param atom_name: PDB atom name. str(len <= 4)
    :return: if the atom is found it prints a text and if not raise an exception.
    
It checks if an atom is found in a certain PDB file.
It checks if an atom is found in a certain PDB file .
def check_if_atom_exists_in_ligand(pdb_file, atom_name, ligand_chain="L"):
    try:
        ligand = addfr.extract_atoms_pdbs(pdb_file, create_file=False, chain=ligand_chain, get_atoms=True)
    except OSError:
        raise OSError("Check filepath {} exists".format(pdb_file))
    atom = ligand.select("name {}".format(atom_name))
    try:
        print("PDB ATOM NAME selected: {} in {}.".format(atom.getNames(), pdb_file))
    except Exception as e:
        logger.critical(e)
        sys.exit("Check if the selected atom '{}' exists in '{}'".format(atom_name, pdb_file))
def check_if_atom_exists_in_ligand ( pdb_file , atom_name , ligand_chain = "L" ) : try : ligand = addfr . extract_atoms_pdbs ( pdb_file , create_file = False , chain = ligand_chain , get_atoms = True ) except OSError : raise OSError ( "Check filepath {} exists" . format ( pdb_file ) ) atom = ligand . select ( "name {}" . format ( atom_name ) ) try : print ( "PDB ATOM NAME selected: {} in {}." . format ( atom . getNames ( ) , pdb_file ) ) except Exception as e : logger . critical ( e ) sys . exit ( "Check if the selected atom '{}' exists in '{}'" . format ( atom_name , pdb_file ) )
It checks if an atom is found in a certain PDB file.
It checks if an atom is found in a certain PDB file .
"""
    It checks if an atom is found in a certain PDB file.
    :param pdb_file: PDB file. str
    :param atom_name: PDB atom name. str(len <= 4)
    :return: if the atom is found it prints a text and if not raise an exception.
    """
if the atom is found it prints a text and if not raise an exception.
if the atom is found it prints a text and if not raise an exception .
pdb_file
PDB file. str
PDB file . str
atom_name
PDB atom name.
PDB atom name .
ligand_chain