ex_define_rotamer

ex_define_rotamer prints rotamer type (M-P-T code) for each amino acid residue in the input PDB structure

USAGE:
ex_define_rotamer 5edw.pdb

Keywords:

Categories:

  • core::chemical::ChiAnglesDefinition; core::data::structural::ResidueHasAllHeavyAtoms

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
36
37
38
39
40
41
42
43
#include <iostream>
#include <iomanip>
#include <core/data/io/Pdb.hh>
#include <core/calc/structural/protein_angles.hh>
#include <core/chemical/ChiAnglesDefinition.hh>
#include <utils/exit.hh>
#include <core/data/structural/structure_selectors.hh>

std::string program_info = R"(

ex_define_rotamer prints rotamer type (M-P-T code) for each amino acid
residue in the input PDB structure
USAGE:
    ex_define_rotamer 5edw.pdb

)";
/** @brief Prints rotamer type (M-P-T code) for each amino acid residue in the input PDB structure
 *
 * CATEGORIES: core::chemical::ChiAnglesDefinition; core::data::structural::ResidueHasAllHeavyAtoms
 * KEYWORDS:   PDB input; Rotamer; M-P-T type; structure selectors
 */
int main(const int argc, const char *argv[]) {

  if (argc < 2) utils::exit_OK_with_message(program_info); // --- complain about missing program parameter

  using namespace core::data::io;
  using namespace core::data::structural;

  Pdb reader(argv[1]); // file name (PDB format, may be gzip-ped)
  Structure_SP strctr = reader.create_structure(0);
  ResidueHasAllHeavyAtoms has_full_sc;
  IsAA is_aa;
  // Iterate over all residues
  for (auto ires = strctr->first_residue(); ires != strctr->last_residue(); ++ires) {
    core::data::structural::Residue &res_sp = (**ires);
    if (!is_aa(res_sp)) continue;
    std::cout << std::setw(4) << res_sp.id() << " " << res_sp.residue_type().code3 << " "
              << core::chemical::ChiAnglesDefinition::count_chi_angles(res_sp.residue_type());
    if (has_full_sc(res_sp)) std::cout << std::setw(5) << core::calc::structural::define_rotamer(res_sp);
    else std::cout << " incomplete";
    std::cout << "\n";
  }
}
../_images/file_icon.png