bpp-seq  2.1.0
 All Classes Namespaces Files Functions Variables Friends Pages
bpp::SequenceMask Class Reference

#include <Bpp/Seq/SequenceWithAnnotationTools.h>

+ Inheritance diagram for bpp::SequenceMask:
+ Collaboration diagram for bpp::SequenceMask:

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. More...
 
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 bool operator[] (size_t i) const
 
void setMask (const std::vector< bool > &mask)
 
const std::vector< bool > & getMask () const
 
void setMask (size_t pos, bool mask)
 
void setMask (size_t pos, const std::vector< bool > &mask)
 
bool merge (const SequenceAnnotation &anno)
 Merge the input annotation with the current one. More...
 
SequenceAnnotationgetPartAnnotation (size_t pos, size_t len) const throw (Exception)
 
Constructors
 SequenceMask (size_t size=0, bool removable=true)
 Build a new SequenceMask object. More...
 
 SequenceMask (const std::vector< bool > &mask, bool removable=true)
 Build a new SequenceMask object. More...
 
Destructor
virtual ~SequenceMask ()
 
The Clonable interface
SequenceMaskclone () const
 

Static Public Attributes

static const std::string MASK = "Boolean mask"
 

Private Attributes

bool removable_
 
std::vector< bool > mask_
 

Detailed Description

Definition at line 49 of file SequenceWithAnnotationTools.h.

Constructor & Destructor Documentation

bpp::SequenceMask::SequenceMask ( size_t  size = 0,
bool  removable = true 
)
inline

Build a new SequenceMask object.

Build a new SequenceMask object and set the mask to false.

Parameters
sizeThe size of the sequence.
removableTell if this listener can be removed by the user.

Definition at line 74 of file SequenceWithAnnotationTools.h.

Referenced by clone(), and getPartAnnotation().

bpp::SequenceMask::SequenceMask ( const std::vector< bool > &  mask,
bool  removable = true 
)
inline

Build a new SequenceMask object.

Build a new SequenceMask object and set the mask as a vector of bool.

Parameters
maskThe boolean mask
removableTell if this listener can be removed by the user.

Definition at line 88 of file SequenceWithAnnotationTools.h.

virtual bpp::SequenceMask::~SequenceMask ( )
inlinevirtual

Definition at line 99 of file SequenceWithAnnotationTools.h.

Member Function Documentation

void SequenceMask::afterSequenceChanged ( const SymbolListEditionEvent event)
virtual

Implements bpp::SymbolListListener.

Definition at line 50 of file SequenceWithAnnotationTools.cpp.

void SequenceMask::afterSequenceDeleted ( const SymbolListDeletionEvent event)
virtual

Implements bpp::SymbolListListener.

Definition at line 65 of file SequenceWithAnnotationTools.cpp.

void SequenceMask::afterSequenceInserted ( const SymbolListInsertionEvent event)
virtual

Implements bpp::SymbolListListener.

Definition at line 58 of file SequenceWithAnnotationTools.cpp.

void bpp::SequenceMask::afterSequenceSubstituted ( const SymbolListSubstitutionEvent event)
inlinevirtual

Implements bpp::SymbolListListener.

Definition at line 138 of file SequenceWithAnnotationTools.h.

void bpp::SequenceMask::beforeSequenceChanged ( const SymbolListEditionEvent event)
inlinevirtual

Implements bpp::SymbolListListener.

Definition at line 131 of file SequenceWithAnnotationTools.h.

void bpp::SequenceMask::beforeSequenceDeleted ( const SymbolListDeletionEvent event)
inlinevirtual

Implements bpp::SymbolListListener.

Definition at line 135 of file SequenceWithAnnotationTools.h.

void bpp::SequenceMask::beforeSequenceInserted ( const SymbolListInsertionEvent event)
inlinevirtual

Implements bpp::SymbolListListener.

Definition at line 133 of file SequenceWithAnnotationTools.h.

void bpp::SequenceMask::beforeSequenceSubstituted ( const SymbolListSubstitutionEvent event)
inlinevirtual

Implements bpp::SymbolListListener.

Definition at line 137 of file SequenceWithAnnotationTools.h.

SequenceMask* bpp::SequenceMask::clone ( ) const
inlinevirtual

Implements bpp::SequenceAnnotation.

Definition at line 111 of file SequenceWithAnnotationTools.h.

References SequenceMask().

const std::vector<bool>& bpp::SequenceMask::getMask ( ) const
inline
Returns
The mask as a vector.

Definition at line 153 of file SequenceWithAnnotationTools.h.

References mask_.

Referenced by merge().

SequenceAnnotation* bpp::SequenceMask::getPartAnnotation ( size_t  pos,
size_t  len 
) const throw (Exception)
inlinevirtual
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 177 of file SequenceWithAnnotationTools.h.

References mask_, mask_, removable_, and SequenceMask().

size_t bpp::SequenceMask::getSize ( ) const
inline

Definition at line 140 of file SequenceWithAnnotationTools.h.

References mask_.

const std::string& bpp::SequenceMask::getType ( ) const
inlinevirtual
Returns
The type of the annotation. This is used for querying annotations.

Implements bpp::SequenceAnnotation.

Definition at line 121 of file SequenceWithAnnotationTools.h.

References MASK.

void bpp::SequenceMask::init ( const Sequence seq)
inlinevirtual

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 115 of file SequenceWithAnnotationTools.h.

References mask_, mask_, mask_, and bpp::SymbolList::size().

bool bpp::SequenceMask::isRemovable ( ) const
inlinevirtual

Implements bpp::SymbolListListener.

Definition at line 129 of file SequenceWithAnnotationTools.h.

References removable_.

bool bpp::SequenceMask::isShared ( ) const
inlinevirtual

Implements bpp::SymbolListListener.

Definition at line 130 of file SequenceWithAnnotationTools.h.

bool bpp::SequenceMask::isValidWith ( const SequenceWithAnnotation sequence,
bool  throwException = true 
) const
inlinevirtual

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 123 of file SequenceWithAnnotationTools.h.

References mask_, mask_, bpp::EdSymbolList::size(), and bpp::EdSymbolList::size().

bool bpp::SequenceMask::merge ( const SequenceAnnotation anno)
inlinevirtual

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 167 of file SequenceWithAnnotationTools.h.

References bpp::VectorTools::append(), and getMask().

const bool bpp::SequenceMask::operator[] ( size_t  i) const
inline

Definition at line 142 of file SequenceWithAnnotationTools.h.

References mask_.

void bpp::SequenceMask::setMask ( const std::vector< bool > &  mask)
inline

Definition at line 144 of file SequenceWithAnnotationTools.h.

References mask_, mask_, and mask_.

void bpp::SequenceMask::setMask ( size_t  pos,
bool  mask 
)
inline
void bpp::SequenceMask::setMask ( size_t  pos,
const std::vector< bool > &  mask 
)
inline

Member Data Documentation

const string SequenceMask::MASK = "Boolean mask"
static

Definition at line 57 of file SequenceWithAnnotationTools.h.

Referenced by getType().

bool bpp::SequenceMask::removable_
private

Definition at line 53 of file SequenceWithAnnotationTools.h.

Referenced by getPartAnnotation(), and isRemovable().


The documentation for this class was generated from the following files: