Skip to content
Sections
Personal tools
You are here: Home » BALLView » Support » FAQ » Single atoms

Single atoms

Question:

When I write the contents of PDB files as HIN files, the resulting file contains loads of molecules each containing just one atom. What's going on?

Answer:

You did not construct bonds. PDB files do (usually) not contain bonds. However, Hyperchem HIN files define "molecules" as sets of fully connected atoms (connected components). Therefore, if you do not have any bonds, each atom has to be written as its own molecule in order to comply with the Hyperchem file format. In order to avoid this problem, you should construct the bonds prior to writing the HIN file. This can be achieved by code similar to the example below:

  // Read a PDB file.
  PDBFile infile("test.pdb");
  System S;
  infile >> S;

  // Construct a fragment database containing the required
  // topology information and construct the bonds in the system.
  FragmentDB frag_db;
  S.apply(frag_db.build_bonds);

  // Write the system to a Hyperchem file.
  HINFile outfile("test.hin", File::OUT);
  outfile << S;

 
 

Powered by Plone

This site conforms to the following standards: