src/cpsp/HPThreadingOptions.hh
Go to the documentation of this file.00001 /* 00002 * Main authors: 00003 * Martin Mann http://www.bioinf.uni-freiburg.de/~mmann/ 00004 * 00005 * Contributing authors: 00006 * Sebastian Will http://www.bioinf.uni-freiburg.de/~will/ 00007 * 00008 * Copyright: 00009 * Martin Mann, 2007 00010 * 00011 * This file is part of the CPSP-tools package: 00012 * http://www.bioinf.uni-freiburg.de/sw/cpsp/ 00013 * 00014 * See the file "LICENSE" for information on usage and 00015 * redistribution of this file, and for a 00016 * DISCLAIMER OF ALL WARRANTIES. 00017 * 00018 */ 00019 00020 #ifndef THREADINGOPTIONS_HH_ 00021 #define THREADINGOPTIONS_HH_ 00022 00023 #include "cpsp/Exception.hh" 00024 #include <biu/OptionParser.hh> 00025 #include <string> 00026 #include <map> 00027 #include <biu/LatticeDescriptor.hh> 00028 #include <biu/LatticeFrame.hh> 00029 #include "cpsp/HCoreDatabase.hh" 00030 00031 namespace cpsp 00032 { 00033 00034 class HPThreadingOptions 00035 { 00036 public: 00037 00039 enum CORESELECTS { FIRST, ALL_BEST, ALL }; // steuert kernauswahl 00040 00041 private: 00042 00045 void initAllowedArguments(biu::OptionMap & allowedArgs, 00046 std::string &infoText ) const; 00048 std::string* sequence; 00049 00051 const biu::LatticeDescriptor* latDescr; 00052 00054 biu::LatticeFrame* lattice; 00055 00057 CORESELECTS coreSelection; 00058 00060 int minE, maxE; 00061 00063 unsigned int maxSols; 00064 00068 std::vector<unsigned int> hullLvl; 00069 00072 unsigned int maxPCoreDistance; 00073 00075 HCoreDatabase* coreDB; 00076 00078 enum SeqFeatures{ P_SINGLET, H_SINGLET }; 00079 00080 typedef std::map< int, std::vector <unsigned int> > FeatureMap; 00081 00083 FeatureMap seqFeatureMap; 00084 00086 bool onlyCountingStructures; 00087 00089 bool verboseOutput; 00090 00092 unsigned int minEvenOddHs; 00093 00095 unsigned int contactsInSeq; 00096 00098 bool useSymmetryBreaking; 00099 00101 bool useNoDDS; 00102 00104 bool normalizeStructures; 00105 00106 public: 00110 HPThreadingOptions(int argc, char** argv) 00111 throw(cpsp::Exception); 00112 HPThreadingOptions(); 00113 00114 virtual ~HPThreadingOptions(); 00115 00116 00117 00118 00119 const std::string* const 00120 getSequence() const { return sequence; } 00121 unsigned int setSequence(const std::string &seq) throw(cpsp::Exception); 00122 00123 const bool 00124 getUseSymmetryBreaking() const { return useSymmetryBreaking; } 00125 void setUseSymmetryBreaking(bool val) { useSymmetryBreaking = val; } 00126 00127 const bool 00128 getUseNoDDS() const { return useNoDDS; } 00129 void setUseNoDDS(bool val) { useNoDDS = val; } 00130 00131 const biu::LatticeFrame* const 00132 getLattice() const { return lattice; } 00133 void setLattice(biu::LatticeFrame* lat) { lattice = lat; latDescr = lat->getDescriptor();} 00134 00135 const CORESELECTS 00136 getCoreSelection() const { return coreSelection; } 00137 void setCoreSelection(CORESELECTS cs) { coreSelection = cs; } 00138 00139 const int 00140 getMinimalEnergy() const { return minE; } 00141 void setMinimalEnergy(int val) { minE = val; } 00142 00143 const int 00144 getMaximalEnergy() const { return maxE; } 00145 void setMaximalEnergy(int val) { maxE = val;} 00146 00147 const unsigned int 00148 getMaximalSolutions() const { return maxSols; } 00149 void setMaximalSolutions(unsigned int val) { maxSols = val; } 00150 00151 const std::vector<unsigned int> *const 00152 getHullLevel() const { 00153 return &hullLvl; 00154 } 00155 00156 const unsigned int 00157 getMaxPCoreDistance() const { 00158 return maxPCoreDistance; 00159 } 00160 00161 void 00162 setLatticeFrameSize(const unsigned int newFrameSize) { 00163 assert(lattice != NULL); 00164 lattice->setFrameSize(newFrameSize); 00165 } 00166 00168 HCoreDatabase* 00169 getHCoreDB(void) { return coreDB; } 00170 void setHCoreDB(HCoreDatabase* db) {assert(db!=NULL); coreDB = db; } 00171 00173 unsigned int 00174 getNumOfPSinglets(void) { 00175 return seqFeatureMap[P_SINGLET].size(); 00176 } 00177 00179 unsigned int 00180 getNumOfHSinglets(void) { 00181 return seqFeatureMap[H_SINGLET].size(); 00182 } 00183 00185 std::vector <unsigned int>& 00186 getPSinglets(void) { 00187 return seqFeatureMap[P_SINGLET]; 00188 } 00189 00191 std::vector <unsigned int>& 00192 getHSinglets(void) { 00193 return seqFeatureMap[H_SINGLET]; 00194 } 00195 00197 bool 00198 countingMode(void) { return onlyCountingStructures; } 00199 bool countingMode(bool newVal) { onlyCountingStructures = newVal; return onlyCountingStructures; } 00200 00202 bool 00203 verboseOut(void) { return verboseOutput; } 00204 bool verboseOut(bool newVal) { verboseOutput = newVal; return verboseOutput; } 00205 00207 unsigned int 00208 getMinEvenOddHs(void) { return minEvenOddHs; } 00209 00211 unsigned int 00212 getContactsInSequence(void) { return contactsInSeq; } 00213 00215 void 00216 setNormalizeStructures( const bool val ) { normalizeStructures = val; } 00218 const bool 00219 getNormalizeStructures( void ) const { return normalizeStructures; } 00220 00221 }; 00222 00223 } // namespace cpsp 00224 00225 #endif /*THREADINGOPTIONS_HH_*/