ex_Remark290

ex_Pdb demo shows how to access symmetry operators stored in a PDB file header.

The program reads a given PDB file and prints all cymmetry operators as rototranslation objects

USAGE:
ex_Remark290 5edw.pdb

Categories:

  • core/data/io/Pdb

Input files:

Output files:

Program source:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <core/data/io/Pdb.hh>
#include <utils/exit.hh>

std::string program_info = R"(

ex_Pdb demo shows how to access symmetry operators stored in a PDB file header.

The program reads a given PDB file and prints all cymmetry operators as rototranslation objects

USAGE:
    ex_Remark290 5edw.pdb

)";

/** @brief ex_Remark290 demo shows how to access symmetry operators stored in a PDB file header.
 *
 * CATEGORIES: core/data/io/Pdb;
 * KEYWORDS:   PDB input; PDB line filter; Structure
 */
int main(const int argc, const char* argv[]) {

  if(argc < 2) utils::exit_OK_with_message(program_info); // --- complain about missing program parameter
  for (int i = 1; i < argc; ++i) {
    core::data::io::Pdb reader(argv[i], // file name (PDB format, may be gzip-ped)
      core::data::io::is_bb,            // a predicate to read only the ATOM lines corresponding to backbone atoms
      true);                            // parse PDB header

    std::shared_ptr<core::data::io::Remark290> r290 = reader.symmetry_operators();
    std::cout << "# Symmetry operators found: " << r290->count_operators() << "\n";
    for (const auto &rt: *r290) {
      std::cout << rt << "\n";
    }
  }
}
../_images/file_icon.png