Xmipp  v3.23.11-Nereus
Public Member Functions | Public Attributes | List of all members
AtomInterpolator Class Reference

#include <pdb.h>

Public Member Functions

void setup (int m, double hights, bool computeProjection=false)
 
void addAtom (const std::string &atomType, bool computeProjection=false)
 Add atom. More...
 
int getAtomIndex (char atom) const
 Get atom index. More...
 
double atomRadius (char atom) const
 
double volumeAtDistance (char atom, double r) const
 
double projectionAtDistance (char atom, double r) const
 

Public Attributes

std::vector< MultidimArray< double > > volumeProfileCoefficients
 
std::vector< MultidimArray< double > > projectionProfileCoefficients
 
std::vector< double > radii
 
int M
 
double highTs
 

Detailed Description

Class for Atom interpolations.

Definition at line 342 of file pdb.h.

Member Function Documentation

◆ addAtom()

void AtomInterpolator::addAtom ( const std::string &  atomType,
bool  computeProjection = false 
)

Add atom.

Definition at line 1422 of file pdb.cpp.

1423 {
1424  MultidimArray<double> profile;
1425  MultidimArray<double> splineCoeffs;
1426 
1427  // Atomic profile
1428  atomRadialProfile(M, highTs, atom, profile);
1430  volumeProfileCoefficients.push_back(splineCoeffs);
1431 
1432  // Radius
1433  radii.push_back((double)FINISHINGX(profile)/M);
1434 
1435  // Projection profile
1436  if (computeProjection)
1437  {
1438  atomProjectionRadialProfile(M, splineCoeffs, profile);
1440  projectionProfileCoefficients.push_back(splineCoeffs);
1441  }
1442 }
void atomProjectionRadialProfile(int M, const MultidimArray< double > &profileCoefficients, MultidimArray< double > &projectionProfile)
Definition: pdb.cpp:1363
std::vector< MultidimArray< double > > projectionProfileCoefficients
Definition: pdb.h:348
#define FINISHINGX(v)
void produceSplineCoefficients(int SplineDegree, MultidimArray< double > &coeffs, const MultidimArray< T > &V1)
void atomRadialProfile(int M, double T, const std::string &atom, MultidimArray< double > &profile)
Definition: pdb.cpp:1306
std::vector< MultidimArray< double > > volumeProfileCoefficients
Definition: pdb.h:346
double highTs
Definition: pdb.h:354
std::vector< double > radii
Definition: pdb.h:350

◆ atomRadius()

double AtomInterpolator::atomRadius ( char  atom) const
inline

Radius of an atom in the final sampling rate M*highTs.

Definition at line 414 of file pdb.h.

415  {
416  return radii[getAtomIndex(atom)];
417  }
int getAtomIndex(char atom) const
Get atom index.
Definition: pdb.h:365
std::vector< double > radii
Definition: pdb.h:350

◆ getAtomIndex()

int AtomInterpolator::getAtomIndex ( char  atom) const
inline

Get atom index.

Definition at line 365 of file pdb.h.

366  {
367  int idx=-1;
368  switch (atom)
369  {
370  case 'H':
371  idx=0;
372  break;
373  case 'C':
374  idx=1;
375  break;
376  case 'N':
377  idx=2;
378  break;
379  case 'O':
380  idx=3;
381  break;
382  case 'P':
383  idx=4;
384  break;
385  case 'S':
386  idx=5;
387  break;
388  case 'E': // Iron Fe
389  idx=6;
390  break;
391  case 'K':
392  idx=7;
393  break;
394  case 'F':
395  idx=8;
396  break;
397  case 'G': // Magnesium Mg
398  idx=9;
399  break;
400  case 'L': // Chlorine Cl
401  idx=10;
402  break;
403  case 'A': // Calcium Ca
404  idx=11;
405  break;
406  default:
407  REPORT_ERROR(ERR_VALUE_INCORRECT,(std::string)
408  "AtomInterpolator::getAtomIndex: Atom "+atom+" unknown");
409  }
410  return idx;
411  }
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
Incorrect value received.
Definition: xmipp_error.h:195

◆ projectionAtDistance()

double AtomInterpolator::projectionAtDistance ( char  atom,
double  r 
) const

Projection value at a distance r of the atom whose first letter is the one provided as atom.

Definition at line 111 of file pdb.cpp.

112 {
113  int idx=getAtomIndex(atom);
114  if (r>radii[idx])
115  return 0;
116  else
117  return projectionProfileCoefficients[idx].
118  interpolatedElementBSpline1D(r*M,3);
119 }
std::vector< MultidimArray< double > > projectionProfileCoefficients
Definition: pdb.h:348
int getAtomIndex(char atom) const
Get atom index.
Definition: pdb.h:365
std::vector< double > radii
Definition: pdb.h:350

◆ setup()

void AtomInterpolator::setup ( int  m,
double  hights,
bool  computeProjection = false 
)

Setup. HighTs is a fine sampling rate, M is an integer number so that the final sampling rate is Ts=M*highTs;

Atom interpolations -------------------------------------------------—

Definition at line 1402 of file pdb.cpp.

1403 {
1404  M=m;
1405  highTs=hights;
1406  if (volumeProfileCoefficients.size()==12)
1407  return;
1408  addAtom("H",computeProjection);
1409  addAtom("C",computeProjection);
1410  addAtom("N",computeProjection);
1411  addAtom("O",computeProjection);
1412  addAtom("P",computeProjection);
1413  addAtom("S",computeProjection);
1414  addAtom("Fe",computeProjection);
1415  addAtom("K",computeProjection);
1416  addAtom("F",computeProjection);
1417  addAtom("Mg",computeProjection);
1418  addAtom("Cl",computeProjection);
1419  addAtom("Ca",computeProjection);
1420 }
std::vector< MultidimArray< double > > volumeProfileCoefficients
Definition: pdb.h:346
int m
void addAtom(const std::string &atomType, bool computeProjection=false)
Add atom.
Definition: pdb.cpp:1422
double highTs
Definition: pdb.h:354

◆ volumeAtDistance()

double AtomInterpolator::volumeAtDistance ( char  atom,
double  r 
) const

Volume value at a distance r of the atom whose first letter is the one provided as atom.

Definition at line 101 of file pdb.cpp.

102 {
103  int idx=getAtomIndex(atom);
104  if (r>radii[idx])
105  return 0;
106  else
107  return volumeProfileCoefficients[idx].
108  interpolatedElementBSpline1D(r*M,3);
109 }
std::vector< MultidimArray< double > > volumeProfileCoefficients
Definition: pdb.h:346
int getAtomIndex(char atom) const
Get atom index.
Definition: pdb.h:365
std::vector< double > radii
Definition: pdb.h:350

Member Data Documentation

◆ highTs

double AtomInterpolator::highTs

Definition at line 354 of file pdb.h.

◆ M

int AtomInterpolator::M

Definition at line 352 of file pdb.h.

◆ projectionProfileCoefficients

std::vector< MultidimArray<double> > AtomInterpolator::projectionProfileCoefficients

Definition at line 348 of file pdb.h.

◆ radii

std::vector<double> AtomInterpolator::radii

Definition at line 350 of file pdb.h.

◆ volumeProfileCoefficients

std::vector< MultidimArray<double> > AtomInterpolator::volumeProfileCoefficients

Definition at line 346 of file pdb.h.


The documentation for this class was generated from the following files: