libsequence  1.9.5
Sequence::AlignStream< T > Class Template Referenceabstract

Virtual interface to alignment streams. More...

#include <Sequence/AlignStream.hpp>

Inheritance diagram for Sequence::AlignStream< T >:
Sequence::ClustalW< T > Sequence::phylipData< T >

Public Types

typedef std::vector< T >::size_type size_type
 
typedef std::vector< T >::reference reference
 
typedef std::vector< T >::const_reference const_reference
 
typedef std::vector< T >::iterator iterator
 
typedef std::vector< T >::const_iterator const_iterator
 

Public Member Functions

 AlignStream (const std::vector< T > &_data)
 
 AlignStream (std::vector< T > &&_data)
 
 AlignStream (const AlignStream< T > &a)
 
 AlignStream (AlignStream< T > &&a)
 
bool empty () const
 
size_type size (void) const
 
reference operator[] (const size_type &i)
 
const_reference operator[] (const size_type &i) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
bool IsAlignment (void)
 
bool Gapped (void)
 
unsigned UnGappedLength (void)
 
void RemoveGaps (void)
 
void RemoveTerminalGaps (void)
 
std::vector< T > Trim (std::vector< int >sites)
 
std::vector< T > TrimComplement (std::vector< int >sites)
 
const std::vector< T > Data (void)
 
virtual std::istream & read (std::istream &s)=0
 
virtual std::ostream & print (std::ostream &s) const =0
 
void assign (const_iterator beg, const_iterator end)
 
void assign (std::vector< T > &&_data)
 

Detailed Description

template<typename T>
class Sequence::AlignStream< T >

Virtual interface to alignment streams.

This template defines a virtual base class for input of sequences in aligned block formats, such as ClustalW.

This class doesn't really define any operations on alignments. It is merely an interface for input/output and some simple basic manipulations.

Note
The only valid template parameters for this class are types in the inheritance hierarchy of Sequence::Seq. std::pair<std::string,std::string> is also supported.

Definition at line 61 of file AlignStream.hpp.

Member Typedef Documentation

◆ const_iterator

template<typename T>
typedef std::vector<T>::const_iterator Sequence::AlignStream< T >::const_iterator

value type is std::vector<T>::const_iterator

Definition at line 124 of file AlignStream.hpp.

◆ iterator

template<typename T>
typedef std::vector<T>::iterator Sequence::AlignStream< T >::iterator

value type is std::vector<T>::iterator

Definition at line 120 of file AlignStream.hpp.

Member Function Documentation

◆ assign() [1/2]

template<typename T>
void Sequence::AlignStream< T >::assign ( const_iterator  beg,
const_iterator  end 
)

Assign data to object. Since the value type for these iterators evaluates to std::vector<T>::const_iterator, any vector<T> can be the data source

Exceptions
std::runtime_erroris thrown if all data elements in the range (beg,end] are not of the same length

◆ assign() [2/2]

template<typename T>
void Sequence::AlignStream< T >::assign ( std::vector< T > &&  _data)

Assign via a move operation

Exceptions
std::runtime_erroris thrown if all data elements are not of the same length

◆ empty()

template<typename T>
bool Sequence::AlignStream< T >::empty ( ) const
inline

Returns data.empty()

Definition at line 85 of file AlignStream.hpp.

◆ operator[]() [1/2]

template<typename T>
reference Sequence::AlignStream< T >::operator[] ( const size_type &  i)
inline

Returns the i-th object of type T in the vector data

Definition at line 101 of file AlignStream.hpp.

◆ operator[]() [2/2]

template<typename T>
const_reference Sequence::AlignStream< T >::operator[] ( const size_type &  i) const
inline

Returns the i-th object of type T in the vector data

Definition at line 109 of file AlignStream.hpp.

◆ print()

template<typename T>
virtual std::ostream& Sequence::AlignStream< T >::print ( std::ostream &  s) const
pure virtual

To define a non-abstract AlignStream, print must be defined

Implemented in Sequence::ClustalW< T >, and Sequence::phylipData< T >.

◆ read()

template<typename T>
virtual std::istream& Sequence::AlignStream< T >::read ( std::istream &  s)
pure virtual

To define a non-abstract AlignStream, read must be defined

Implemented in Sequence::ClustalW< T >, and Sequence::phylipData< T >.

◆ size()

template<typename T>
size_type Sequence::AlignStream< T >::size ( void  ) const
inline

Returns data.size()

Definition at line 93 of file AlignStream.hpp.


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