frag_pele/Helpers/checker.py
def check_duplicated_pdbatomnames(pdb_content):
    """
    It checks if the content of a PDB file contains repeated PDB atom names.
    :param pdb_content: string with the content of a PDB file.
    :return: if repeated atom names: exit and complain.
    """
    pdb_atom_names_list = []
    for line in pdb_content:
        if line.startswith("HETATM") and line[17:30] != "HOH" and line[21:22] == "L":
            pdb_atom_name = line[12:17]
            pdb_atom_names_list.append(pdb_atom_name)
    set_to_check = set(pdb_atom_names_list)
    list_to_check = sorted(list(set_to_check))
    sorted_list_names = sorted(pdb_atom_names_list)
    if list_to_check != sorted_list_names:
        print(list_to_check)
        print(sorted_list_names)
        raise ValueError("SOME REPEATED PDB ATOM NAMES of the ligand IN PDB FILES!!")

    It checks if the content of a PDB file contains repeated PDB atom names.
    :param pdb_content: string with the content of a PDB file.
    :return: if repeated atom names: exit and complain.
    
It checks if the content of a PDB file contains repeated PDB atom names.
It checks if the content of a PDB file contains repeated PDB atom names .
def check_duplicated_pdbatomnames(pdb_content):
    pdb_atom_names_list = []
    for line in pdb_content:
        if line.startswith("HETATM") and line[17:30] != "HOH" and line[21:22] == "L":
            pdb_atom_name = line[12:17]
            pdb_atom_names_list.append(pdb_atom_name)
    set_to_check = set(pdb_atom_names_list)
    list_to_check = sorted(list(set_to_check))
    sorted_list_names = sorted(pdb_atom_names_list)
    if list_to_check != sorted_list_names:
        print(list_to_check)
        print(sorted_list_names)
        raise ValueError("SOME REPEATED PDB ATOM NAMES of the ligand IN PDB FILES!!")
def check_duplicated_pdbatomnames ( pdb_content ) : pdb_atom_names_list = [ ] for line in pdb_content : if line . startswith ( "HETATM" ) and line [ 17 : 30 ] != "HOH" and line [ 21 : 22 ] == "L" : pdb_atom_name = line [ 12 : 17 ] pdb_atom_names_list . append ( pdb_atom_name ) set_to_check = set ( pdb_atom_names_list ) list_to_check = sorted ( list ( set_to_check ) ) sorted_list_names = sorted ( pdb_atom_names_list ) if list_to_check != sorted_list_names : print ( list_to_check ) print ( sorted_list_names ) raise ValueError ( "SOME REPEATED PDB ATOM NAMES of the ligand IN PDB FILES!!" )
It checks if the content of a PDB file contains repeated PDB atom names.
It checks if the content of a PDB file contains repeated PDB atom names .
"""
    It checks if the content of a PDB file contains repeated PDB atom names.
    :param pdb_content: string with the content of a PDB file.
    :return: if repeated atom names: exit and complain.
    """
if repeated atom names: exit and complain.
if repeated atom names : exit and complain .
pdb_content
string with the content of a PDB file.
string with the content of a PDB file .