Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
rna_suitename.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
11 /// @brief
12 
13 
14 // libRosetta headers
15 #include <core/types.hh>
16 #include <core/chemical/ChemicalManager.hh>
17 #include <basic/options/option.hh>
19 #include <protocols/viewer/viewers.hh>
20 #include <core/pose/Pose.hh>
21 #include <core/pose/rna/RNA_SuiteName.hh>
22 #include <core/pose/rna/util.hh>
23 #include <core/init/init.hh>
24 #include <core/import_pose/import_pose.hh>
25 #include <core/import_pose/pose_stream/PDBPoseInputStream.hh>
26 #include <utility/vector1.hh>
28 #include <protocols/farna/util.hh>
29 
30 // C++ headers
31 #include <iostream>
32 #include <string>
33 
34 // option key includes
35 #include <basic/options/keys/out.OptionKeys.gen.hh>
36 #include <basic/options/keys/in.OptionKeys.gen.hh>
37 #include <basic/options/keys/score.OptionKeys.gen.hh>
38 #include <basic/options/keys/full_model.OptionKeys.gen.hh>
39 
41 
42 using namespace core;
43 using namespace basic::options::OptionKeys;
44 using utility::vector1;
45 
46 ///////////////////////////////////////////////////////////////////////////////
47 void
49 {
50  using namespace basic::options;
51  using namespace basic::options::OptionKeys;
52  using namespace core::import_pose::pose_stream;
53  using namespace core::chemical;
54  using namespace core::pose::rna;
55  using namespace protocols::farna;
56 
57  ResidueTypeSetCOP rsd_set;
58  rsd_set = core::chemical::ChemicalManager::get_instance()->residue_type_set( FA_STANDARD );
59 
60  // input stream
61  PoseInputStreamOP input;
62  input = PoseInputStreamOP( new PDBPoseInputStream( option[ in::file::s ]() ) );
63 
64 
66  Size i( 0 );
67  RNA_SuiteName suitename;
68 
69  while ( input->has_another_pose() ) {
70  input->fill_pose( pose, *rsd_set );
71  i++;
72 
73  protocols::farna::ensure_phosphate_nomenclature_matches_mini( pose );
74  core::pose::rna::figure_out_reasonable_rna_fold_tree( pose );
75  core::pose::rna::virtualize_5prime_phosphates( pose ); // should we have this on by deafult?
76 
77  std::cout << "-----Pose " << i << "-----" << std::endl;
78  for ( Size j = 1; j <= pose.total_residue(); ++j ) {
79  RNA_SuiteAssignment assignment = suitename.assign(pose, j);
80  std::cout << "Residue " << j << ' ' << assignment.name << ' ' << std::setprecision(3) <<assignment.suiteness << std::endl;
81  }
82  }
83 
84 }
85 
86 
87 ///////////////////////////////////////////////////////////////
88 void*
89 my_main( void* )
90 {
91  rna_suitename();
92 
93  protocols::viewer::clear_conformation_viewers();
94  exit( 0 );
95 }
96 
97 
98 ///////////////////////////////////////////////////////////////////////////////
99 int
100 main( int argc, char * argv [] )
101 {
102  try {
103  using namespace basic::options;
104 
105  std::cout << std::endl << "Basic usage: " << argv[0] << " -s <pdb file> " << std::endl;
106  std::cout << std::endl << " Type -help for full slate of options." << std::endl << std::endl;
107 
108  option.add_relevant( in::file::s );
109 
110  ////////////////////////////////////////////////////////////////////////////
111  // setup
112  ////////////////////////////////////////////////////////////////////////////
113  core::init::init(argc, argv);
114 
115  ////////////////////////////////////////////////////////////////////////////
116  // end of setup
117  ////////////////////////////////////////////////////////////////////////////
118  protocols::viewer::viewer_main( my_main );
119  } catch ( utility::excn::EXCN_Base const & e ) {
120  std::cout << "caught exception " << e.msg() << std::endl;
121  return -1;
122  }
123 }
void rna_suitename()
virtual std::string const msg() const
Definition: EXCN_Base.hh:70
core::pose::Pose Pose
Definition: supercharge.cc:101
common derived classes for thrown exceptions
int main(int argc, char *argv[])
void * my_main(void *)
std::vector with 1-based indexing
Definition: vector1.fwd.hh:44
rule< Scanner, options_closure::context_t > options
Definition: Tag.cc:377
ocstream cout(std::cout)
Wrapper around std::cout.
Definition: ocstream.hh:287
BooleanOptionKey const exit("options:exit")
Definition: OptionKeys.hh:51
vector1: std::vector with 1-based indexing
void init()
set global 'init_was_called' to true
Definition: init.cc:26
Program options global and initialization function.
platform::Size Size
Definition: random.fwd.hh:30
rule< Scanner, option_closure::context_t > option
Definition: Tag.cc:378