Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
import_pose_options.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file core/import_pose/import_pose_options.cc
12 ///
13 /// @brief
14 /// @author Brian D. Weitzner brian.weitzner@gmail.com
15 
16 // Unit headers
19 
20 // Basic headers
21 #include <basic/options/option.hh>
22 #include <basic/options/keys/run.OptionKeys.gen.hh>
23 #include <basic/options/keys/in.OptionKeys.gen.hh>
24 #include <basic/options/keys/inout.OptionKeys.gen.hh>
25 #include <basic/options/keys/packing.OptionKeys.gen.hh>
26 
27 #include <basic/Tracer.hh>
28 
29 // Utility headers
30 #include <utility/tag/Tag.hh>
31 
32 // C++ headers
33 
34 namespace core {
35 namespace import_pose {
36 
37 basic::Tracer tr("core.import_pose.import_pose_options");
38 
39 
40 ///// ImportPoseOptionsCreator /////
42 
44 
45 basic::resource_manager::ResourceOptionsOP
47  return new ImportPoseOptions;
48 }
49 
50 ///@detail NOTE: This creator creates an options type called
51 ///'PoseFromPDBOptions' to make it consistent with
52 ///'PoseFromPDBLoader'.
55  return "PoseFromPDBOptions";
56 }
57 
58 
60 
62 
63 std::string ImportPoseOptions::type() const { return "ImportPoseOptions"; }
64 
66 {
68 
69  set_centroid( tag->getOption< bool >( "centroid", 0 ));
70  set_fold_tree_io( tag->getOption< bool >( "fold_tree_io", 0 ));
71  set_no_optH( tag->getOption< bool >( "no_optH", 0 ));
72  set_pack_missing_sidechains( tag->getOption< bool >( "pack_missing_sidechains", 1 ));
73  set_read_fold_tree( tag->getOption< bool >( "read_fold_tree", 0 ));
74  set_rna( tag->getOption< bool >( "rna", 0 ));
75  set_skip_set_reasonable_fold_tree_( tag->getOption< bool >( "skip_set_reasonable_fold_tree", 0 ));
76  set_residue_type_set( tag->getOption< std::string >( "residue_type_set", "fa_standard" ));
77 }
78 
79 // accessors
80 bool ImportPoseOptions::centroid() const { return centroid_; }
82 bool ImportPoseOptions::no_optH() const { return no_optH_; }
85 bool ImportPoseOptions::rna() const { return rna_; }
87 
89 
90 // mutators
93 void ImportPoseOptions::set_no_optH( bool no_optH ) { no_optH_ = no_optH; }
96 void ImportPoseOptions::set_rna( bool rna ) { rna_ = rna; }
98 
100 
101 
103 {
104  using namespace basic::options;
105  using namespace basic::options::OptionKeys;
106 
107  set_centroid( option[ in::file::centroid_input ]()
108  || option[ in::file::centroid ]()
109  || ( option[ in::file::fullatom ].user() && !option[ in::file::fullatom ]())
110  || ( option[ in::file::residue_type_set ].user() && option[ in::file::residue_type_set ]() == "centroid" ));
111 
112  // sanity check
113  if ( centroid() &&
114  ( option[ in::file::fullatom ]()
115  || ( option[ in::file::residue_type_set ].user() && option[ in::file::residue_type_set ]() == "fa_standard" ))) {
116  tr.Warning << "conflicting command line flags for centroid/full-atom input. Choosing fullatom!" << std::endl;
117  set_centroid( false );
118  }
119  set_fold_tree_io( option[ inout::fold_tree_io ].user());
120  set_no_optH( option[ packing::no_optH ]());
122  set_read_fold_tree( false ); // no option for this parameter - it can only be set to true if you call pose_from_pdd.
123  set_rna(option[ in::file::residue_type_set ].user() && option[ in::file::residue_type_set]() == "rna");
124  set_skip_set_reasonable_fold_tree_( option[ run::skip_set_reasonable_fold_tree ].value());
125 
126  set_residue_type_set( option[ in::file::residue_type_set ]());
127 }
128 
129 } // namespace import_pose
130 } // namespace core