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

#include <pdb.h>

Collaboration diagram for PDBPhantom:
Collaboration graph
[legend]

Public Member Functions

void addAtom (const Atom &atom)
 Add Atom. More...
 
const AtomgetAtom (int i) const
 Get Atom at position i. More...
 
size_t getNumberOfAtoms () const
 Get number of atoms. More...
 
void read (const FileName &fnPDB)
 Read phantom from either a PDB of CIF file. More...
 
void shift (double x, double y, double z)
 Apply a shift to all atoms. More...
 
void produceSideInfo ()
 

Public Attributes

std::vector< AtomatomList
 List of atoms. More...
 
cif::datablock dataBlock
 

Detailed Description

Phantom description using atoms.

Definition at line 127 of file pdb.h.

Member Function Documentation

◆ addAtom()

void PDBPhantom::addAtom ( const Atom atom)
inline

Add Atom.

Definition at line 137 of file pdb.h.

138  {
139  atomList.push_back(atom);
140  }
std::vector< Atom > atomList
List of atoms.
Definition: pdb.h:131

◆ getAtom()

const Atom& PDBPhantom::getAtom ( int  i) const
inline

Get Atom at position i.

Definition at line 143 of file pdb.h.

144  {
145  return atomList[i];
146  }
#define i
std::vector< Atom > atomList
List of atoms.
Definition: pdb.h:131

◆ getNumberOfAtoms()

size_t PDBPhantom::getNumberOfAtoms ( ) const
inline

Get number of atoms.

Definition at line 149 of file pdb.h.

150  {
151  return atomList.size();
152  }
std::vector< Atom > atomList
List of atoms.
Definition: pdb.h:131

◆ produceSideInfo()

void PDBPhantom::produceSideInfo ( )

Produce side info. The side info produces the radial profiles of each atom and its projections.

◆ read()

void PDBPhantom::read ( const FileName fnPDB)

Read phantom from either a PDB of CIF file.

This function reads the given PDB or CIF file and inserts the found atoms inside in class's atom list.

Parameters
fnPDBPDB/CIF file.

Definition at line 503 of file pdb.cpp.

504 {
505  // Checking if extension is .cif or .pdb
506  if (checkExtension(fnPDB.getString(), {".cif"}, {".gz"})) {
507  readCIF(fnPDB.getString(), bind(&PDBPhantom::addAtom, this, std::placeholders::_1), dataBlock);
508  } else {
509  readPDB(fnPDB, bind(&PDBPhantom::addAtom, this, std::placeholders::_1));
510  }
511 }
void readCIF(const std::string &fnCIF, const callable &addAtom, cif::datablock &dataBlock)
Read phantom from CIF.
Definition: pdb.cpp:463
void addAtom(const Atom &atom)
Add Atom.
Definition: pdb.h:137
cif::datablock dataBlock
Definition: pdb.h:134
bool checkExtension(const std::filesystem::path &filePath, const std::list< std::string > &acceptedExtensions, const std::list< std::string > &acceptedCompressions)
Checks if the file uses a supported extension type.
Definition: pdb.cpp:384
String getString() const
void readPDB(const FileName &fnPDB, const callable &addAtom)
Read phantom from PDB.
Definition: pdb.cpp:417

◆ shift()

void PDBPhantom::shift ( double  x,
double  y,
double  z 
)

Apply a shift to all atoms.

Definition at line 514 of file pdb.cpp.

515 {
516  int imax=atomList.size();
517  for (int i=0; i<imax; i++)
518  {
519  atomList[i].x+=x;
520  atomList[i].y+=y;
521  atomList[i].z+=z;
522  }
523 }
static double * y
doublereal * x
#define i
double z
std::vector< Atom > atomList
List of atoms.
Definition: pdb.h:131

Member Data Documentation

◆ atomList

std::vector<Atom> PDBPhantom::atomList

List of atoms.

Definition at line 131 of file pdb.h.

◆ dataBlock

cif::datablock PDBPhantom::dataBlock

Definition at line 134 of file pdb.h.


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