Sequence::AlignStream< T > Class Template Reference
[Classes and functions dealing with alignments]

Virtual interface to alignment streams. More...

#include <Sequence/AlignStream.hpp>

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

List of all members.

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 (const AlignStream< T > &a)
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) throw (Sequence::SeqException)
std::vector< T > TrimComplement (std::vector< int >sites) throw (Sequence::SeqException)
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) throw (Sequence::SeqException)

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 60 of file AlignStream.hpp.


Member Typedef Documentation

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 111 of file AlignStream.hpp.

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

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

Definition at line 107 of file AlignStream.hpp.


Member Function Documentation

template<typename T >
void Sequence::AlignStream< T >::assign ( const_iterator  beg,
const_iterator  end 
) throw (Sequence::SeqException) [inline]

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:
Sequence::SeqException is thrown if all data elements in the range (beg,end] are not of the same length

store the data

Definition at line 45 of file AlignStream.tcc.

template<typename T >
const std::vector< T > Sequence::AlignStream< T >::Data ( void   )  [inline]

Returns the std::vector < T* > data

Definition at line 154 of file AlignStream.tcc.

template<typename T >
bool Sequence::AlignStream< T >::Gapped ( void   )  [inline]

Implemented by a call to Alignment::Gapped

Definition at line 98 of file AlignStream.tcc.

template<typename T >
bool Sequence::AlignStream< T >::IsAlignment ( void   )  [inline]

Implemented by a call to Alignment::IsAlignment

Definition at line 89 of file AlignStream.tcc.

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 96 of file AlignStream.hpp.

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 88 of file AlignStream.hpp.

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 >.

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 >.

template<typename T >
void Sequence::AlignStream< T >::RemoveGaps ( void   )  [inline]

Implemented by a call to Alignment::RemoveGaps

Definition at line 116 of file AlignStream.tcc.

template<typename T >
void Sequence::AlignStream< T >::RemoveTerminalGaps ( void   )  [inline]

Implemented by a call to Alignment::RemoveTerminalGaps

Definition at line 125 of file AlignStream.tcc.

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

Returns data.size()

Definition at line 81 of file AlignStream.hpp.

template<typename T >
std::vector< T > Sequence::AlignStream< T >::Trim ( std::vector< int >  sites  )  throw (Sequence::SeqException) [inline]

Implemented by a call to Alignment::Trim

Definition at line 134 of file AlignStream.tcc.

template<typename T >
std::vector< T > Sequence::AlignStream< T >::TrimComplement ( std::vector< int >  sites  )  throw (Sequence::SeqException) [inline]

Implemented by a call to Alignment::TrimComplement

Definition at line 145 of file AlignStream.tcc.

template<typename T >
unsigned Sequence::AlignStream< T >::UnGappedLength ( void   )  [inline]

Implemented by a call to Alignment::UnGappedLength

Definition at line 107 of file AlignStream.tcc.


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

Generated on Mon Jul 12 15:22:02 2010 for libsequence by  doxygen 1.6.1