bpp-seq  2.1.0
bpp::SequenceQuality Class Reference

The SequenceQuality class. More...

#include <Bpp/Seq/SequenceWithQuality.h>

+ Inheritance diagram for bpp::SequenceQuality:
+ Collaboration diagram for bpp::SequenceQuality:

List of all members.

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.
SequenceQualitygetPartAnnotation (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
SequenceQualityclone () 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_

Detailed Description

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.

Author:
Sylvain Gaillard, Vincent Cahais, Julien Dutheil

Definition at line 64 of file SequenceWithQuality.h.


Constructor & Destructor Documentation

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.

Parameters:
sizeThe size of the sequence.
removableTell 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.

Parameters:
qualityThe quality scores
removableTell 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.


Member Function Documentation

Implements bpp::SymbolListListener.

Definition at line 55 of file SequenceWithQuality.cpp.

Implements bpp::SymbolListListener.

Definition at line 70 of file SequenceWithQuality.cpp.

Implements bpp::SymbolListListener.

Definition at line 63 of file SequenceWithQuality.cpp.

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.

Implements bpp::SymbolListListener.

Definition at line 153 of file SequenceWithQuality.h.

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]
Returns:
A new annotation corresponding to a part of the sequence. The implementation of this highly depends on the annotation type, and might not be supported.
Parameters:
posStarting point of the region.
lenThe 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]
Returns:
All scores as a vector.

Definition at line 174 of file SequenceWithQuality.h.

References qualScores_.

Referenced by bpp::SequenceWithQuality::getQualities(), and merge().

const std::string& bpp::SequenceQuality::getType ( ) const [inline, virtual]
Returns:
The type of the annotation. This is used for querying annotations.

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.

Parameters:
seqThe 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.

Parameters:
sequenceThe sequence to be validated against.
throwExceptionIf set to yes, throw an exception if the sequence is not valid.
Returns:
true if this annotation is complient with the given sequence.

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.

Parameters:
annoThe annotation to fuse.
Returns:
true if the fusion was possible and succesful.

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]
void bpp::SequenceQuality::setScores ( const std::vector< int > &  scores) [inline]
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().


Member Data Documentation

const int SequenceQuality::DEFAULT_QUALITY_VALUE = 20 [static]

Definition at line 73 of file SequenceWithQuality.h.

Referenced by init().

Definition at line 68 of file SequenceWithQuality.h.

Referenced by getPartAnnotation(), and isRemovable().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends