IMP logo
IMP Reference Guide  2.16.0
The Integrative Modeling Platform
pdb.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/pdb.h
3  * \brief Functions to read PDBs
4  *
5  * Copyright 2007-2021 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPATOM_PDB_H
10 #define IMPATOM_PDB_H
11 
12 #include <IMP/atom/atom_config.h>
13 #include "Hierarchy.h"
14 #include "Atom.h"
15 #include "element.h"
16 #include "internal/pdb.h"
17 #include "atom_macros.h"
18 #include <IMP/file.h>
19 #include "Selection.h"
20 #include <IMP/Model.h>
21 #include <IMP/Particle.h>
22 #include <IMP/OptimizerState.h>
23 #include <IMP/internal/utility.h>
24 #include <boost/format.hpp>
25 #include <boost/algorithm/string.hpp>
26 
27 IMPATOM_BEGIN_NAMESPACE
28 
29 //! Select which atoms to read from a PDB file
30 /** Selector is a general purpose class used to select records from a PDB
31  file. Using descendants of this class one may implement arbitrary
32  selection functions and pass them to PDB reading functions
33  for object selection. Simple selectors can be used to build more complicated
34  ones. Inheritance means "AND" unless otherwise noted (that is, the
35  CAlphaPDBSelector takes all non-alternate C-alphas since it inherits from
36  NonAlternativePDBSelector).
37 
38  \see read_pdb, read_mmcif
39 */
40 class IMPATOMEXPORT PDBSelector : public IMP::Object {
41  public:
42  PDBSelector(std::string name) : Object(name) {}
43  //! Return true if the line should be processed
44  virtual bool get_is_selected(const std::string &pdb_line) const = 0;
45  virtual ~PDBSelector();
46 };
47 
49 
50 //! Select all ATOM and HETATM records which are not alternatives
52  public:
53  NonAlternativePDBSelector(std::string name = "NonAlternativePDBSelector%1%")
54  : PDBSelector(name) {}
55 
56  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
57  return (internal::atom_alt_loc_indicator(pdb_line) == ' ' ||
58  internal::atom_alt_loc_indicator(pdb_line) == 'A');
59  }
61 };
62 
63 //! Select all non-alternative ATOM records
65  public:
66  ATOMPDBSelector(std::string name = "ATOMPDBSelector%1%")
67  : NonAlternativePDBSelector(name) {}
68 
69  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
70  return (NonAlternativePDBSelector::get_is_selected(pdb_line) &&
71  internal::is_ATOM_rec(pdb_line));
72  }
74 };
75 
76 //! Select all CA ATOM records
78  public:
79  CAlphaPDBSelector(std::string name = "CAlphaPDBSelector%1%")
80  : NonAlternativePDBSelector(name) {}
81 
82  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
83  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) return false;
84  const std::string type = internal::atom_type(pdb_line);
85  return (type[1] == 'C' && type[2] == 'A' && type[3] == ' ');
86  }
88 };
89 
90 //! Select all CB ATOM records
92  public:
93  CBetaPDBSelector(std::string name = "CBetaPDBSelector%1%")
94  : NonAlternativePDBSelector(name) {}
95 
96  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
97  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) return false;
98  const std::string type = internal::atom_type(pdb_line);
99  return (type[1] == 'C' && type[2] == 'B' && type[3] == ' ');
100  }
102 };
103 
104 //! Select all atoms of the given types
105 /** Note that unlike CAlphaPDBSelector and similar classes, this selects all
106  atoms, even those in alternative locations (combine with
107  a NonAlternativePDBSelector if necessary).
108  */
110  Strings atom_types_;
111  public:
112  AtomTypePDBSelector(Strings atom_types,
113  std::string name = "AtomTypePDBSelector%1%")
114  : PDBSelector(name), atom_types_(atom_types) {
115  std::sort(atom_types_.begin(), atom_types_.end());
116  }
117 
118  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
119  std::string type = internal::atom_type(pdb_line);
120  boost::trim(type);
121  return std::binary_search(atom_types_.begin(), atom_types_.end(), type);
122  }
124 };
125 
126 //! Select all atoms in residues of the given types
127 /** Note that unlike CAlphaPDBSelector and similar classes, this selects all
128  atoms, even those in alternative locations (combine with
129  a NonAlternativePDBSelector if necessary).
130  */
132  Strings residue_types_;
133  public:
134  ResidueTypePDBSelector(Strings residue_types,
135  std::string name = "ResidueTypePDBSelector%1%")
136  : PDBSelector(name), residue_types_(residue_types) {
137  std::sort(residue_types_.begin(), residue_types_.end());
138  }
139 
140  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
141  std::string type = internal::atom_residue_name(pdb_line);
142  boost::trim(type);
143  return std::binary_search(residue_types_.begin(), residue_types_.end(),
144  type);
145  }
147 };
148 
149 //! Select all C (not CA or CB) ATOM records
151  public:
152  CPDBSelector(std::string name = "CPDBSelector%1%")
153  : NonAlternativePDBSelector(name) {}
154 
155  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
156  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) return false;
157  const std::string type = internal::atom_type(pdb_line);
158  return (type[1] == 'C' && type[2] == ' ' && type[3] == ' ');
159  }
161 };
162 
163 //! Select all N ATOM records
165  public:
166  NPDBSelector(std::string name = "NPDBSelector%1%")
167  : NonAlternativePDBSelector(name) {}
168 
169  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
170  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) return false;
171  const std::string type = internal::atom_type(pdb_line);
172  return (type[1] == 'N' && type[2] == ' ' && type[3] == ' ');
173  }
175 };
176 
177 //! Defines a selector that will pick every ATOM and HETATM record
178 class AllPDBSelector : public PDBSelector {
179  public:
180  AllPDBSelector(std::string name = "AllPDBSelector%1%") : PDBSelector(name) {}
181 
182  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
183  return (true || pdb_line.empty());
184  }
186 };
187 
188 //! Select all ATOM and HETATM records with the given chain ids
190  public:
191  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
192  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) {
193  return false;
194  }
195  for (int i = 0; i < (int)chains_.length(); i++) {
196  if (internal::atom_chain_id(pdb_line) == chains_[i]) return true;
197  }
198  return false;
199  }
201  //! The chain id can be any character in chains
202  /** \note This limits the selection to single-character chain IDs
203  (mmCIF files support multiple-character chain names) */
204  ChainPDBSelector(const std::string &chains,
205  std::string name = "ChainPDBSelector%1%")
206  : NonAlternativePDBSelector(name), chains_(chains) {}
207 
208  private:
209  std::string chains_;
210 };
211 
212 //! Select all non-water ATOM and HETATM records
214  public:
215  WaterPDBSelector(std::string name = "WaterPDBSelector%1%")
216  : NonAlternativePDBSelector(name) {}
217 
218  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
219  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) {
220  return false;
221  }
222  const std::string res_name = internal::atom_residue_name(pdb_line);
223  return ((res_name[0] == 'H' && res_name[1] == 'O' && res_name[2] == 'H') ||
224  (res_name[0] == 'D' && res_name[1] == 'O' && res_name[2] == 'D'));
225  }
227 };
228 
229 //! Select all hydrogen ATOM and HETATM records
230 class IMPATOMEXPORT HydrogenPDBSelector : public NonAlternativePDBSelector {
231  bool is_hydrogen(std::string pdb_line) const;
232 
233  public:
234  HydrogenPDBSelector(std::string name = "HydrogenPDBSelector%1%")
235  : NonAlternativePDBSelector(name) {}
236 
237  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
238  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) return false;
239  return is_hydrogen(pdb_line);
240  }
242 };
243 
244 //! Select non water and non hydrogen atoms
247 
248  public:
249  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
250  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) {
251  return false;
252  }
253  return (!ws_->get_is_selected(pdb_line) && !hs_->get_is_selected(pdb_line));
254  }
256  NonWaterNonHydrogenPDBSelector(std::string name)
258  ws_(new WaterPDBSelector()),
259  hs_(new HydrogenPDBSelector()) {}
261  : NonAlternativePDBSelector("NonWaterPDBSelector%1%"),
262  ws_(new WaterPDBSelector()),
263  hs_(new HydrogenPDBSelector()) {}
264 };
265 
266 //! Select non hydrogen atoms
269 
270  public:
271  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
272  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) {
273  return false;
274  }
275  return (!hs_->get_is_selected(pdb_line));
276  }
278  NonHydrogenPDBSelector(std::string name)
280  hs_(new HydrogenPDBSelector()) {}
282  : NonAlternativePDBSelector("NonHydrogenPDBSelector%1%"),
283  hs_(new HydrogenPDBSelector()) {}
284 };
285 
286 //! Select all non-water non-alternative ATOM and HETATM records
289 
290  public:
291  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
292  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) {
293  return false;
294  }
295  return (!ws_->get_is_selected(pdb_line));
296  }
298  NonWaterPDBSelector(std::string name)
299  : NonAlternativePDBSelector(name), ws_(new WaterPDBSelector()) {}
301  : NonAlternativePDBSelector("NonWaterPDBSelector%1%"),
302  ws_(new WaterPDBSelector()) {}
303 };
304 
305 //! Select all backbone (N,CA,C,O) ATOM records
307  public:
308  BackbonePDBSelector(std::string name = "BackbonePDBSelector%1%")
310 
311  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
312  if (!NonWaterNonHydrogenPDBSelector::get_is_selected(pdb_line))
313  return false;
314  const std::string type = internal::atom_type(pdb_line);
315  return ((type[1] == 'N' && type[2] == ' ' && type[3] == ' ') ||
316  (type[1] == 'C' && type[2] == 'A' && type[3] == ' ') ||
317  (type[1] == 'C' && type[2] == ' ' && type[3] == ' ') ||
318  (type[1] == 'O' && type[2] == ' ' && type[3] == ' '));
319  }
321 };
322 
323 //! Select all P (= phosphate) ATOM records
325  public:
326  PPDBSelector(std::string name = "PPDBSelector%1%")
327  : NonAlternativePDBSelector(name) {}
328 
329  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
330  if (!NonAlternativePDBSelector::get_is_selected(pdb_line)) return false;
331  const std::string type = internal::atom_type(pdb_line);
332  return (type[1] == 'P' && type[2] == ' ' && type[3] == ' ');
333  }
335 };
336 
337 //! Select atoms which are selected by both selectors
338 /** To use do something like
339  \code
340  read_pdb(name, m, AndPDBSelector(PPDBSelector(), WaterPDBSelector()));
341  \endcode
342 
343  In Python, the and operator (&) can be used to the same effect:
344  \code
345  read_pdb(name, m, PPDBSelector() & WaterPDBSelector());
346  \endcode
347  */
348 class AndPDBSelector : public PDBSelector {
349  const IMP::PointerMember<PDBSelector> a_, b_;
350 
351  public:
352  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
353  return a_->get_is_selected(pdb_line) && b_->get_is_selected(pdb_line);
354  }
357  : PDBSelector("AndPDBSelector%1%"), a_(a), b_(b) {}
358 };
359 
360 //! Select atoms which are selected by either or both selectors
361 /** To use do something like
362  \code
363  read_pdb(name, m, OrPDBSelector(PPDBSelector(), WaterPDBSelector()));
364  \endcode
365 
366  In Python, the or operator (|) can be used to the same effect:
367  \code
368  read_pdb(name, m, PPDBSelector() | WaterPDBSelector());
369  \endcode
370  */
371 class OrPDBSelector : public PDBSelector {
372  const IMP::PointerMember<PDBSelector> a_, b_;
373 
374  public:
375  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
376  return a_->get_is_selected(pdb_line) || b_->get_is_selected(pdb_line);
377  }
380  : PDBSelector("OrPDBSelector%1%"), a_(a), b_(b) {}
381 };
382 
383 //! Select atoms which are selected by either selector but not both
384 /** To use do something like
385  \code
386  read_pdb(name, m, XorPDBSelector(HydrogenPDBSelector(),
387  WaterPDBSelector()));
388  \endcode
389 
390  In Python, the xor operator (^) can be used to the same effect:
391  \code
392  read_pdb(name, m, HydrogenPDBSelector() ^ WaterPDBSelector());
393  \endcode
394  */
395 class XorPDBSelector : public PDBSelector {
396  const IMP::PointerMember<PDBSelector> a_, b_;
397 
398  public:
399  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
400  return a_->get_is_selected(pdb_line) != b_->get_is_selected(pdb_line);
401  }
404  : PDBSelector("XorPDBSelector%1%"), a_(a), b_(b) {}
405 };
406 
407 //! Select atoms which are not selected by a given selector
408 /** To use do something like
409  \code
410  read_pdb(name, m, NotPDBSelector(PPDBSelector()));
411  \endcode
412 
413  In Python, the inversion operator (~) can be used to the same effect:
414  \code
415  read_pdb(name, m, ~PPDBSelector());
416  \endcode
417  */
418 class NotPDBSelector : public PDBSelector {
420 
421  public:
422  bool get_is_selected(const std::string &pdb_line) const IMP_OVERRIDE {
423  return !a_->get_is_selected(pdb_line);
424  }
426  NotPDBSelector(PDBSelector *a) : PDBSelector("NotPDBSelector%1%"), a_(a) {}
427 };
428 
429 /** @name PDB Reading
430  \anchor pdb_in
431  The read PDB methods produce a hierarchy that looks as follows:
432  - One Atom per ATOM or HETATM record in the PDB.
433  - All Atom particles have a parent which is a Residue.
434  - All Residue particles have a parent which is a Chain.
435 
436  Waters are currently dropped if they are ATOM records. This can be fixed.
437 
438  The read_pdb() functions should successfully parse all valid PDB files. It
439  can produce warnings on files which are not valid. It will attempt to read
440  such files, but all bets are off.
441 
442  In order to track the provenance of IMP-generated models, the provenance
443  of any PDB files read in here - for example, the PDB id, or detail about
444  a comparative model - needs to also be tracked. This is done using the
445  PDB headers:
446  - Structures stored in the PDB database should keep the standard
447  `HEADER` record stating their PDB ID.
448  - Comparative models generated using MODELLER should include the
449  MODELLER-generated `EXPDTA` and `REMARK` records.
450  - Structures that are trivial modifications of an existing PDB structure
451  or comparative model should use the `TITLE` record to describe the
452  nature of the modification (e.g. rotation and translation) and one of
453  the two following custom `EXPDTA` record formats to point to the original
454  structure:
455  - `EXPDTA DERIVED FROM PDB:1XYZ`
456  - `EXPDTA DERIVED FROM COMPARATIVE MODEL, DOI:x.y/z`
457  - Structures generated from multiple sources (e.g. two structures that
458  have been docked and then concatenated into a single PDB file) are not
459  allowed. Store each constituent structure in its own file and annotate
460  each one with a suitable `EXPDTA` record, as above.
461  Note that while provenance of PDB files is not currently enforced, it
462  likely will be in future IMP releases.
463 
464  When reading PDBs, PDBSelector objects can be used to choose to only process
465  certain record types. See the class documentation for more information.
466  When no PDB selector is supplied for reading, the
467  NonWaterPDBSelector is used.
468 
469  Set the IMP::LogLevel to VERBOSE to see details of parse errors.
470 */
471 //!@{
472 
473 inline PDBSelector *get_default_pdb_selector() {
474  return new NonWaterPDBSelector();
475 }
476 
477 //! Read all the molecules in the first model of the PDB file.
478 /** \param[in] input The file or stream to read the model from.
479  \param[in] model The IMP::Model object to read into.
480  \param[in] selector A PDBSelector object used to read only
481  part of the model (e.g. only a single chain).
482  \param[in] select_first_model When reading a multi-model file (with
483  multiple MODEL/ENDMDL records) read only the first model if
484  set true. If set false, combine all models into a single
485  hierarchy (see read_multimodel_pdb to read each model into
486  a separate hierarchy).
487  \return a molecular hierarchy corresponding to the PDB model
488  */
489 IMPATOMEXPORT Hierarchy
490  read_pdb(TextInput input, Model *model,
491  PDBSelector *selector = get_default_pdb_selector(),
492  bool select_first_model = true
493 #ifndef IMP_DOXYGEN
494  ,
495  bool no_radii = false
496 #endif
497  );
498 
499 /** Rewrite the coordinates of the passed hierarchy based
500  on the contents of the first model in the PDB file.
501 
502  The hierarchy must have been created by reading from a PDB
503  file and the atom numbers must correspond between the files.
504  These are not really checked.
505 
506  A ValueException is thrown if there are insufficient models
507  in the file.
508 
509  core::RigidMember particles are handled by updating the
510  core::RigidBody algebra::ReferenceFrame3D to align with the
511  loaded particles. Bad things will happen if the loaded coordinates
512  are not a rigid transform of the prior coordinates.
513  */
514 IMPATOMEXPORT void read_pdb(TextInput input, int model, Hierarchy h);
515 
516 /** Read all models from the PDB file.
517  */
518 IMPATOMEXPORT Hierarchies
519  read_multimodel_pdb(TextInput input, Model *model,
520  PDBSelector *selector = get_default_pdb_selector()
521 #ifndef IMP_DOXYGEN
522  ,
523  bool noradii = false
524 #endif
525  );
526 
527 /** @name PDB Writing
528  \anchor pdb_out
529  The methods to write a PDB expects a Hierarchy that looks as follows:
530  - all leaves are Atom particles
531  - all Atom particles have Residue particles as parents
532 
533  All Residue particles that have a Chain particle as an ancestor
534  are considered part of a protein, DNA or RNA, ones without are
535  considered heterogens.
536 
537  The functions produce files that are not valid PDB files,
538  eg only ATOM/HETATM lines are printed for all Atom particles
539  in the hierarchy. Complain if your favorite program can't read them and
540  we might fix it.
541 */
542 //!@{
543 
544 /** Write some atoms to a PDB.
545 */
546 IMPATOMEXPORT void write_pdb(const Selection &mhd, TextOutput out,
547  unsigned int model = 1);
548 
549 /** \brief Write a hierarchy to a PDB as C_alpha atoms.
550 
551  This method is used to write a non-atomic hierarchy into a PDB in a way
552  that can be read by most programs. If the leaves are Residue particles
553  then the index and residue type will be read from them. Otherwise default
554  values will be used so that each leaf ends up in a separate residue.
555 */
556 IMPATOMEXPORT void write_pdb_of_c_alphas(const Selection &mhd,
557  TextOutput out,
558  unsigned int model = 1);
559 
560 /** Write the hierarchies one per frame.
561 */
562 IMPATOMEXPORT void write_multimodel_pdb(const Hierarchies &mhd,
563  TextOutput out);
564 /** @} */
565 
566 #ifndef IMP_DOXYGEN
567 
568 /**
569  This function returns a string in PDB ATOM format
570 */
571 IMPATOMEXPORT std::string get_pdb_string(
572  const algebra::Vector3D &v, int index = -1, AtomType at = AT_CA,
573  ResidueType rt = atom::ALA, char chain = ' ', int res_index = 1,
574  char res_icode = ' ', double occupancy = 1.00, double tempFactor = 0.00,
575  Element e = C);
576 
577 /**
578  This function returns a connectivity string in PDB format
579  \note The CONECT records specify connectivity between atoms for which
580  coordinates are supplied. The connectivity is described using
581  the atom serial number as found in the entry.
582  \note http://www.bmsc.washington.edu/CrystaLinks/man/pdb/guide2.2_frame.html
583 */
584 IMPATOMEXPORT std::string get_pdb_conect_record_string(int, int);
585 #endif
586 
587 /** \class WritePDBOptimizerState
588  This writes a PDB file at the specified interval during optimization.
589  If the file name contains %1% then a new file is written each time
590  with the %1% replaced by the index. Otherwise a new model is written
591  each time to the same file.
592 */
593 class IMPATOMEXPORT WritePDBOptimizerState : public OptimizerState {
594  std::string filename_;
595  ParticleIndexes pis_;
596 
597  public:
599  const ParticleIndexesAdaptor &pis,
600  std::string filename);
601  WritePDBOptimizerState(const atom::Hierarchies mh, std::string filename);
602 
603  protected:
604  virtual void do_update(unsigned int call) IMP_OVERRIDE;
607 };
608 
609 IMPATOM_END_NAMESPACE
610 
611 #endif /* IMPATOM_PDB_H */
Select non water and non hydrogen atoms.
Definition: pdb.h:245
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:422
ChainPDBSelector(const std::string &chains, std::string name="ChainPDBSelector%1%")
The chain id can be any character in chains.
Definition: pdb.h:204
Define the elements used in IMP.
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:56
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:218
Select all backbone (N,CA,C,O) ATOM records.
Definition: pdb.h:306
Select all non-water ATOM and HETATM records.
Definition: pdb.h:213
Select all P (= phosphate) ATOM records.
Definition: pdb.h:324
Select non hydrogen atoms.
Definition: pdb.h:267
const AtomType AT_CA
Select atoms which are selected by both selectors.
Definition: pdb.h:348
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:329
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Simple atom decorator.
Storage of a model, its restraints, constraints and particles.
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:118
Select all N ATOM records.
Definition: pdb.h:164
void write_pdb(const Selection &mhd, TextOutput out, unsigned int model=1)
virtual ModelObjectsTemp do_get_inputs() const
Handling of file input/output.
virtual void do_update(unsigned int)
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:169
Select all atoms in residues of the given types.
Definition: pdb.h:131
void read_pdb(TextInput input, int model, Hierarchy h)
A more IMP-like version of the std::vector.
Definition: Vector.h:40
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:399
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:69
Take Decorator, Particle or ParticleIndex.
Select all C (not CA or CB) ATOM records.
Definition: pdb.h:150
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:73
void write_pdb_of_c_alphas(const Selection &mhd, TextOutput out, unsigned int model=1)
Write a hierarchy to a PDB as C_alpha atoms.
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:191
Decorator for helping deal with a hierarchy of molecules.
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:82
Select all CB ATOM records.
Definition: pdb.h:91
Select all ATOM and HETATM records which are not alternatives.
Definition: pdb.h:51
Select all non-alternative ATOM records.
Definition: pdb.h:64
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:155
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:352
Common base class for heavy weight IMP objects.
Definition: Object.h:106
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:271
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:96
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:140
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:291
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:249
Select all atoms of the given types.
Definition: pdb.h:109
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
Defines a selector that will pick every ATOM and HETATM record.
Definition: pdb.h:178
Various important macros for implementing decorators.
Select atoms which are not selected by a given selector.
Definition: pdb.h:418
Hierarchies read_multimodel_pdb(TextInput input, Model *model, PDBSelector *selector=get_default_pdb_selector())
Object(std::string name)
Construct an object with the given name.
VectorD< 3 > Vector3D
Definition: VectorD.h:421
Shared optimizer state that is invoked upon commitment of new coordinates.
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:182
Select all non-water non-alternative ATOM and HETATM records.
Definition: pdb.h:287
Select atoms which are selected by either or both selectors.
Definition: pdb.h:371
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:311
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:375
Shared optimizer state.
void write_multimodel_pdb(const Hierarchies &mhd, TextOutput out)
bool get_is_selected(const std::string &pdb_line) const
Return true if the line should be processed.
Definition: pdb.h:237
Select all hydrogen ATOM and HETATM records.
Definition: pdb.h:230
Select all CA ATOM records.
Definition: pdb.h:77
Element
The various elements currently supported/known.
Definition: element.h:23
Select which atoms to read from a PDB file.
Definition: pdb.h:40
Select a subset of a hierarchy.
Select atoms which are selected by either selector but not both.
Definition: pdb.h:395
Select all ATOM and HETATM records with the given chain ids.
Definition: pdb.h:189
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.