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

How can backbone atoms be identified?

Backbone atoms can be identified by their names, after being assigned unified names by BALLs FragmentDB.

  #include <BALL/STRUCTURE/fragmentDB.h> 

  // read a file into a system
  System system = ...

  // apply the Fragment DB	
  FragmentDB fdb = FragmentDB("");
  system.apply(fdb.normalize_names);

  Protein* protein = system.getProtein(0);

  // iterator over all atoms 
  for (ResidueIterator rit = protein->beginResidue(); +rit; ++rit)
  {

    for ( AtomIterator ait = rit->beginAtom(); +ait; ++ait)
    {
       // identify backbone atoms by their names
       if ( ( (ait->getName()== "C") ||
              (ait->getName()== "O") ||
              (ait->getName()== "N") ||
              (ait->getName()== "HA")
             ) )
       {
         // do something
       }
       else 
       { 
         // do something else
       }
     }
  }
Clone this wiki locally