|
bpp-seq
2.1.0
|
The SequenceQuality class. More...
#include <Bpp/Seq/SequenceWithQuality.h>
Inheritance diagram for bpp::SequenceQuality:
Collaboration diagram for bpp::SequenceQuality:Public Member Functions | |
| void | init (const Sequence &seq) |
| const std::string & | getType () const |
| bool | isValidWith (const SequenceWithAnnotation &sequence, bool throwException=true) const |
| Test is the annotation is valid for a given sequence. | |
| bool | isRemovable () const |
| bool | isShared () const |
| void | beforeSequenceChanged (const SymbolListEditionEvent &event) |
| void | afterSequenceChanged (const SymbolListEditionEvent &event) |
| void | beforeSequenceInserted (const SymbolListInsertionEvent &event) |
| void | afterSequenceInserted (const SymbolListInsertionEvent &event) |
| void | beforeSequenceDeleted (const SymbolListDeletionEvent &event) |
| void | afterSequenceDeleted (const SymbolListDeletionEvent &event) |
| void | beforeSequenceSubstituted (const SymbolListSubstitutionEvent &event) |
| void | afterSequenceSubstituted (const SymbolListSubstitutionEvent &event) |
| size_t | getSize () const |
| const int & | operator[] (size_t i) const |
| int & | operator[] (size_t i) |
| void | setScores (const std::vector< int > &scores) |
| const std::vector< int > & | getScores () const |
| void | setScore (size_t pos, int score) |
| void | setScores (size_t pos, const std::vector< int > &scores) |
| bool | merge (const SequenceAnnotation &anno) |
| Merge the input annotation with the current one. | |
| SequenceQuality * | getPartAnnotation (size_t pos, size_t len) const throw (Exception) |
Constructors | |
| SequenceQuality (size_t size=0, bool removable=true) | |
| Build a new SequenceQuality object. | |
| SequenceQuality (const std::vector< int > &quality, bool removable=true) | |
| Build a new SequenceQuality object. | |
Destructor | |
| virtual | ~SequenceQuality () |
The Clonable interface | |
| SequenceQuality * | clone () const |
Static Public Attributes | |
| static const std::string | QUALITY_SCORE = "Quality score" |
| static const int | DEFAULT_QUALITY_VALUE = 20 |
Private Attributes | |
| bool | removable_ |
| std::vector< int > | qualScores_ |
The SequenceQuality class.
This is a sequence with quality score associated to each element. The score is a signed int value that can represent the phred or the Solexa quality score for nucleic sequence.
Definition at line 64 of file SequenceWithQuality.h.
| bpp::SequenceQuality::SequenceQuality | ( | size_t | size = 0, |
| bool | removable = true |
||
| ) | [inline] |
Build a new SequenceQuality object.
Build a new SequenceQuality object and set the quality scores to the default value DEFAULT_QUALITY_VALUE.
| size | The size of the sequence. |
| removable | Tell if this listener can be removed by the user. |
Definition at line 91 of file SequenceWithQuality.h.
Referenced by clone(), and getPartAnnotation().
| bpp::SequenceQuality::SequenceQuality | ( | const std::vector< int > & | quality, |
| bool | removable = true |
||
| ) | [inline] |
Build a new SequenceQuality object.
Build a new SequenceQuality and assign quality scores from a vector of int.
| quality | The quality scores |
| removable | Tell if this listener can be removed by the user. |
Definition at line 105 of file SequenceWithQuality.h.
| virtual bpp::SequenceQuality::~SequenceQuality | ( | ) | [inline, virtual] |
Definition at line 119 of file SequenceWithQuality.h.
| void SequenceQuality::afterSequenceChanged | ( | const SymbolListEditionEvent & | event | ) | [virtual] |
Implements bpp::SymbolListListener.
Definition at line 55 of file SequenceWithQuality.cpp.
| void SequenceQuality::afterSequenceDeleted | ( | const SymbolListDeletionEvent & | event | ) | [virtual] |
Implements bpp::SymbolListListener.
Definition at line 70 of file SequenceWithQuality.cpp.
| void SequenceQuality::afterSequenceInserted | ( | const SymbolListInsertionEvent & | event | ) | [virtual] |
Implements bpp::SymbolListListener.
Definition at line 63 of file SequenceWithQuality.cpp.
| void bpp::SequenceQuality::afterSequenceSubstituted | ( | const SymbolListSubstitutionEvent & | event | ) | [inline, virtual] |
Implements bpp::SymbolListListener.
Definition at line 158 of file SequenceWithQuality.h.
| void bpp::SequenceQuality::beforeSequenceChanged | ( | const SymbolListEditionEvent & | event | ) | [inline, virtual] |
Implements bpp::SymbolListListener.
Definition at line 151 of file SequenceWithQuality.h.
| void bpp::SequenceQuality::beforeSequenceDeleted | ( | const SymbolListDeletionEvent & | event | ) | [inline, virtual] |
Implements bpp::SymbolListListener.
Definition at line 155 of file SequenceWithQuality.h.
| void bpp::SequenceQuality::beforeSequenceInserted | ( | const SymbolListInsertionEvent & | event | ) | [inline, virtual] |
Implements bpp::SymbolListListener.
Definition at line 153 of file SequenceWithQuality.h.
| void bpp::SequenceQuality::beforeSequenceSubstituted | ( | const SymbolListSubstitutionEvent & | event | ) | [inline, virtual] |
Implements bpp::SymbolListListener.
Definition at line 157 of file SequenceWithQuality.h.
| SequenceQuality* bpp::SequenceQuality::clone | ( | ) | const [inline, virtual] |
Implements bpp::SequenceAnnotation.
Definition at line 131 of file SequenceWithQuality.h.
References SequenceQuality().
| SequenceQuality* bpp::SequenceQuality::getPartAnnotation | ( | size_t | pos, |
| size_t | len | ||
| ) | const throw (Exception) [inline, virtual] |
| pos | Starting point of the region. |
| len | The length of the region, in number of positions. |
Implements bpp::SequenceAnnotation.
Definition at line 198 of file SequenceWithQuality.h.
References qualScores_, removable_, and SequenceQuality().
| const std::vector<int>& bpp::SequenceQuality::getScores | ( | ) | const [inline] |
Definition at line 174 of file SequenceWithQuality.h.
References qualScores_.
Referenced by bpp::SequenceWithQuality::getQualities(), and merge().
| size_t bpp::SequenceQuality::getSize | ( | ) | const [inline] |
Definition at line 160 of file SequenceWithQuality.h.
References qualScores_.
Referenced by bpp::SequenceWithQuality::append(), bpp::SequenceWithQuality::getQuality(), and bpp::SequenceWithQuality::setQualities().
| const std::string& bpp::SequenceQuality::getType | ( | ) | const [inline, virtual] |
Implements bpp::SequenceAnnotation.
Definition at line 141 of file SequenceWithQuality.h.
References QUALITY_SCORE.
| void bpp::SequenceQuality::init | ( | const Sequence & | seq | ) | [inline, virtual] |
Creates a default annotation according to a given sequence.
| seq | The template sequence (typically the one with which the annotation will be attached). |
Implements bpp::SequenceAnnotation.
Definition at line 135 of file SequenceWithQuality.h.
References DEFAULT_QUALITY_VALUE, qualScores_, and bpp::SymbolList::size().
| bool bpp::SequenceQuality::isRemovable | ( | ) | const [inline, virtual] |
Implements bpp::SymbolListListener.
Definition at line 149 of file SequenceWithQuality.h.
References removable_.
| bool bpp::SequenceQuality::isShared | ( | ) | const [inline, virtual] |
Implements bpp::SymbolListListener.
Definition at line 150 of file SequenceWithQuality.h.
| bool bpp::SequenceQuality::isValidWith | ( | const SequenceWithAnnotation & | sequence, |
| bool | throwException = true |
||
| ) | const [inline, virtual] |
Test is the annotation is valid for a given sequence.
| sequence | The sequence to be validated against. |
| throwException | If set to yes, throw an exception if the sequence is not valid. |
Implements bpp::SequenceAnnotation.
Definition at line 143 of file SequenceWithQuality.h.
References qualScores_, and bpp::EdSymbolList::size().
| bool bpp::SequenceQuality::merge | ( | const SequenceAnnotation & | anno | ) | [inline, virtual] |
Merge the input annotation with the current one.
| anno | The annotation to fuse. |
Implements bpp::SequenceAnnotation.
Definition at line 188 of file SequenceWithQuality.h.
References bpp::VectorTools::append(), getScores(), and qualScores_.
| const int& bpp::SequenceQuality::operator[] | ( | size_t | i | ) | const [inline] |
Definition at line 162 of file SequenceWithQuality.h.
References qualScores_.
| int& bpp::SequenceQuality::operator[] | ( | size_t | i | ) | [inline] |
Definition at line 163 of file SequenceWithQuality.h.
References qualScores_.
| void bpp::SequenceQuality::setScore | ( | size_t | pos, |
| int | score | ||
| ) | [inline] |
Definition at line 176 of file SequenceWithQuality.h.
References qualScores_, and bpp::TextTools::toString().
Referenced by bpp::SequenceWithQuality::addElement(), and bpp::SequenceWithQuality::setQuality().
| void bpp::SequenceQuality::setScores | ( | const std::vector< int > & | scores | ) | [inline] |
Definition at line 165 of file SequenceWithQuality.h.
References qualScores_.
Referenced by bpp::SequenceWithQuality::append(), and bpp::SequenceWithQuality::setQualities().
| void bpp::SequenceQuality::setScores | ( | size_t | pos, |
| const std::vector< int > & | scores | ||
| ) | [inline] |
Definition at line 182 of file SequenceWithQuality.h.
References qualScores_, and bpp::TextTools::toString().
const int SequenceQuality::DEFAULT_QUALITY_VALUE = 20 [static] |
Definition at line 73 of file SequenceWithQuality.h.
Referenced by init().
const string SequenceQuality::QUALITY_SCORE = "Quality score" [static] |
Definition at line 72 of file SequenceWithQuality.h.
Referenced by getType(), bpp::SequenceWithQuality::operator=(), and bpp::SequenceWithQuality::SequenceWithQuality().
std::vector<int> bpp::SequenceQuality::qualScores_ [private] |
Definition at line 69 of file SequenceWithQuality.h.
Referenced by getPartAnnotation(), getScores(), getSize(), init(), isValidWith(), merge(), operator[](), setScore(), and setScores().
bool bpp::SequenceQuality::removable_ [private] |
Definition at line 68 of file SequenceWithQuality.h.
Referenced by getPartAnnotation(), and isRemovable().