IMP
2.0.1
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
pdb_rmf.cpp
1
/**
2
* Copyright 2007-2013 IMP Inventors. All rights reserved.
3
*/
4
#include <
IMP/rmf/atom_io.h
>
5
#include <RMF/FileHandle.h>
6
#include <
IMP/base/flags.h
>
7
#include <
IMP/atom/pdb.h
>
8
#include <
IMP/rmf/frames.h
>
9
#include <
IMP/atom/force_fields.h
>
10
11
int
main(
int
argc,
char
**argv) {
12
try
{
13
IMP::Strings
files
14
=
IMP::base::setup_from_argv
(argc, argv,
"Add color to an RMF file"
,
15
"input.pdb output.rmf"
, 2);
16
IMP_NEW
(
IMP::Model
, m, ());
17
IMP::atom::Hierarchy
h =
IMP::atom::read_pdb
(files[0], m);
18
IMP::atom::add_bonds
(h);
19
RMF::FileHandle out = RMF::create_rmf_file(files[1]);
20
21
IMP::rmf::add_hierarchy
(out, h);
22
IMP::rmf::save_frame
(out, 0);
23
}
catch
(
const
IMP::base::Exception
&e) {
24
std::cerr <<
"Error: "
<< e.what() << std::endl;
25
return
1;
26
}
catch
(
const
std::exception &e) {
27
std::cerr <<
"Error: "
<< e.what() << std::endl;
28
}
29
return
0;
30
}