#include <OpenMS/DATASTRUCTURES/SuffixArraySeqan.h>
This class uses SEQAN suffix array. It can just be used for finding peptide Candidates for a given MS Spectrum within a certain mass tolerance. The suffix array can be saved to disc for reused so it has to be build just once.
Public Member Functions | |
SuffixArraySeqan (const String &st, const String &sa_file_name) throw (Exception::InvalidValue,Exception::FileNotFound) | |
constructor | |
SuffixArraySeqan (const SuffixArraySeqan &source) | |
copy constructor | |
virtual | ~SuffixArraySeqan () |
destructor | |
String | toString () |
converts suffix array to a printable string | |
void | findSpec (std::vector< std::vector< std::pair< std::pair< int, int >, float > > > &candidates, const std::vector< double > &spec) throw (Exception::InvalidValue) |
the function that will find all peptide candidates for a given spectrum | |
bool | save (const String &file_name) throw (Exception::UnableToCreateFile) |
saves the suffix array to disc | |
bool | open (const String &file_name) throw (Exception::FileNotFound) |
opens the suffix array | |
void | setTolerance (double t) throw (Exception::InvalidValue) |
setter for tolerance | |
double | getTolerance () const |
getter for tolerance | |
bool | isDigestingEnd (const char aa1, const char aa2) const |
returns if an enzyme will cut after first character | |
void | setTags (const std::vector< OpenMS::String > &tags) throw (OpenMS::Exception::InvalidValue) |
setter for tags | |
const std::vector < OpenMS::String > & | getTags () |
getter for tags | |
void | setUseTags (bool use_tags) |
setter for use_tags | |
bool | getUseTags () |
getter for use_tags | |
void | setNumberOfModifications (unsigned int number_of_mods) |
setter for number of modifications | |
unsigned int | getNumberOfModifications () |
getter for number of modifications | |
template<typename TIndex, typename TSpec> | |
void | goNextSubTree (seqan::Iter< TIndex, seqan::VSTree< seqan::TopDown< seqan::ParentLinks< TSpec > > > > &it, double &m, std::stack< double > &allm, std::stack< std::map< double, int > > &mod_map) |
overwriting goNextSubTree from seqan index_esa_stree.h for mass update during suffix array traversal | |
template<typename TIndex, typename TSpec> | |
void | goNextSubTree (seqan::Iter< TIndex, seqan::VSTree< seqan::TopDown< seqan::ParentLinks< TSpec > > > > &it) |
goes to the next sub tree | |
template<typename TIndex, typename TSpec> | |
void | goNext (seqan::Iter< TIndex, seqan::VSTree< seqan::TopDown< seqan::ParentLinks< TSpec > > > > &it, double &m, std::stack< double > &allm, std::stack< std::map< double, int > > &mod_map) |
overwriting goNext from seqan index_esa_stree.h for mass update during suffix array traversal | |
template<typename TIndex, typename TSpec> | |
void | parseTree (seqan::Iter< TIndex, seqan::VSTree< seqan::TopDown< seqan::ParentLinks< TSpec > > > > &it, std::vector< std::pair< int, int > > &out_number, std::vector< std::pair< int, int > > &edge_length, std::vector< int > &leafe_depth) |
void | printStatistic () |
output for statistic | |
Protected Member Functions | |
int | findFirst_ (const std::vector< double > &spec, double &m) |
binary search for finding the index of the first element of the spectrum that matches the desired mass within the tolerance. | |
int | findFirst_ (const std::vector< double > &spec, double &m, int start, int end) |
binary search for finding the index of the first element of the spectrum that matches the desired mass within the tolerance. it searches recursivly. | |
Protected Attributes | |
TIndex | index_ |
seqan suffix array | |
seqan::Iter< TIndex, seqan::VSTree< seqan::TopDown < seqan::ParentLinks < seqan::Preorder > > > > * | it_ |
seqan suffix array iterator | |
const String & | s_ |
reference to strings for which the suffix array is build | |
double | masse_ [255] |
amino acid masses | |
int | number_of_modifications_ |
number of allowed modifications | |
std::vector< String > | tags_ |
all tags | |
bool | use_tags_ |
if tags are used | |
double | tol_ |
tolerance | |
Private Types | |
typedef seqan::Index < seqan::String< char >, seqan::Index_ESA<> > | TIndex |
typedef seqan::Index<seqan::String<char>, seqan::Index_ESA<> > TIndex [private] |
SuffixArraySeqan | ( | const String & | st, | |
const String & | sa_file_name | |||
) | throw (Exception::InvalidValue,Exception::FileNotFound) |
constructor
st | const string reference with the string for which the suffix array should be build | |
saFileName | const string reference with filename for opening or saving the suffix array |
SuffixArraySeqan | ( | const SuffixArraySeqan & | source | ) |
copy constructor
virtual ~SuffixArraySeqan | ( | ) | [virtual] |
destructor
String toString | ( | ) | [virtual] |
void findSpec | ( | std::vector< std::vector< std::pair< std::pair< int, int >, float > > > & | candidates, | |
const std::vector< double > & | spec | |||
) | throw (Exception::InvalidValue) [virtual] |
the function that will find all peptide candidates for a given spectrum
spec | const reference of double vector describing the spectrum |
Implements SuffixArray.
bool save | ( | const String & | file_name | ) | throw (Exception::UnableToCreateFile) [virtual] |
saves the suffix array to disc
filename | const reference string describing the filename |
Implements SuffixArray.
bool open | ( | const String & | file_name | ) | throw (Exception::FileNotFound) [virtual] |
opens the suffix array
filename | const reference string describing the filename |
Implements SuffixArray.
void setTolerance | ( | double | t | ) | throw (Exception::InvalidValue) [virtual] |
double getTolerance | ( | ) | const [virtual] |
bool isDigestingEnd | ( | const char | aa1, | |
const char | aa2 | |||
) | const [virtual] |
returns if an enzyme will cut after first character
aa1 | const char as first aminoacid | |
aa2 | const char as second aminoacid |
Implements SuffixArray.
Reimplemented in SuffixArrayTrypticSeqan.
void setTags | ( | const std::vector< OpenMS::String > & | tags | ) | throw (OpenMS::Exception::InvalidValue) [virtual] |
setter for tags
tags | reference to vector of strings with tags |
Implements SuffixArray.
const std::vector<OpenMS::String>& getTags | ( | ) | [virtual] |
void setUseTags | ( | bool | use_tags | ) | [virtual] |
setter for use_tags
use_tags | indicating whether tags should be used or not |
Implements SuffixArray.
bool getUseTags | ( | ) | [virtual] |
void setNumberOfModifications | ( | unsigned int | number_of_mods | ) | [virtual] |
unsigned int getNumberOfModifications | ( | ) | [virtual] |
void goNextSubTree | ( | seqan::Iter< TIndex, seqan::VSTree< seqan::TopDown< seqan::ParentLinks< TSpec > > > > & | it, | |
double & | m, | |||
std::stack< double > & | allm, | |||
std::stack< std::map< double, int > > & | mod_map | |||
) | [inline] |
overwriting goNextSubTree from seqan index_esa_stree.h for mass update during suffix array traversal
the suffix array is treated as a suffix tree. this function skips the subtree under the actual node and goes directly to the next subtree that has not been visited yet. During this traversal the mass will be updated using the stack with edge masses.
it | reference to the suffix array iterator | |
m | reference to actual mass | |
allm | reference to the stack with history of traversal |
void goNextSubTree | ( | seqan::Iter< TIndex, seqan::VSTree< seqan::TopDown< seqan::ParentLinks< TSpec > > > > & | it | ) | [inline] |
void goNext | ( | seqan::Iter< TIndex, seqan::VSTree< seqan::TopDown< seqan::ParentLinks< TSpec > > > > & | it, | |
double & | m, | |||
std::stack< double > & | allm, | |||
std::stack< std::map< double, int > > & | mod_map | |||
) | [inline] |
overwriting goNext from seqan index_esa_stree.h for mass update during suffix array traversal
the suffix array is treated as a suffix tree. this function goes to the next node that has not been visited yet. During this traversal the mass will be updated using the stack with edge masses.
it | reference to the suffix array iterator | |
m | reference to actual mass | |
allm | reference to the stack with history of traversal |
void parseTree | ( | seqan::Iter< TIndex, seqan::VSTree< seqan::TopDown< seqan::ParentLinks< TSpec > > > > & | it, | |
std::vector< std::pair< int, int > > & | out_number, | |||
std::vector< std::pair< int, int > > & | edge_length, | |||
std::vector< int > & | leafe_depth | |||
) | [inline] |
void printStatistic | ( | ) | [virtual] |
int findFirst_ | ( | const std::vector< double > & | spec, | |
double & | m | |||
) | [protected] |
binary search for finding the index of the first element of the spectrum that matches the desired mass within the tolerance.
spec | const reference to spectrum | |
m | mass |
int findFirst_ | ( | const std::vector< double > & | spec, | |
double & | m, | |||
int | start, | |||
int | end | |||
) | [protected] |
binary search for finding the index of the first element of the spectrum that matches the desired mass within the tolerance. it searches recursivly.
spec | const reference to spectrum | |
m | mass | |
start | start index | |
end | end index |
seqan::Iter<TIndex, seqan::VSTree<seqan::TopDown<seqan::ParentLinks<seqan::Preorder> > > >* it_ [protected] |
seqan suffix array iterator
double masse_[255] [protected] |
amino acid masses
int number_of_modifications_ [protected] |
number of allowed modifications
bool use_tags_ [protected] |
if tags are used
double tol_ [protected] |
tolerance
Generated Tue Apr 1 15:36:44 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |