ap_ProteinArchitecture

ap_ProteinArchitecture 5edw.pdb

Categories:

  • core/calc/structural/ProteinArchitecture

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
#include <iostream>
#include <iomanip>

#include <core/data/io/Pdb.hh>
#include <core/data/structural/Structure.hh>
#include <core/calc/structural/ProteinArchitecture.hh>
#include <utils/exit.hh>
#include <utils/LogManager.hh>

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

std::string program_info = R"(

    ap_ProteinArchitecture 5edw.pdb

)";

/** @brief Calculates a map of backbone hydrogen bonds.
 *
 * ProteinArchitecture
 *
 * CATEGORIES: core/calc/structural/ProteinArchitecture;
 * KEYWORDS:   PDB input; Hydrogen bonds; Protein structure features
 */
int main(const int argc, const char* argv[]) {

  using namespace core::calc::structural;

  if(argc < 2) utils::exit_OK_with_message(program_info); // --- complain about missing program parameter
  core::data::io::Pdb reader(argv[1], core::data::io::all_true(is_not_alternative, is_not_water), true); // --- Read in a PDB file
  Structure_SP strctr = reader.create_structure(0); // --- create a Structure object from the first model

  core::calc::structural::ProteinArchitecture pa(*strctr);
  std::cout <<"# ---------- Secondary structure elements ----------\n";
  for (const auto sse : pa.sse_vector())
    std::cout << *sse << "\n";

  std::cout <<"# ---------- Beta strand connectivity ----------\n";
  auto sse_graph = pa.create_strand_graph();
  for(auto e_it = sse_graph->cbegin_strand();e_it!=sse_graph->cend_strand();++e_it) {
    std::cout << (*e_it)->info()<<" paired with:\n";
    for(auto partner_it = sse_graph->cbegin_strand(*e_it); partner_it != sse_graph->cend_strand(*e_it); ++partner_it) {
      auto pairing_sp = sse_graph->get_strand_pairing(*e_it, *partner_it);
      std::cout << "\t" << (*partner_it)->name() << " " << Strand::strand_type_name(pairing_sp->pairing_type)
                << " by " << pairing_sp->hydrogen_bonds().size() << "hbonds\n";
    }
  }
}

../_images/file_icon.png