frag_pele/serie_handler.py
def check_instructions(instructions, complex_pdb, c_chain = "L", f_chain="L"):
    """
    It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated
    PDB-atom-names in the PDB file.
    :param list_of_instructions: list with the instructions read from the instructions file. list
    :param complex: PDB file with the complex that contains the core
    :return: if something is wrong it raises an exception.
    """
    fragments_and_atoms = get_pdb_fragments_and_atoms_from_instructions([instructions])
    for fragment, atom_core, atom_fr in fragments_and_atoms:
        atoms_if_bond = extract_hydrogens_from_instructions([fragment, atom_core, atom_fr])
        if atoms_if_bond:
            ch.check_if_atom_exists_in_ligand(complex_pdb, atoms_if_bond[0], c_chain)
            ch.check_if_atom_exists_in_ligand(complex_pdb, atoms_if_bond[1], c_chain)
            ch.check_if_atom_exists_in_ligand(fragment, atoms_if_bond[2], f_chain)
            ch.check_if_atom_exists_in_ligand(fragment, atoms_if_bond[3], f_chain)
        else:
            ch.check_if_atom_exists_in_ligand(fragment, atom_fr, f_chain)
            ch.check_if_atom_exists_in_ligand(complex_pdb, atom_core, c_chain)
        with open(fragment) as content:
            fr_content = content.readlines()
        ch.check_duplicated_pdbatomnames(fr_content)

    It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated
    PDB-atom-names in the PDB file.
    :param list_of_instructions: list with the instructions read from the instructions file. list
    :param complex: PDB file with the complex that contains the core
    :return: if something is wrong it raises an exception.
    
It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated
PDB-atom-names in the PDB file.
It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated PDB - atom - names in the PDB file .
def check_instructions(instructions, complex_pdb, c_chain = "L", f_chain="L"):
    fragments_and_atoms = get_pdb_fragments_and_atoms_from_instructions([instructions])
    for fragment, atom_core, atom_fr in fragments_and_atoms:
        atoms_if_bond = extract_hydrogens_from_instructions([fragment, atom_core, atom_fr])
        if atoms_if_bond:
            ch.check_if_atom_exists_in_ligand(complex_pdb, atoms_if_bond[0], c_chain)
            ch.check_if_atom_exists_in_ligand(complex_pdb, atoms_if_bond[1], c_chain)
            ch.check_if_atom_exists_in_ligand(fragment, atoms_if_bond[2], f_chain)
            ch.check_if_atom_exists_in_ligand(fragment, atoms_if_bond[3], f_chain)
        else:
            ch.check_if_atom_exists_in_ligand(fragment, atom_fr, f_chain)
            ch.check_if_atom_exists_in_ligand(complex_pdb, atom_core, c_chain)
        with open(fragment) as content:
            fr_content = content.readlines()
        ch.check_duplicated_pdbatomnames(fr_content)
def check_instructions ( instructions , complex_pdb , c_chain = "L" , f_chain = "L" ) : fragments_and_atoms = get_pdb_fragments_and_atoms_from_instructions ( [ instructions ] ) for fragment , atom_core , atom_fr in fragments_and_atoms : atoms_if_bond = extract_hydrogens_from_instructions ( [ fragment , atom_core , atom_fr ] ) if atoms_if_bond : ch . check_if_atom_exists_in_ligand ( complex_pdb , atoms_if_bond [ 0 ] , c_chain ) ch . check_if_atom_exists_in_ligand ( complex_pdb , atoms_if_bond [ 1 ] , c_chain ) ch . check_if_atom_exists_in_ligand ( fragment , atoms_if_bond [ 2 ] , f_chain ) ch . check_if_atom_exists_in_ligand ( fragment , atoms_if_bond [ 3 ] , f_chain ) else : ch . check_if_atom_exists_in_ligand ( fragment , atom_fr , f_chain ) ch . check_if_atom_exists_in_ligand ( complex_pdb , atom_core , c_chain ) with open ( fragment ) as content : fr_content = content . readlines ( ) ch . check_duplicated_pdbatomnames ( fr_content )
It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated
PDB-atom-names in the PDB file.
It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated PDB - atom - names in the PDB file .
"""
    It checks if the selected atoms exists in their correspondent PDB file and also checks if there are repeated
    PDB-atom-names in the PDB file.
    :param list_of_instructions: list with the instructions read from the instructions file. list
    :param complex: PDB file with the complex that contains the core
    :return: if something is wrong it raises an exception.
    """
if something is wrong it raises an exception.
if something is wrong it raises an exception .
instructions
complex_pdb
c_chain
f_chain
list_of_instructions
list with the instructions read from the instructions file. list
list with the instructions read from the instructions file . list
complex
PDB file with the complex that contains the core
PDB file with the complex that contains the core