Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PdbIdChunkFilter.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 protocols/frag_picker/VallChunkFilter.hh
11 /// @brief defines two basic chunk filters based on pdb id
12 /// @author Dominik Gront (dgront@chem.uw.edu.pl)
13 
14 
15 #ifndef INCLUDED_protocols_frag_picker_PdbIdChunkFilter_hh
16 #define INCLUDED_protocols_frag_picker_PdbIdChunkFilter_hh
17 
18 // package headers
21 
22 
23 // AUTO-REMOVED #include <string>
24 #include <map>
25 
26 #include <utility/vector1_bool.hh>
27 #include <iostream>
28 
29 
30 namespace protocols {
31 namespace frag_picker {
32 
34 public:
35  /// @brief Adds a pdb id to the filter.
36  /// @detailed What that PDB id means it depends on the filter implementation
37  void add_pdb_id(std::string pdb_ids) {
38 
39  pdb_hash_[pdb_ids] = true;
40  if(pdb_ids.size() > 4) {
41  if((pdb_ids[4]=='A') || (pdb_ids[4]=='a'))
42  pdb_hash_[ pdb_ids.replace(4,1,1,'_') ] = true;
43  if(pdb_ids[4]=='_')
44  pdb_hash_[ pdb_ids.replace(4,1,1,'A') ] = true;
45  }
46  }
47 
48  /// @brief Adds a bunch of pdb ids to the filter
50 
51  for (Size i = 1; i <= list_of_pdb_ids.size(); i++) {
52  pdb_hash_[list_of_pdb_ids[i]] = true;
53  std::string & pdb_ids = list_of_pdb_ids[i];
54  if(pdb_ids.size() > 4) {
55  if((pdb_ids[4]=='A') || (pdb_ids[4]=='a'))
56  pdb_hash_[ pdb_ids.replace(4,1,1,'_') ] = true;
57  if(pdb_ids[4]=='_')
58  pdb_hash_[ pdb_ids.replace(4,1,1,'A') ] = true;
59  }
60  }
61  }
62 
64 
65  void show_pdb_ids(std::ostream& out);
66 
67 protected:
68  std::map<std::string, bool> pdb_hash_;
69 };
70 
71 /// @brief Accepts a chunk based on the pdb id of the source protein
72 /// @detailed If a given chunk comes from a registered pdb file then it will PASS the test.
73 /// Otherwise it will be rejected
75 public:
76 
77  /// @brief say if a given chunk looks promising.
78  /// @detailed Simply if its pdb id is on a list then it will pass the test
79  bool test_chunk(VallChunkOP a_chunk);
80 };
81 
82 /// @brief Denies a chunk based on the pdb id of the source protein
83 /// @detailed If a given chunk comes from a registered pdb file then it will FAIL the test.
84 /// Otherwise it will be accepted
86 public:
87 
88  /// @brief say if a given chunk looks promising.
89  /// @detailed Simply if its pdb id is on a list then it will be rejected
90  bool test_chunk(VallChunkOP a_chunk);
91 };
92 
93 } // frag_picker
94 } // protocols
95 
96 
97 #endif /* INCLUDED_protocols_frag_picker_PdbIdChunkFilter_HH */