eXpress “1.5”

SequenceFwd Class Reference

The SequenceFwd class implements the Sequence abstract class for storing the forward sequence. More...

#include <sequence.h>

Inheritance diagram for SequenceFwd:
Sequence

List of all members.

Public Member Functions

 SequenceFwd ()
 Dummy SequenceFwd constructor.
 SequenceFwd (const std::string &seq, bool rev, bool prob=false)
 SequenceFwd constructor encodes and stores the given nucleotide sequence.
 SequenceFwd (const SequenceFwd &other)
 SequenceFwd copy constructor.
SequenceFwdoperator= (const SequenceFwd &other)
 SequenceFwd assignment constructor, copies the given SequenceFwd object.
void set (const std::string &seq, bool rev)
 A member function that encodes the given sequence and overwrites the current stored sequence with it.
size_t operator[] (const size_t index) const
 An accessor for the encoded character at the given index.
size_t get_ref (const size_t index) const
 An accessor for the encoded reference character at the given index.
float get_exp (const size_t index, const size_t nuc) const
 An accessor for the expected nucleotide frequency (logged).
float get_obs (const size_t index, const size_t nuc) const
 An accessor for the observed nucleotide frequency (logged).
void update_est (const size_t index, const size_t nuc, float mass)
 A member function that updates the posterior nucleotide distribution if probabilistic.
void update_obs (const size_t index, const size_t nuc, float mass)
 A member function that updates the observed frequency distribution if probabilistic.
void update_exp (const size_t index, const size_t nuc, float mass)
 A member function that updates the expected frequency distribution if probabilistic.
float get_prob (const size_t index, const size_t nuc) const
 An accessor for the posterior nucleotide distribution (logged).
bool prob () const
 Accessor to determine if the sequence is probabilistic.
bool empty () const
 Accessor to determine if the sequence has 0 length.
size_t length () const
 An accessor for the length of the encoded sequence.
void calc_p_vals (std::vector< double > &p_vals) const
 A member function that calculates p-values based on the observed and expected nucleotide frequences for the sequence.

Detailed Description

The SequenceFwd class implements the Sequence abstract class for storing the forward sequence.

Documentation is only provided for methods not documented in the abstract Sequence class.

Author:
Adam Roberts
Date:
2012 Artistic License 2.0

Definition at line 177 of file sequence.h.


Constructor & Destructor Documentation

SequenceFwd::SequenceFwd ( const std::string &  seq,
bool  rev,
bool  prob = false 
)

SequenceFwd constructor encodes and stores the given nucleotide sequence.

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

Definition at line 30 of file sequence.cpp.

SequenceFwd::SequenceFwd ( const SequenceFwd other)

SequenceFwd copy constructor.

Parameters:
otherthe SequenceFwd object to copy.

Definition at line 40 of file sequence.cpp.


Member Function Documentation

void SequenceFwd::calc_p_vals ( std::vector< double > &  p_vals) const [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.

Implements Sequence.

bool SequenceFwd::empty ( ) const [inline, virtual]

Accessor to determine if the sequence has 0 length.

Returns:
True iff the sequence has 0 length.

Implements Sequence.

Definition at line 242 of file sequence.h.

float SequenceFwd::get_exp ( const size_t  index,
const size_t  nuc 
) const [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.

Implements Sequence.

Definition at line 99 of file sequence.cpp.

float SequenceFwd::get_obs ( const size_t  index,
const size_t  nuc 
) const [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.

Implements Sequence.

Definition at line 94 of file sequence.cpp.

float SequenceFwd::get_prob ( const size_t  index,
const size_t  nuc 
) const [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.

Implements Sequence.

Definition at line 89 of file sequence.cpp.

size_t SequenceFwd::get_ref ( const size_t  index) const [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.

Implements Sequence.

Definition at line 83 of file sequence.cpp.

size_t SequenceFwd::length ( ) const [inline, virtual]

An accessor for the length of the encoded sequence.

Returns:
The length of the encoded sequence.

Implements Sequence.

Definition at line 243 of file sequence.h.

SequenceFwd & SequenceFwd::operator= ( const SequenceFwd other)

SequenceFwd assignment constructor, copies the given SequenceFwd object.

Parameters:
otherthe Sequence object to copy.

Definition at line 50 of file sequence.cpp.

size_t SequenceFwd::operator[] ( const size_t  index) const [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.

Implements Sequence.

Definition at line 75 of file sequence.cpp.

bool SequenceFwd::prob ( ) const [inline, virtual]

Accessor to determine if the sequence is probabilistic.

Returns:
True iff the sequence is probabilistic.

Implements Sequence.

Definition at line 241 of file sequence.h.

void SequenceFwd::set ( const std::string &  seq,
bool  rev 
) [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.

Implements Sequence.

Definition at line 63 of file sequence.cpp.

void SequenceFwd::update_est ( const size_t  index,
const size_t  nuc,
float  mass 
) [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.

Implements Sequence.

Definition at line 104 of file sequence.cpp.

void SequenceFwd::update_exp ( const size_t  index,
const size_t  nuc,
float  mass 
) [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.

Implements Sequence.

Definition at line 114 of file sequence.cpp.

void SequenceFwd::update_obs ( const size_t  index,
const size_t  nuc,
float  mass 
) [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.

Implements Sequence.

Definition at line 109 of file sequence.cpp.


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