本文整理汇总了C++中PDB::getNumberOfAtomBlocks方法的典型用法代码示例。如果您正苦于以下问题:C++ PDB::getNumberOfAtomBlocks方法的具体用法?C++ PDB::getNumberOfAtomBlocks怎么用?C++ PDB::getNumberOfAtomBlocks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDB
的用法示例。
在下文中一共展示了PDB::getNumberOfAtomBlocks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readAtomsFromPDB
void ReferenceAtoms::readAtomsFromPDB( const PDB& pdb, const bool allowblocks ){
if( !allowblocks && pdb.getNumberOfAtomBlocks()!=1 ) error("found multi-atom-block pdb format but expecting only one block of atoms");
for(unsigned i=0;i<pdb.size();++i){
indices.push_back( pdb.getAtomNumbers()[i] ); reference_atoms.push_back( pdb.getPositions()[i] );
align.push_back( pdb.getOccupancy()[i] ); displace.push_back( pdb.getBeta()[i] );
}
atom_der_index.resize( reference_atoms.size() );
}
示例2: read
void MultiDomainRMSD::read( const PDB& pdb ) {
unsigned nblocks = pdb.getNumberOfAtomBlocks();
if( nblocks<2 ) error("multidomain RMSD only has one block of atoms");
std::vector<Vector> positions; std::vector<double> align, displace;
std::string num; blocks.resize( nblocks+1 ); blocks[0]=0;
for(unsigned i=0; i<nblocks; ++i) blocks[i+1]=pdb.getAtomBlockEnds()[i];
double tmp, lower=0.0, upper=std::numeric_limits<double>::max( );
if( pdb.getArgumentValue("LOWER_CUTOFF",tmp) ) lower=tmp;
if( pdb.getArgumentValue("UPPER_CUTOFF",tmp) ) upper=tmp;
bool nopbc=pdb.hasFlag("NOPBC");
domains.resize(0); weights.resize(0);
for(unsigned i=1; i<=nblocks; ++i) {
Tools::convert(i,num);
if( ftype=="RMSD" ) {
// parse("TYPE"+num, ftype );
lower=0.0; upper=std::numeric_limits<double>::max( );
if( pdb.getArgumentValue("LOWER_CUTOFF"+num,tmp) ) lower=tmp;
if( pdb.getArgumentValue("UPPER_CUTOFF"+num,tmp) ) upper=tmp;
nopbc=pdb.hasFlag("NOPBC");
}
domains.emplace_back( metricRegister().create<SingleDomainRMSD>( ftype ) );
positions.resize( blocks[i] - blocks[i-1] );
align.resize( blocks[i] - blocks[i-1] );
displace.resize( blocks[i] - blocks[i-1] );
unsigned n=0;
for(unsigned j=blocks[i-1]; j<blocks[i]; ++j) {
positions[n]=pdb.getPositions()[j];
align[n]=pdb.getOccupancy()[j];
displace[n]=pdb.getBeta()[j];
n++;
}
domains[i-1]->setBoundsOnDistances( !nopbc, lower, upper );
domains[i-1]->setReferenceAtoms( positions, align, displace );
domains[i-1]->setupRMSDObject();
double ww=0;
if( !pdb.getArgumentValue("WEIGHT"+num,ww) ) weights.push_back( 1.0 );
else weights.push_back( ww );
}
// And set the atom numbers for this object
indices.resize(0); atom_der_index.resize(0);
for(unsigned i=0; i<pdb.size(); ++i) { indices.push_back( pdb.getAtomNumbers()[i] ); atom_der_index.push_back(i); }
// setAtomNumbers( pdb.getAtomNumbers() );
}
示例3: read
void MultiDomainRMSD::read( const PDB& pdb ){
unsigned nblocks = pdb.getNumberOfAtomBlocks();
if( nblocks<2 ) error("multidomain RMSD only has one block of atoms");
std::vector<AtomNumber> atomnumbers;
std::vector<Vector> positions; std::vector<double> align, displace;
std::string num; blocks.resize( nblocks+1 ); blocks[0]=0;
for(unsigned i=0;i<nblocks;++i) blocks[i+1]=pdb.getAtomBlockEnds()[i];
double lower=0.0, upper=std::numeric_limits<double>::max( );
parse("LOWER_CUTOFF",lower,true);
parse("UPPER_CUTOFF",upper,true);
for(unsigned i=1;i<=nblocks;++i){
Tools::convert(i,num);
if( ftype=="RMSD" ){
parse("TYPE"+num, ftype );
parse("LOWER_CUTOFF"+num,lower,true);
parse("UPPER_CUTOFF"+num,upper,true);
}
domains.push_back( metricRegister().create<SingleDomainRMSD>( ftype ) );
positions.resize( blocks[i] - blocks[i-1] + 1 );
align.resize( blocks[i] - blocks[i-1] + 1 );
displace.resize( blocks[i] - blocks[i-1] + 1 );
unsigned n=0;
for(unsigned j=blocks[i-1];j<blocks[i];++j){
positions[n]=pdb.getPositions()[j];
align[n]=pdb.getOccupancy()[j];
displace[n]=pdb.getBeta()[j];
n++;
}
domains[i-1]->setBoundsOnDistances( true, lower, upper ); // Currently no option for nopbc
domains[i-1]->setReferenceAtoms( positions, align, displace );
domains[i-1]->setNumberOfAtoms( positions.size() );
double ww=0; parse("WEIGHT"+num, ww, true );
if( ww==0 ) weights.push_back( 1.0 );
else weights.push_back( ww );
}
// And set the atom numbers for this object
setAtomNumbers( pdb.getAtomNumbers() );
}