Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PoseInfoFilter.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 sw=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 protocols/filters/PoseInfoFilter.cc
11 /// @brief Filter for looking at specific atom distances
12 /// @author Rocco Moretti (rmoretti@uw.edu)
13 
16 
17 // Project Headers
18 #include <core/types.hh>
19 #include <core/pose/Pose.hh>
20 #include <core/pose/PDBInfo.hh>
23 
24 #include <basic/datacache/BasicDataCache.hh>
25 #include <utility/tag/Tag.hh>
26 #include <basic/Tracer.hh>
27 
28 
29 namespace protocols {
30 namespace simple_filters {
31 
32 static basic::Tracer TR( "protocols.filters.PoseInfoFilter" );
33 
34 ///@brief default ctor
36  parent( "PoseInfo" )
37 {}
38 
39 /// @return Print pose information and return true
40 bool PoseInfoFilter::apply(core::pose::Pose const & pose ) const
41 {
42  compute( pose );
43  return true;
44 }
45 
48 {
49  report(TR, pose);
50  return 1.0;
51 }
52 
53 /// @return Print pose information and return true
56 {
57  compute( pose );
58  return( 1 );
59 }
60 
61 void PoseInfoFilter::report( std::ostream & out, core::pose::Pose const & pose ) const
62 {
63  out << "Pose Information: " << pose.total_residue() << " residues " << std::endl;
64  pose.pdb_info()->show( out );
65 
66  out << pose.fold_tree(); // Has implicit internal std::endl;
67  pose.fold_tree().show( out );
68 
69  {
71  out << "Cached Data: ";
72  core::pose::Pose::BasicDataCache const & datacache( pose.data() );
73  for ( core::Size ii(1); ii <= CacheableDataType::num_cacheable_data_types; ++ii ) {
74  if ( datacache.has( ii ) ) {
75  // Just output name here, as each datatype needs to be treated differently
76  // (Do it below, if necessary.)
77  out << CacheableDataType::get_name( static_cast<CacheableDataType::Enum>( ii ) ) << " ";
78  }
79  }
80  out << std::endl; // To flush the Cached data list.
81  }
82 
83  // Feel free to add additional pose-related information.
84  // The main reason I stopped where I did was I didn't necessarily know how to access relevant others.
85 }
86 
91  core::pose::Pose const & /*pose*/)
92 {
93  // Right now we don't have any options to control, so don't bother doing anything.
94 }
95 
98 
100 PoseInfoFilterCreator::keyname() const { return "PoseInfo"; }
101 
102 
103 
104 } // filters
105 } // protocols