File: example.cpp

package info (click to toggle)
libpdb-redo 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,776 kB
  • sloc: cpp: 8,744; sh: 15; makefile: 8
file content (38 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (2)
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
// Simple example showing the use of libpdb-redo to calculate density statistics

#include <filesystem>

#include <pdb-redo/Statistics.hpp>
#include <pdb-redo/BondMap.hpp>
#include <cif++.hpp>

namespace fs = std::filesystem;

int main()
{
	// a sample structure file, lets use 1CBS
	const fs::path example("1cbs.cif.gz");

	// load the mmCIF
	cif::file file(example);

	// and load this into a structure (note, structure caches data from the file, so order is important)
	cif::mm::structure structure(file);

	// now create the maps based on the MTZ file
	pdb_redo::MapMaker<float> mm;
	float samplingRate = 0.75;
	mm.loadMTZ("1cbs_map.mtz", samplingRate);

	// and finally collect the statistics
	pdb_redo::EDIAStatsCollector collector(mm, structure, false);
	auto r = collector.collect();

	for (auto& ri: r)
	{
		// and do something with the data
		std::cout << ri.EDIAm << '\n';
	}

	return 0;
}