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