00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef OPENMS_CHEMISTRY_TRYPTICITERATOR_H
00028 #define OPENMS_CHEMISTRY_TRYPTICITERATOR_H
00029
00030 #include <OpenMS/CHEMISTRY/PepIterator.h>
00031 #include <OpenMS/CONCEPT/Exception.h>
00032 #include <vector>
00033
00034 namespace OpenMS {
00039 class TrypticIterator : public PepIterator
00040 {
00041
00042 public:
00043
00044 typedef std::pair<String,String> FASTAEntry;
00048 TrypticIterator();
00052 TrypticIterator (const TrypticIterator &);
00056 virtual ~TrypticIterator ();
00057
00063 virtual FASTAEntry operator*() throw (Exception::InvalidIterator);
00064
00070 virtual PepIterator & operator++() throw (Exception::InvalidIterator);
00071
00077 virtual PepIterator * operator++(int i) throw (Exception::InvalidIterator);
00078
00084 virtual void setFastaFile (const String & f) throw (Exception::FileNotFound);
00085
00090 virtual String getFastaFile();
00091
00096 virtual void setTolerance (float) throw (Exception::InvalidValue, Exception::NotImplemented)
00097 {
00098 throw Exception::NotImplemented(__FILE__, __LINE__, __PRETTY_FUNCTION__);
00099 };
00100
00106 virtual float getTolerance () throw (Exception::InvalidValue, Exception::NotImplemented)
00107 {
00108 throw Exception::NotImplemented(__FILE__, __LINE__, __PRETTY_FUNCTION__);
00109 };
00110
00115 virtual void setSpectrum (const std::vector<float> & ) throw (Exception::InvalidValue, Exception::NotImplemented)
00116 {
00117 throw Exception::NotImplemented(__FILE__, __LINE__, __PRETTY_FUNCTION__);
00118 };
00119
00125 virtual const std::vector<float> & getSpectrum () throw (Exception::InvalidValue, Exception::NotImplemented)
00126 {
00127 throw Exception::NotImplemented(__FILE__, __LINE__, __PRETTY_FUNCTION__);
00128 };
00129
00134 virtual bool begin () throw (Exception::InvalidIterator);
00135
00141 virtual bool isAtEnd ();
00142
00147 virtual bool isDigestingEnd (char aa1, char aa2);
00148
00153 static const std::string getName()
00154 {
00155 return "TrypticIterator";
00156 }
00157
00162 static PepIterator* create()
00163 {
00164 return new TrypticIterator;
00165 }
00166
00167
00168
00169 protected:
00174 virtual std::string next_ ();
00175
00180 bool hasNext_();
00181
00185 void goToNextAA_ ();
00186
00187 String f_file_;
00188
00189 std::string actual_pep_;
00190
00191 bool is_at_end_;
00192
00193 PepIterator* f_iterator_;
00194
00195 FASTAEntry f_entry_;
00196
00197 unsigned int b_,e_;
00198
00199
00200
00201 };
00202
00203 }
00204 #endif //OPENMS_CHEMISTRY_EDWARDSLIPPERTITERATOR_H