parameters: ()
docstring: Load the list of atom and residue name replacements.
docstring_summary: Load the list of atom and residue name replacements.
docstring_tokens: Load the list of atom and residue name replacements .
function: def _loadNameReplacementTables():
          """Load the list of atom and residue name replacements."""
          if len(PDBFile._residueNameReplacements) == 0:
              tree = etree.parse(os.path.join(os.path.dirname(__file__), 'data', 'pdbNames.xml'))
              allResidues = {}
              proteinResidues = {}
              nucleicAcidResidues = {}
              for residue in tree.getroot().findall('Residue'):
                  name = residue.attrib['name']
                  if name == 'All':
                      PDBFile._parseResidueAtoms(residue, allResidues)
                  elif name == 'Protein':
                      PDBFile._parseResidueAtoms(residue, proteinResidues)
                  elif name == 'Nucleic':
                      PDBFile._parseResidueAtoms(residue, nucleicAcidResidues)
              for atom in allResidues:
                  proteinResidues[atom] = allResidues[atom]
                  nucleicAcidResidues[atom] = allResidues[atom]
              for residue in tree.getroot().findall('Residue'):
                  name = residue.attrib['name']
                  for id in residue.attrib:
                      if id == 'name' or id.startswith('alt'):
                          PDBFile._residueNameReplacements[residue.attrib[id]] = name
                  if 'type' not in residue.attrib:
                      atoms = copy(allResidues)
                  elif residue.attrib['type'] == 'Protein':
                      atoms = copy(proteinResidues)
                  elif residue.attrib['type'] == 'Nucleic':
                      atoms = copy(nucleicAcidResidues)
                  else:
                      atoms = copy(allResidues)
                  PDBFile._parseResidueAtoms(residue, atoms)
                  PDBFile._atomNameReplacements[name] = atoms
function_tokens: def _loadNameReplacementTables ( ) : if len ( PDBFile . _residueNameReplacements ) == 0 : tree = etree . parse ( os . path . join ( os . path . dirname ( __file__ ) , 'data' , 'pdbNames.xml' ) ) allResidues = { } proteinResidues = { } nucleicAcidResidues = { } for residue in tree . getroot ( ) . findall ( 'Residue' ) : name = residue . attrib [ 'name' ] if name == 'All' : PDBFile . _parseResidueAtoms ( residue , allResidues ) elif name == 'Protein' : PDBFile . _parseResidueAtoms ( residue , proteinResidues ) elif name == 'Nucleic' : PDBFile . _parseResidueAtoms ( residue , nucleicAcidResidues ) for atom in allResidues : proteinResidues [ atom ] = allResidues [ atom ] nucleicAcidResidues [ atom ] = allResidues [ atom ] for residue in tree . getroot ( ) . findall ( 'Residue' ) : name = residue . attrib [ 'name' ] for id in residue . attrib : if id == 'name' or id . startswith ( 'alt' ) : PDBFile . _residueNameReplacements [ residue . attrib [ id ] ] = name if 'type' not in residue . attrib : atoms = copy ( allResidues ) elif residue . attrib [ 'type' ] == 'Protein' : atoms = copy ( proteinResidues ) elif residue . attrib [ 'type' ] == 'Nucleic' : atoms = copy ( nucleicAcidResidues ) else : atoms = copy ( allResidues ) PDBFile . _parseResidueAtoms ( residue , atoms ) PDBFile . _atomNameReplacements [ name ] = atoms