Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
mp_viewer.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file apps/pilot/membrane/mp_viewer.cc
11 ///
12 /// @brief RosettaMP Real time visualization of membrane proteins
13 /// @details Use the PyMOL viewer to visualize the membrane planes based on position
14 ///
15 /// @author Rebecca Faye Alford (rfalford12@gmail.com)
16 /// @author Julia Koehler Leman (julia.koehler1982@gmail.com)
17 /// @note Last Updated: 5/18/15
18 
19 // Unit Headers
20 #include <devel/init.hh>
21 
22 // Package Headers
23 #include <protocols/membrane/AddMembraneMover.hh>
24 #include <protocols/membrane/MembranePositionFromTopologyMover.hh>
25 
26 #include <core/conformation/Conformation.hh>
27 #include <core/conformation/membrane/MembraneInfo.hh>
28 
29 #include <protocols/moves/PyMolMover.hh>
30 #include <protocols/jd2/JobDistributor.hh>
31 #include <protocols/jd2/util.hh>
32 
33 #include <protocols/moves/Mover.hh>
34 
35 #include <core/pose/Pose.hh>
36 #include <core/types.hh>
37 
38 // Utility Headers
40 
41 #include <utility/vector1.hh>
43 
44 #include <basic/options/keys/mp.OptionKeys.gen.hh>
45 #include <basic/options/option.hh>
46 
47 // C++ headers
48 #include <iostream>
49 #include <cstdlib>
50 
51 using namespace protocols::moves;
52 
53 /// @brief Quick Container Mover: Visualize Membrane Protein Using the PyMol Viewer
54 class ViewMembraneProteinMover : public Mover {
55 
56 public:
57 
58  /// @brief Default Constructor
60  Mover() {}
61 
62  /// @brief Get Mover Name
63  std::string get_name() const { return "ViewMembraneProteinMover"; }
64 
65  /// @brief Setup the Membrane Framework. Flags should take care of the rest
66  /// of visualization
67  void apply( Pose & pose ) {
68 
69  using namespace basic::options;
70  using namespace protocols::membrane;
71  using namespace protocols::moves;
72 
73  // Add Membrane
74  AddMembraneMoverOP add_memb( new AddMembraneMover() );
75  add_memb->apply( pose );
76 
77  // Send a set of viewable planes to pymol
78  PyMolMoverOP pymol_mover( new PyMolMover() );
79  pymol_mover->apply( pose );
80 
81  if ( option[ OptionKeys::mp::setup::position_from_topo ].user() ) {
82 
83  // Initialize Membrane
84  MembranePositionFromTopologyMoverOP init_memb( new MembranePositionFromTopologyMover() );
85  init_memb->apply( pose );
86  }
87  }
88 };
89 
90 // Hook Mover into Rosetta
91 typedef utility::pointer::shared_ptr< ViewMembraneProteinMover > ViewMembraneProteinMoverOP;
92 typedef utility::pointer::shared_ptr< ViewMembraneProteinMover const > ViewMembraneProteinMoverCOP;
93 
94 /// @brief Main method
95 int
96 main( int argc, char * argv [] )
97 {
98  try {
99 
100  devel::init(argc, argv);
101 
102  using namespace protocols::moves;
103  using namespace protocols::membrane;
104 
106 
107  // Create and kick off a new load membrane mover
109  protocols::jd2::JobDistributor::get_instance()->go( view_memb );
110 
111  return 0;
112 
113  } catch ( utility::excn::EXCN_Base const & e ) {
114  std::cout << "caught exception " << e.msg() << std::endl;
115  return -1;
116  }
117 }
virtual std::string const msg() const
Definition: EXCN_Base.hh:70
void register_options()
void apply(Pose &pose)
Setup the Membrane Framework. Flags should take care of the rest of visualization.
Definition: mp_viewer.cc:67
Non-owning access smart pointer – dispatch class.
void init(int argc, char *argv[])
Command line init() version.
Definition: init.cc:23
ViewMembraneProteinMover()
Default Constructor.
Definition: mp_viewer.cc:59
BooleanOptionKey const user("options:user")
Definition: OptionKeys.hh:40
core::pose::Pose Pose
Definition: supercharge.cc:101
Quick Container Mover: Visualize Membrane Protein Using the PyMol Viewer.
Definition: mp_viewer.cc:54
common derived classes for thrown exceptions
utility::pointer::shared_ptr< ViewMembraneProteinMover const > ViewMembraneProteinMoverCOP
Definition: mp_viewer.cc:92
int main(int argc, char *argv[])
Main method.
Definition: mp_viewer.cc:96
rule< Scanner, options_closure::context_t > options
Definition: Tag.cc:377
std::string get_name() const
Get Mover Name.
Definition: mp_viewer.cc:63
ocstream cout(std::cout)
Wrapper around std::cout.
Definition: ocstream.hh:287
vector1: std::vector with 1-based indexing
Program options global and initialization function.
utility::pointer::shared_ptr< ViewMembraneProteinMover > ViewMembraneProteinMoverOP
Definition: mp_viewer.cc:91
rule< Scanner, option_closure::context_t > option
Definition: Tag.cc:378