Skip to content
dstoeckel edited this page Mar 16, 2015 · 2 revisions

How can I convert atom names between different naming systems?

The class Peptides::NameConverter supports the conversion of atom names between different naming conventions.

BALL currently offers a default ini file for hydrogen naming conversion between BMRB, SC, UCSF, XPLOR, MSI, PDB, SYBYL, and MIDAS. The ini file can be changed by setting the option Peptides::NameConverter::INIFile to a different file.

#include <BALL/STRUCTURE/peptides.h>

  NameConverter converter();
  if (   converter.supportsNamingScheme("BMRB")
      && converter.supportsNamingScheme("PDB"))
  {
    String atom_name = "HB2";
    String pdb_name  = converter.convertName("ALA", atom_name, "BMRB", "PDB");
    cout << atom_name << " : " << pdb_name << endl;
  }	

In addition BALL can match pseudo atom names between BMRB, UCSF, XPLOR, NMRSTAR, and PDB. The pseudo atom data file can be changed by setting the option PSEUDO_ATOMS_INIFile to a different file.

#include <BALL/STRUCTURE/peptides.h>

  NameConverter converter();

  if (   converter.supportsPseudoAtomNamingScheme("NMRSTAR")
      && converter.supportsPseudoAtomNamingScheme("PDB"))
  {	
    std::vector<String> result = converter.resolvePseudoAtoms("R", "HB", "NMRSTAR", "PDB");
    cout << "pseudo atom HB of residue R can be matched to " << result.size() << " PDB atoms." << endl;
   
    ...
    Atom* atom = ...;
    if (converter.matches(atom->getResidue()->getName(), atom->getName(), "PDB", "HG2", "NMRSTAR"))
    {
       cout << "atom " << atom->getName() << " is a HG2 pseudo atom." << endl;
    }
  }

NOTE: To normalize the atom names of a protein, BALL offers a fragment database

Clone this wiki locally