eXpress “1.5”

Sequence Class Reference

The Sequence class is an abstract class whose implmentations are used to store and access encoded nucleotide sequences. More...

#include <sequence.h>

Inheritance diagram for Sequence:
SequenceFwd SequenceRev

List of all members.

Public Member Functions

 Sequence ()
 Dummy Sequence constructor.
virtual ~Sequence ()
 Dummy Sequence destructor.
virtual void set (const std::string &seq, bool rev)=0
 A member function that encodes the given sequence and overwrites the current stored sequence with it.
virtual size_t operator[] (const size_t index) const =0
 An accessor for the encoded character at the given index.
virtual size_t get_ref (const size_t index) const =0
 An accessor for the encoded reference character at the given index.
virtual void update_est (const size_t index, const size_t nuc, float mass)=0
 A member function that updates the posterior nucleotide distribution if probabilistic.
virtual void update_obs (const size_t index, const size_t nuc, float mass)=0
 A member function that updates the observed frequency distribution if probabilistic.
virtual void update_exp (const size_t index, const size_t nuc, float mass)=0
 A member function that updates the expected frequency distribution if probabilistic.
virtual float get_prob (const size_t index, const size_t nuc) const =0
 An accessor for the posterior nucleotide distribution (logged).
virtual float get_obs (const size_t index, const size_t nuc) const =0
 An accessor for the observed nucleotide frequency (logged).
virtual float get_exp (const size_t index, const size_t nuc) const =0
 An accessor for the expected nucleotide frequency (logged).
virtual bool prob () const =0
 Accessor to determine if the sequence is probabilistic.
virtual size_t length () const =0
 An accessor for the length of the encoded sequence.
virtual bool empty () const =0
 Accessor to determine if the sequence has 0 length.
virtual void calc_p_vals (std::vector< double > &p_vals) const =0
 A member function that calculates p-values based on the observed and expected nucleotide frequences for the sequence.
std::string serialize ()
 A member function to serialize a string into an array of bytes, with each nucleotide represented by 2 bits.

Detailed Description

The Sequence class is an abstract class whose implmentations are used to store and access encoded nucleotide sequences.

They also supports probabilistic sequences, meaning that each position stores a distribution over nucleotides.

Author:
Adam Roberts
Date:
2012 Artistic License 2.0

Definition at line 58 of file sequence.h.


Member Function Documentation

virtual void Sequence::calc_p_vals ( std::vector< double > &  p_vals) const [pure virtual]

A member function that calculates p-values based on the observed and expected nucleotide frequences for the sequence.

Experimental.

Parameters:
p_valsa reference to an empty vector of doubles to fill with p-values at each position.

Implemented in SequenceFwd, and SequenceRev.

virtual bool Sequence::empty ( ) const [pure virtual]

Accessor to determine if the sequence has 0 length.

Returns:
True iff the sequence has 0 length.

Implemented in SequenceFwd, and SequenceRev.

virtual float Sequence::get_exp ( const size_t  index,
const size_t  nuc 
) const [pure virtual]

An accessor for the expected nucleotide frequency (logged).

Parameters:
indexthe index of the position to access.
nucthe nucleotide to return the frequency of.
Returns:
The logged expected frequency of the given nucleotide a the given position.

Implemented in SequenceFwd, and SequenceRev.

virtual float Sequence::get_obs ( const size_t  index,
const size_t  nuc 
) const [pure virtual]

An accessor for the observed nucleotide frequency (logged).

Parameters:
indexthe index of the position to access.
nucthe nucleotide to return the frequency of.
Returns:
The logged observed frequency of the given nucleotide a the given position.

Implemented in SequenceFwd, and SequenceRev.

virtual float Sequence::get_prob ( const size_t  index,
const size_t  nuc 
) const [pure virtual]

An accessor for the posterior nucleotide distribution (logged).

Parameters:
indexthe index of the position to access.
nucthe nucleotide to return the probability of.
Returns:
The logged posterior probability of the given nucleotide at the given position.

Implemented in SequenceFwd, and SequenceRev.

virtual size_t Sequence::get_ref ( const size_t  index) const [pure virtual]

An accessor for the encoded reference character at the given index.

May differ from the operator[] if the sequence is probabilistic.

Parameters:
indexthe index of the encoded reference character to return (assumed to be < _len)
Returns:
The encoded reference character at the given index.

Implemented in SequenceFwd, and SequenceRev.

virtual size_t Sequence::length ( ) const [pure virtual]

An accessor for the length of the encoded sequence.

Returns:
The length of the encoded sequence.

Implemented in SequenceFwd, and SequenceRev.

virtual size_t Sequence::operator[] ( const size_t  index) const [pure virtual]

An accessor for the encoded character at the given index.

If the sequence is probabilistic, returns the mode. Otherwise, returns the reference.

Parameters:
indexthe index of the encoded character to return (assumed to be < _len)
Returns:
The encoded character at the given index.

Implemented in SequenceFwd, and SequenceRev.

virtual bool Sequence::prob ( ) const [pure virtual]

Accessor to determine if the sequence is probabilistic.

Returns:
True iff the sequence is probabilistic.

Implemented in SequenceFwd, and SequenceRev.

virtual void Sequence::set ( const std::string &  seq,
bool  rev 
) [pure virtual]

A member function that encodes the given sequence and overwrites the current stored sequence with it.

Parameters:
seqthe nucleotide sequence to encode and store.
reva boolean if the sequence should be reverse complemented before encoding.

Implemented in SequenceFwd, and SequenceRev.

virtual void Sequence::update_est ( const size_t  index,
const size_t  nuc,
float  mass 
) [pure virtual]

A member function that updates the posterior nucleotide distribution if probabilistic.

Parameters:
indexthe index of the position to update.
nucthe nucleotide to increment the mass of.
massthe amount to increment the nucleotide's mass by.

Implemented in SequenceFwd, and SequenceRev.

virtual void Sequence::update_exp ( const size_t  index,
const size_t  nuc,
float  mass 
) [pure virtual]

A member function that updates the expected frequency distribution if probabilistic.

Parameters:
indexthe index of the position to update.
nucthe nucleotide to increment the mass of.
massthe amount to increment the nucleotide's mass by.

Implemented in SequenceFwd, and SequenceRev.

virtual void Sequence::update_obs ( const size_t  index,
const size_t  nuc,
float  mass 
) [pure virtual]

A member function that updates the observed frequency distribution if probabilistic.

Parameters:
indexthe index of the position to update.
nucthe nucleotide to increment the mass of.
massthe amount to increment the nucleotide's mass by.

Implemented in SequenceFwd, and SequenceRev.


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