![]() |
OpenMS
|
Representation of a nucleic acid sequence. More...
#include <OpenMS/CHEMISTRY/NASequence.h>
Classes | |
| class | ConstIterator |
| ConstIterator of NASequence class. More... | |
| class | Iterator |
| Iterator of NASequence class. More... | |
Public Types | |
| enum | NASFragmentType { Full = 0 , Internal , FivePrime , ThreePrime , AIon , BIon , CIon , XIon , YIon , ZIon , Precursor , BIonMinusH20 , YIonMinusH20 , BIonMinusNH3 , YIonMinusNH3 , NonIdentified , Unannotated , WIon , AminusB , DIon , SizeOfNASFragmentType } |
| an enum of all possible fragment ion types More... | |
| using | ConstRibonucleotidePtr = const Ribonucleotide * |
Public Member Functions | |
| NASequence ()=default | |
| NASequence (const NASequence &)=default | |
| default constructor | |
| NASequence (NASequence &&)=default | |
| Move constructor. | |
| NASequence & | operator= (const NASequence &) &=default |
| Copy assignment operator. | |
| NASequence & | operator= (NASequence &&) &=default |
| Move assignment operator. | |
| NASequence (std::vector< const Ribonucleotide * > s, const RibonucleotideChainEnd *five_prime, const RibonucleotideChainEnd *three_prime) | |
| full constructor | |
| virtual | ~NASequence ()=default |
| bool | operator== (const NASequence &rhs) const |
| destructor | |
| bool | operator!= (const NASequence &rhs) const |
| not quality | |
| bool | operator< (const NASequence &rhs) const |
| less operator | |
| void | setSequence (const std::vector< const Ribonucleotide * > &seq) |
| getter / setter for sequence | |
| const std::vector< const Ribonucleotide * > & | getSequence () const |
| std::vector< const Ribonucleotide * > & | getSequence () |
| void | set (size_t index, const Ribonucleotide *r) |
| getter / setter for ribonucleotide elements (easily wrapped using pyOpenMS) | |
| const Ribonucleotide * | get (size_t index) |
| const Ribonucleotide *& | operator[] (size_t index) |
| getter / setter for sequence elements (C++ container style) | |
| const Ribonucleotide *const & | operator[] (size_t index) const |
| bool | empty () const |
| size_t | size () const |
| void | clear () |
| bool | hasFivePrimeMod () const |
| 5' and 3' modifications | |
| void | setFivePrimeMod (const RibonucleotideChainEnd *r) |
| const RibonucleotideChainEnd * | getFivePrimeMod () const |
| bool | hasThreePrimeMod () const |
| void | setThreePrimeMod (const RibonucleotideChainEnd *r) |
| const RibonucleotideChainEnd * | getThreePrimeMod () const |
| Iterator | begin () |
| iterators | |
| ConstIterator | begin () const |
| Iterator | end () |
| ConstIterator | end () const |
| ConstIterator | cbegin () const |
| ConstIterator | cend () const |
| double | getMonoWeight (NASFragmentType type=Full, Int charge=0) const |
| utility functions | |
| double | getAverageWeight (NASFragmentType type=Full, Int charge=0) const |
| Get the Average Weight of a NASequence. NB returns the uncharged mass + or - proton masses to match the charge param. | |
| EmpiricalFormula | getFormula (NASFragmentType type=Full, Int charge=0) const |
| Get the formula for a NASequence. | |
| NASequence | getPrefix (Size length) const |
| Return sequence prefix of the given length (not end index!) | |
| NASequence | getSuffix (Size length) const |
| Return sequence suffix of the given length (not start index!) | |
| NASequence | getSubsequence (Size start=0, Size length=Size(-1)) const |
| Return subsequence with given starting position and length. | |
| NASequence | getReversed (bool keep_five_prime=false, bool keep_three_prime=false) const |
| Return a reversed copy of this sequence. | |
| NASequence | getShuffled (Math::RandomShuffler &shuffler, double identity_threshold=0.5, int max_attempts=30, bool keep_five_prime=false, bool keep_three_prime=false) const |
| Return a shuffled copy of this sequence with identity quality control. | |
| float | getSequenceIdentity (const NASequence &other) const |
| Calculate sequence identity between this and another NASequence. | |
Static Public Member Functions | |
| static NASequence | fromString (const std::string &s) |
| create NASequence object by parsing an OpenMS string | |
Stream operators | |
writes a NASequence to an output stream | |
| std::vector< const Ribonucleotide * > | seq_ |
| const RibonucleotideChainEnd * | five_prime_ = nullptr |
| const RibonucleotideChainEnd * | three_prime_ = nullptr |
| std::string | toString () const |
| static NASequence | fromString (const char *s) |
| create NASequence object by parsing a C string (character array) | |
| std::ostream & | operator<< (std::ostream &os, const NASequence &seq) |
| static void | parseString_ (const std::string &s, NASequence &nas) |
| static std::string::const_iterator | parseMod_ (const std::string::const_iterator str_it, const std::string &str, NASequence &nas) |
| Parses modifications in square brackets. | |
Representation of a nucleic acid sequence.
NASequence represents nucleic acid sequences (RNA) in OpenMS. Each NASequence consists of a vector of pointers to Ribonucleotides as well as RibonucleotideChainEnds representing the 5' and 3' ends of the sequence. Each Ribonucleotide has only a single instance. These are accessible through RibonucleotideDB. Modified Ribonucleotides are included in RibonucleotideDB and are expressed as the Modomics Short name surrounded by brackets when converted to string.
| using ConstRibonucleotidePtr = const Ribonucleotide* |
| enum NASFragmentType |
an enum of all possible fragment ion types
| Enumerator | |
|---|---|
| Full | with N-terminus and C-terminus |
| Internal | internal, without any termini |
| FivePrime | only 5' terminus |
| ThreePrime | only 3' terminus |
| AIon | MS:1001229 N-terminus up to the C-alpha/carbonyl carbon bond. |
| BIon | MS:1001224 N-terminus up to the peptide bond. |
| CIon | MS:1001231 N-terminus up to the amide/C-alpha bond. |
| XIon | MS:1001228 amide/C-alpha bond up to the C-terminus. |
| YIon | MS:1001220 peptide bond up to the C-terminus. |
| ZIon | MS:1001230 C-alpha/carbonyl carbon bond. |
| Precursor | MS:1001523 Precursor ion. |
| BIonMinusH20 | MS:1001222 b ion without water. |
| YIonMinusH20 | MS:1001223 y ion without water. |
| BIonMinusNH3 | MS:1001232 b ion without ammonia. |
| YIonMinusNH3 | MS:1001233 y ion without ammonia. |
| NonIdentified | MS:1001240 Non-identified ion. |
| Unannotated | no stored annotation |
| WIon | W ion, added for nucleic acid support. |
| AminusB | A ion with base loss, added for nucleic acid support. |
| DIon | D ion, added for nucleic acid support. |
| SizeOfNASFragmentType | |
|
default |
|
default |
default constructor
Copy constructor
|
default |
Move constructor.
| NASequence | ( | std::vector< const Ribonucleotide * > | s, |
| const RibonucleotideChainEnd * | five_prime, | ||
| const RibonucleotideChainEnd * | three_prime | ||
| ) |
full constructor
|
virtualdefault |
|
inline |
iterators
|
inline |
|
inline |
|
inline |
| void clear | ( | ) |
| bool empty | ( | ) | const |
Referenced by NucleicAcidSearchEngine::resolveAmbiguousMods_().
|
inline |
|
inline |
|
static |
create NASequence object by parsing a C string (character array)
| [in] | s | Input string |
| Exception::ParseError | if an invalid string representation of a nucleic acid sequence is passed |
|
static |
create NASequence object by parsing an OpenMS string
| [in] | s | Input string |
| Exception::ParseError | if an invalid string representation of a nucleic acid sequence is passed |
Referenced by NucleicAcidSearchEngine::main_().
|
inline |
| double getAverageWeight | ( | NASFragmentType | type = Full, |
| Int | charge = 0 |
||
| ) | const |
Get the Average Weight of a NASequence. NB returns the uncharged mass + or - proton masses to match the charge param.
| [in] | type | fragment type to return |
| [out] | charge | how many protons to add or subtract, NB the mass returned is the UNCHARGED MASS |
| const RibonucleotideChainEnd * getFivePrimeMod | ( | ) | const |
| EmpiricalFormula getFormula | ( | NASFragmentType | type = Full, |
| Int | charge = 0 |
||
| ) | const |
Get the formula for a NASequence.
| [in] | type | fragment type for formula |
| [out] | charge | how many H to add or subtract |
| double getMonoWeight | ( | NASFragmentType | type = Full, |
| Int | charge = 0 |
||
| ) | const |
utility functions
Get the Monoisotopic Weight of a NASequence. NB returns the uncharged mass + or - proton masses to match the charge param
| [in] | type | fragment type to return |
| [in] | charge | how many protons to add or subtract, NB the mass returned is the UNCHARGED MASS |
| NASequence getPrefix | ( | Size | length | ) | const |
| NASequence getReversed | ( | bool | keep_five_prime = false, |
| bool | keep_three_prime = false |
||
| ) | const |
Return a reversed copy of this sequence.
Reverses the internal ribonucleotide sequence while preserving 5' and 3' terminal modifications in their original positions.
| [in] | keep_five_prime | If true, preserve the first (5') nucleotide position |
| [in] | keep_three_prime | If true, preserve the last (3') nucleotide position |
|
inline |
|
inline |
Referenced by NucleicAcidSearchEngine::reshuffleOligo_().
| float getSequenceIdentity | ( | const NASequence & | other | ) | const |
Calculate sequence identity between this and another NASequence.
Compares ribonucleotide codes position-by-position. Only considers the internal sequence (ignores 5' and 3' terminal modifications).
| [in] | other | Sequence to compare against |
| NASequence getShuffled | ( | Math::RandomShuffler & | shuffler, |
| double | identity_threshold = 0.5, |
||
| int | max_attempts = 30, |
||
| bool | keep_five_prime = false, |
||
| bool | keep_three_prime = false |
||
| ) | const |
Return a shuffled copy of this sequence with identity quality control.
Shuffles the internal ribonucleotide sequence while optionally preserving terminal nucleotides. Repeatedly attempts shuffling until the sequence identity with the original falls below the threshold or max_attempts is reached. If max_attempts is exhausted, individual nucleotides are mutated to force a different sequence.
| [in] | shuffler | Random shuffler to use (seeded externally for reproducibility) |
| [in] | identity_threshold | Maximum allowed sequence identity with original (0.0-1.0) |
| [in] | max_attempts | Maximum number of shuffle attempts before mutating |
| [in] | keep_five_prime | If true, preserve the first (5') nucleotide position |
| [in] | keep_three_prime | If true, preserve the last (3') nucleotide position |
| NASequence getSubsequence | ( | Size | start = 0, |
| Size | length = Size(-1) |
||
| ) | const |
Return subsequence with given starting position and length.
| [in] | start | |
| [in] | length |
| NASequence getSuffix | ( | Size | length | ) | const |
Return sequence suffix of the given length (not start index!)
| [in] | length |
| const RibonucleotideChainEnd * getThreePrimeMod | ( | ) | const |
| bool hasFivePrimeMod | ( | ) | const |
5' and 3' modifications
| bool hasThreePrimeMod | ( | ) | const |
| bool operator!= | ( | const NASequence & | rhs | ) | const |
not quality
| bool operator< | ( | const NASequence & | rhs | ) | const |
less operator
|
default |
Copy assignment operator.
|
default |
Move assignment operator.
| bool operator== | ( | const NASequence & | rhs | ) | const |
destructor
element-wise equality
|
inline |
getter / setter for sequence elements (C++ container style)
|
inline |
|
staticprivate |
Parses modifications in square brackets.
| [in] | str_it | Current position in the string to be parsed |
| [in] | str | Full input string |
| [in,out] | nas | Current AASequence object (will be modified with the correct ribo added) |
|
staticprivate |
| void set | ( | size_t | index, |
| const Ribonucleotide * | r | ||
| ) |
getter / setter for ribonucleotide elements (easily wrapped using pyOpenMS)
Referenced by ModifiedNASequenceGenerator::recurseAndGenerateVariableModifiedSequences_().
| void setFivePrimeMod | ( | const RibonucleotideChainEnd * | r | ) |
| void setSequence | ( | const std::vector< const Ribonucleotide * > & | seq | ) |
getter / setter for sequence
Referenced by NucleicAcidSearchEngine::reshuffleOligo_().
| void setThreePrimeMod | ( | const RibonucleotideChainEnd * | r | ) |
| size_t size | ( | ) | const |
| std::string toString | ( | ) | const |
|
friend |
|
private |
|
private |
|
private |