Exemplo n.º 1
0
Arquivo: files.C Projeto: HeyJJ/ball
void checkStructures()
{
	// fragment DB
	if (frag_db == 0)
	{
		frag_db = new FragmentDB;
	}

	Log.info() << "system contains " << S.countAtoms() << " atoms." << endl;

	// building bonds
	S.apply(frag_db->build_bonds);

	// checking residues
	Log.info() << "checking system" << endl;
	ResidueChecker check(*frag_db);
	S.apply(check);

	// Check residue energies
	double energy_limit = 500.0;
	S.deselect();
	amber.setup(S);
	ResidueIterator it = S.beginResidue();
	for (; +it; ++it)
	{
		it->select();
		amber.updateEnergy();
		double residue_energy = amber.getStretchEnergy() + amber.getBendEnergy()
													+ amber.getVdWEnergy();
		
		if (residue_energy > energy_limit)
		{
			Log.info() << "suspicious energies in residue " << it->getFullName() << ":" << it->getID() << " " << residue_energy 
								 << " kJ/mol (bend: " << amber.getBendEnergy() << " kJ/mol, stretch: " << amber.getStretchEnergy() 
								 << " kJ/mol, vdW: " << amber.getVdWEnergy() << " kJ/mol)" << endl;
		}
		it->deselect();
		double quality = std::max(0.0, std::min(1.0, (energy_limit - residue_energy) / energy_limit));
		for (PDBAtomIterator ai = it->beginPDBAtom(); +ai; ++ai)
		{
			ai->setOccupancy(quality);
		}
	}
}
Exemplo n.º 2
0
Arquivo: files.C Projeto: HeyJJ/ball
void singlePoint()
{
	double energy = amber.updateEnergy();
	amber.updateForces();
	Gradient grad;
	grad.set(amber.getAtoms());
	grad.normalize();
	Log.info() << "single point energy: " << energy << " kJ/mol" << endl;
	Log.info() << "  - stretch      :" << amber.getStretchEnergy() << " kJ/mol" << endl;
	Log.info() << "  - bend         :" << amber.getBendEnergy() << " kJ/mol" << endl;
	Log.info() << "  - torsion      :" << amber.getTorsionEnergy() << " kJ/mol" << endl;
	Log.info() << "  - VdW          :" << amber.getVdWEnergy() << " kJ/mol" << endl;
	Log.info() << "  - electrostatic:" << amber.getESEnergy() << " kJ/mol" << endl;
	Log.info() << "grad: " << grad.rms << endl;
}