Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
util.hh
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 core/fragment/picking_old/vall/util.hh
11 /// @brief utility functions for interacting with VallLibrary
12 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
13 
14 #ifndef INCLUDED_core_fragment_picking_old_vall_util_hh
15 #define INCLUDED_core_fragment_picking_old_vall_util_hh
16 
17 // project headers
20 
21 #include <utility/vector1.hh>
22 
23 
24 // C++ headers
25 
26 
27 namespace core {
28 namespace fragment {
29 namespace picking_old {
30 namespace vall {
31 
32 
33 /// @brief convert a fragment extent to a FragData instance
34 /// @param[in] begin Iterator pointing the beginning of the VallResidue extent.
35 /// @param[in] end Iterator pointing just past the end of the VallResidue extent.
36 /// @param[in] srfd_type The type of BBTorsionSRFD to use.
37 template< typename VallResidueIterator >
39  VallResidueIterator begin,
40  VallResidueIterator end,
41  BBTorsionSRFD const & srfd_type = BBTorsionSRFD()
42 ) {
43  AnnotatedFragDataOP fragdata = new AnnotatedFragData( begin->id(), begin->resi() );
44 
45  for ( VallResidueIterator r = begin; r != end; ++r ) {
46  fragdata->add_residue( r->bbtorsion_srfd( srfd_type ) );
47  }
48 
49  if ( fragdata->size() > 0 ) {
50  fragdata->set_valid();
51  }
52 
53  return fragdata;
54 }
55 
56 
57 /// @brief extract amino acid sequence from a fragment extent into a string
58 template< typename VallResidueIterator >
59 std::string extent_aa_str( VallResidueIterator begin, VallResidueIterator end ) {
60  std::string aa_str;
61 
62  for ( VallResidueIterator r = begin; r != end; ++r ) {
63  aa_str.push_back( r->aa() );
64  }
65 
66  return aa_str;
67 }
68 
69 
70 /// @brief extract secondary structure from a fragment extent into a string
71 template< typename VallResidueIterator >
72 std::string extent_ss_str( VallResidueIterator begin, VallResidueIterator end ) {
73  std::string ss_str;
74 
75  for ( VallResidueIterator r = begin; r != end; ++r ) {
76  ss_str.push_back( r->ss() );
77  }
78 
79  return ss_str;
80 }
81 
82 
83 /// @brief pick fragments by default sec.struct IdentityScore
84 /// @param[in] ss secondary structure string of desired frag length
85 /// @param[in] top_n return the top 'n' fragments, default 200
86 /// @param[in] randomize add random noise within [0, 0.001) to
87 /// @param[in] srfd_type The BBTorsionSRFD type to use.
88 /// score to break up equivalent scores
91  std::string const & ss,
92  core::Size const top_n,
93  bool const randomize = true,
94  BBTorsionSRFD const & srfd_type = BBTorsionSRFD()
95 );
96 
97 
98 /// @brief pick fragments by default sec.struct IdentityScore
99 /// @param[in] ss secondary structure string of desired frag length
100 /// @param[in] aa amino acid string of same length as ss string
101 /// @param[in] top_n return the top 'n' fragments, default 200
102 /// @param[in] randomize add random noise within [0, 0.001) to
103 /// @param[in] srfd_type The BBTorsionSRFD type to use.
104 /// score to break up equivalent scores
107  std::string const & ss,
108  std::string const & aa,
109  core::Size const top_n,
110  bool const randomize = true,
111  BBTorsionSRFD const & srfd_type = BBTorsionSRFD()
112 );
113 
114 
115 /// @brief pick fragments by default sec.struct IdentityScore
116 /// @param[in] ss secondary structure string of desired frag length
117 /// @param[in] aa amino acid string of same length as ss string
118 /// @param[in] abego vector of string of desired frag length
119 /// @param[in] top_n return the top 'n' fragments, default 200
120 /// @param[in] randomize add random noise within [0, 0.001) to
121 /// @param[in] srfd_type The BBTorsionSRFD type to use.
122 /// score to break up equivalent scores
125  std::string const & ss,
126  std::string const & aa,
128  core::Size const top_n = 200,
129  bool const randomize = true,
130  BBTorsionSRFD const & srfd_type = BBTorsionSRFD()
131 );
132 
133 
134 
135 } // vall
136 } // picking_old
137 } // fragment
138 } // core
139 
140 
141 #endif /* INCLUDED_core_fragment_picking_old_vall_util_HH */