ap_local_backbone_geometry

Program reads a protein structure (PDB format) and calculates local backbone properties: distances, angles, etc.

The list of requested properties should follow the PDB innput file name. If no properties are listed at command line, the program calculates all known properties.

USAGE:
./ap_local_backbone_geometry input.pdb property1 property2 ...
EXAMPLE:
./ap_local_backbone_geometry 2gb1.pdb PHI PSI OMEGA
./ap_local_backbone_geometry 2gb1.pdb

Known properties

Categories:

  • core::calc::structural::LocalBackbonePropertyDef

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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
#include <core/data/io/Pdb.hh>
#include <core/calc/structural/local_backbone_geometry.hh>
#include <utils/exit.hh>

std::string program_info = R"(

Program reads a protein structure (PDB format) and calculates local backbone properties: distances, angles, etc.

The list of requested properties should follow the PDB innput file name. If no properties are listed at command line,
the program calculates all known properties.

USAGE:
    ./ap_local_backbone_geometry input.pdb property1 property2 ...
EXAMPLE:
    ./ap_local_backbone_geometry 2gb1.pdb PHI PSI OMEGA
    ./ap_local_backbone_geometry 2gb1.pdb

Known properties:
)";

/** @brief Reads a protein structure in PDB format and describes geometry local
 *
 * CATEGORIES: core::calc::structural::LocalBackbonePropertyDef
 * KEYWORDS:   PDB input; structure properties; structure validation
 */
int main(const int argc, const char *argv[]) {

// --- If no arguments - print help message which lists all the local properties implemented in BioShell
  if (argc < 2) {
    for (auto p : core::calc::structural::all_known_local_properties)
      program_info +=
        "\t" + core::calc::structural::LocalBackbonePropertyDef::property_definitions.at(p).enum_name + "\n";
    utils::exit_OK_with_message(program_info);
  }

  using namespace core::calc::structural;
  using namespace core::data::io;
  core::data::io::Pdb reader(argv[1],all_true(is_not_alternative,is_not_water), true);
  core::data::structural::Structure_SP strctr = reader.create_structure(0);

  if (argc > 2) { // --- process the list of local features requested from command line
    std::vector<core::calc::structural::LocalBackboneProperties> what_to_calc;
    for (int i = 2; i < argc; ++i)
      what_to_calc.push_back(core::calc::structural::LocalBackbonePropertyDef::property_by_name(argv[i]));
    std::cout << header_string(what_to_calc) << "\n";
    for (const auto &chain_sp : *strctr) {
      for (core::index2 i = 0; i < chain_sp->size() - 5; ++i)
        std::cout << to_string(*chain_sp, i, what_to_calc) << "\n";
    }
  } else {
    std::cout << header_string(all_known_local_properties) << "\n";
    for (const auto &chain_sp : *strctr) {
      for (core::index2 i = 0; i < chain_sp->size() - 5; ++i)
        std::cout << to_string(*chain_sp, i, all_known_local_properties) << "\n";
    }
  }
}
../_images/file_icon.png