本文整理汇总了C++中AtomIterator::getElement方法的典型用法代码示例。如果您正苦于以下问题:C++ AtomIterator::getElement方法的具体用法?C++ AtomIterator::getElement怎么用?C++ AtomIterator::getElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AtomIterator
的用法示例。
在下文中一共展示了AtomIterator::getElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
tmp = path.find(polar_radius_rule_file_name);
if (tmp != "")
{
polar_radius_rule_file_name = tmp;
}
if (verbosity > 0)
{
Log.info() << "Using " << polar_radius_rule_file_name << " as polar radius rule file" << endl;
}
INIFile radius_ini(polar_radius_rule_file_name);
radius_ini.read();
RadiusRuleProcessor radius_rules(radius_ini);
system.apply(radius_rules);
}
if (verbosity > 8)
{
Log.info() << "system statistics:" << endl;
Log.info() << "molecules: " << system.countMolecules() << endl;
Log.info() << "proteins: " << system.countProteins() << endl;
Log.info() << "fragments: " << system.countFragments() << endl;
Log.info() << "atoms: " << system.countAtoms() << endl;
}
// check for uassigned type names
AtomIterator it;
int count = 0;
for (it = system.beginAtom(); +it; ++it)
{
count++;
if (it->getElement().getSymbol() == "?")
{
Log.info() << "Got symbol \"?\": " << it->getFullName() << endl;
}
if (it->getCharge() > 8.0)
{
Log.error() << "Mysterious charge: " << it->getCharge() << "\t"
<< it->getFullName() << "\t" << count << "\t" << it->getElement().getSymbol() << endl;
}
}
// scale charges
if (verbosity > 0)
{
Log.info() << "Scaling receptor charges by " << receptor_charge_scaling_factor << endl;
}
if (parpars.has("s"))
{
for (it = protein->beginAtom(); +it; ++it)
{
it->setCharge(it->getCharge() * receptor_charge_scaling_factor);
}
}
if (verbosity > 0)
{
Log.info() << "Scaling ligand charges by " << ligand_charge_scaling_factor << endl;
}
if (parpars.has("t"))
{
for (it = ligand->beginAtom(); +it; ++it)
{
it->setCharge(it->getCharge() * ligand_charge_scaling_factor);
示例2: f
CHECK(AntechamberFile::AntechamberFile(const String& filename, File::OpenMode open_mode))
// checking for default mode: reading
AntechamberFile f(BALL_TEST_DATA_PATH(AntechamberFile_test1.ac));
TEST_EQUAL(f.isValid(), true)
RESULT
CHECK(AntechamberFile::read(System& system))
AntechamberFile f(BALL_TEST_DATA_PATH(AntechamberFile_test2.ac));
System S;
f.read(S);
f.close();
TEST_EQUAL(S.countAtoms(), 2)
AtomIterator it = S.beginAtom();
TEST_EQUAL(it->getElement().getSymbol(), "H")
TEST_REAL_EQUAL(it->getPosition().x, 0.0)
TEST_REAL_EQUAL(it->getPosition().y, 1.0)
TEST_REAL_EQUAL(it->getPosition().z, 2.0)
it++;
TEST_EQUAL(it->getElement().getSymbol(), "O")
TEST_REAL_EQUAL(it->getPosition().x, 3.0)
TEST_REAL_EQUAL(it->getPosition().y, 4.0)
TEST_REAL_EQUAL(it->getPosition().z, 5.0)
RESULT
CHECK(AntechamberFile::read(System& system))
AntechamberFile f(BALL_TEST_DATA_PATH(AntechamberFile_test1.ac));
System S;
f.read(S);
示例3: updateScore
double Polarity::updateScore()
{
score_ = 0.0;
//float val = 0.0;
//float distance;
//float R1;
//float R2;
const HashGrid3<Atom*>* hashgrid = scoring_function_->getHashGrid();
int radius = 1;
Size no_neighbor_cells = (Size)pow((double)(radius*2+1), 3); // radius of 1 cell == > 3 cells on each axis
double total_sum = 0;
AtomPairVector::const_iterator it;
for (AtomIterator it = scoring_function_->getLigand()->beginAtom(); +it; it++)
{
int no_positive_contacts = 0;
int no_negative_contacts = 0;
bool ligandatom_is_lipophilic = isLipophilic_(&*it);
if (!ligandatom_is_lipophilic)
{
continue;
}
const HashGridBox3<Atom*>* box = hashgrid->getBox(it->getPosition());
// ligand atom lies outside of grid
if (!box) continue;
Position pos_x, pos_y, pos_z;
hashgrid->getIndices(*box, pos_x, pos_y, pos_z);
// indices in HashGrid, where the search for interacting target atoms should begin ( != position of ligand atom)
int i = ((int)pos_x)-radius; if (i < 0){i = 0; }
int j0 = ((int)pos_y)-radius; if (j0 < 0){j0 = 0; }
int k0 = ((int)pos_z)-radius; if (k0 < 0){k0 = 0; }
int x_size = (int)hashgrid->getSizeX();
int y_size = (int)hashgrid->getSizeY();
int z_size = (int)hashgrid->getSizeZ();
for (; i <= pos_x+radius && i < x_size; i++)
{
for (int j = j0; j <= pos_y+radius && j < y_size; j++)
{
for (int k = k0; k <= pos_z+radius && k < z_size; k++)
{
const HashGridBox3<Atom*>* box = hashgrid->getBox(i, j, k);
if (!box->isEmpty())
{
double cell_score = 0;
for (HashGridBox3 < Atom* > ::ConstDataIterator d_it = box->beginData(); d_it != box->endData(); d_it++)
{
if (isBackboneAtom_(*d_it)) continue;
bool rec_polar = isPolar_(*d_it);
bool rec_lipophilic = 0;
if (!rec_polar) rec_lipophilic = isLipophilic_(*d_it);
if (!rec_polar && ! rec_lipophilic) continue;
double distance = ((*d_it)->getPosition()-it->getPosition()).getLength();
if (distance > (*d_it)->getElement().getVanDerWaalsRadius()+it->getElement().getVanDerWaalsRadius()+1.5) continue;
double val;
if (distance > 1) val = 1/distance;
else val = 1;
// lipophilic--lipophilic interaction; else polar rec. -- lipophilic ligand atom
if (rec_lipophilic)
{
val *= -1;
}
cell_score += val;
total_sum += val;
if (scoring_function_->storeInteractionsEnabled())
{
val = scaleScore(val);
it->addInteraction(*d_it, "pol", val);
(*d_it)->addInteraction(&*it, "pol", val);
}
}
if (cell_score < -0.1) no_positive_contacts++;
else if (cell_score > 0.1) no_negative_contacts++;
}
// if there is no neighboring receptor atom, there will be water ...
// else if(i!=pos_x||j!=pos_y||k!=pos_z)
// {
// if(ligandatom_is_lipophilic)
// {
// no_negative_contacts++;
// double scaled_atom_score = 1.0/no_neighbor_cells;
// scaleScore(scaled_atom_score);
// total_sum += scaled_atom_score;
// it->addInteraction("pol",scaled_atom_score);
// }
// }
//.........这里部分代码省略.........