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

#include <pdb.h>

Collaboration diagram for PDBRichPhantom:
Collaboration graph
[legend]

Public Member Functions

void addAtom (const RichAtom &atom)
 Add Atom. More...
 
size_t getNumberOfAtoms () const
 Get number of atoms. More...
 
void read (const FileName &fnPDB, const bool pseudoatoms=false, const double threshold=0.0)
 Read rich phantom from either a PDB of CIF file. More...
 
void write (const FileName &fnPDB, const bool renumber=false)
 Write rich phantom to PDB or CIF file. More...
 

Public Attributes

std::vector< std::string > remarks
 List of remarks. More...
 
std::vector< RichAtomatomList
 List of atoms. More...
 
std::vector< double > intensities
 
cif::datablock dataBlock
 

Detailed Description

Phantom description using atoms.

Definition at line 250 of file pdb.h.

Member Function Documentation

◆ addAtom()

void PDBRichPhantom::addAtom ( const RichAtom atom)
inline

Add Atom.

Definition at line 264 of file pdb.h.

265  {
266  atomList.push_back(atom);
267  }
std::vector< RichAtom > atomList
List of atoms.
Definition: pdb.h:257

◆ getNumberOfAtoms()

size_t PDBRichPhantom::getNumberOfAtoms ( ) const
inline

Get number of atoms.

Definition at line 270 of file pdb.h.

271  {
272  return atomList.size();
273  }
std::vector< RichAtom > atomList
List of atoms.
Definition: pdb.h:257

◆ read()

void PDBRichPhantom::read ( const FileName fnPDB,
const bool  pseudoatoms = false,
const double  threshold = 0.0 
)

Read rich phantom from either a PDB of CIF file.

This function reads the given PDB or CIF file and stores the found atoms, remarks, and intensities.

Parameters
fnPDBPDB/CIF file.
pseudoatomsFlag for returning intensities (stored in B-factors) instead of atoms. false (default) is used when there are no pseudoatoms or when using a threshold.
thresholdB factor threshold for filtering out for pdb_reduce_pseudoatoms.

Definition at line 704 of file pdb.cpp.

705 {
706  // Checking if extension is .cif or .pdb
707  if (checkExtension(fnPDB.getString(), {".cif"}, {".gz"})) {
708  readRichCIF(fnPDB.getString(), bind(&PDBRichPhantom::addAtom, this, std::placeholders::_1), intensities, pseudoatoms, threshold, dataBlock);
709  } else {
710  readRichPDB(fnPDB, bind(&PDBRichPhantom::addAtom, this, std::placeholders::_1), intensities, remarks, pseudoatoms, threshold);
711  }
712 }
std::vector< double > intensities
Definition: pdb.h:258
void readRichCIF(const std::string &fnCIF, const callable &addAtom, std::vector< double > &intensities, const bool pseudoatoms, const double threshold, cif::datablock &dataBlock)
Read rich phantom from CIF.
Definition: pdb.cpp:622
void threshold(double *phi, unsigned long nvox, double limit)
Definition: lib_vwk.cpp:524
std::vector< std::string > remarks
List of remarks.
Definition: pdb.h:254
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 readRichPDB(const FileName &fnPDB, const callable &addAtom, std::vector< double > &intensities, std::vector< std::string > &remarks, const bool pseudoatoms, const double threshold)
Read rich phantom from either a PDB of CIF file.
Definition: pdb.cpp:538
void addAtom(const RichAtom &atom)
Add Atom.
Definition: pdb.h:264
cif::datablock dataBlock
Definition: pdb.h:261

◆ write()

void PDBRichPhantom::write ( const FileName fnPDB,
const bool  renumber = false 
)

Write rich phantom to PDB or CIF file.

This function stores all the data of the rich phantom into a PDB or CIF file. Note: Conversion is not enabled yet, so if a file read from a PDB is written into a CIF file, results might not be great. Atoms should be properly translated, but remarks and intensities probably not.

Parameters
fnPDBPDB/CIF file to write to.
renumberFlag for determining if atom's serial numbers must be renumbered or not.

Definition at line 872 of file pdb.cpp.

873 {
874  // Checking if extension is .cif or .pdb
875  if (checkExtension(fnPDB.getString(), {".cif"}, {".gz"})) {
877  } else {
878  writePDB(fnPDB, renumber, remarks, atomList);
879  }
880 }
void writeCIF(const std::string &fnCIF, const callable &atomList, cif::datablock &dataBlock)
Write rich phantom to CIF file.
Definition: pdb.cpp:773
std::vector< RichAtom > atomList
List of atoms.
Definition: pdb.h:257
std::vector< std::string > remarks
List of remarks.
Definition: pdb.h:254
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 writePDB(const FileName &fnPDB, bool renumber, const std::vector< std::string > &remarks, const callable &atomList)
Write rich phantom to PDB file.
Definition: pdb.cpp:725
cif::datablock dataBlock
Definition: pdb.h:261

Member Data Documentation

◆ atomList

std::vector<RichAtom> PDBRichPhantom::atomList

List of atoms.

Definition at line 257 of file pdb.h.

◆ dataBlock

cif::datablock PDBRichPhantom::dataBlock

Definition at line 261 of file pdb.h.

◆ intensities

std::vector<double> PDBRichPhantom::intensities

Definition at line 258 of file pdb.h.

◆ remarks

std::vector<std::string> PDBRichPhantom::remarks

List of remarks.

Definition at line 254 of file pdb.h.


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