mems::MemorySML Class Reference

The MemorySML is an implementation of sorted mer lists which creates and stores the sorted mer list entirely in memory. More...

#include <MemorySML.h>

Inheritance diagram for mems::MemorySML:

Inheritance graph
[legend]
Collaboration diagram for mems::MemorySML:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void Clear ()
 Set data structures to default values.

MemorySMLClone () const
virtual void Create (const genome::gnSequence &seq, const uint64 seed)
 Creates a new sorted mer list.

 MemorySML (const MemorySML &msa)
 MemorySML (const uint8 *table=SortedMerList::BasicDNATable(), const uint32 alpha_bits=DNA_ALPHA_BITS)
 Create an empty MemorySML Creates an empty MemorySML with the supplied translation table and alphabet bit size.

virtual void Merge (SortedMerList &sa, SortedMerList &sa2)
 Merges two SortedMerLists.

MemorySMLoperator= (const MemorySML &msa)
virtual bmer operator[] (gnSeqI index)
 Get the mer at the specified index in the sorted mer list.

virtual boolean Read (std::vector< bmer > &readVector, gnSeqI size, gnSeqI offset=0)
 Read a range of mers in the sorted mer list.

 ~MemorySML ()

Protected Attributes

std::vector< smlSeqI_tpositions

Detailed Description

The MemorySML is an implementation of sorted mer lists which creates and stores the sorted mer list entirely in memory.

A MemorySML consumes roughly 32 + alpha_bits bits of memory per character in the sequences. For unambiguous DNA sequences 4.25 bytes per base are required.

Definition at line 26 of file MemorySML.h.


Constructor & Destructor Documentation

mems::MemorySML::MemorySML const uint8 table = SortedMerList::BasicDNATable(),
const uint32  alpha_bits = DNA_ALPHA_BITS
 

Create an empty MemorySML Creates an empty MemorySML with the supplied translation table and alphabet bit size.

Defaults to DNA settings

Parameters:
table The array used to translate characters into binary code
alpha_bits The number of bits each character consumes in binary

Definition at line 20 of file MemorySML.cpp.

References mems::SMLHeader::alphabet_bits, mems::SMLHeader::translation_table, mems::uint32, mems::uint8, UINT8_MAX, and mems::SMLHeader::version.

Referenced by Clone().

mems::MemorySML::MemorySML const MemorySML msa  ) 
 

Definition at line 26 of file MemorySML.cpp.

mems::MemorySML::~MemorySML  ) 
 

Definition at line 40 of file MemorySML.cpp.


Member Function Documentation

void mems::MemorySML::Clear  )  [virtual]
 

Set data structures to default values.

Reimplemented from mems::SortedMerList.

Definition at line 43 of file MemorySML.cpp.

MemorySML * mems::MemorySML::Clone  )  const
 

Reimplemented in mems::DNAMemorySML.

Definition at line 36 of file MemorySML.cpp.

References MemorySML().

void mems::MemorySML::Create const genome::gnSequence &  seq,
const uint64  seed
[virtual]
 

Creates a new sorted mer list.

This function enumerates each possible mer of the specified size and sorts them alphabetically in order to construct a sorted mer list.

Parameters:
seq The sequence to create an SML for.
mersize The size of the mers to sort on.

Reimplemented from mems::SortedMerList.

Definition at line 48 of file MemorySML.cpp.

References mems::bmer_lessthan(), mems::SortedMerList::FillDnaSeedSML(), mems::SortedMerList::FillSML(), mems::SMLHeader::seed_length, mems::SMLHeader::seed_weight, and mems::uint64.

Referenced by mems::GenericMatchList< MatchPtrType >::CreateMemorySMLs().

void mems::MemorySML::Merge SortedMerList sa,
SortedMerList sa2
[virtual]
 

Merges two SortedMerLists.

Implements mems::SortedMerList.

Definition at line 87 of file MemorySML.cpp.

MemorySML & mems::MemorySML::operator= const MemorySML msa  ) 
 

Definition at line 30 of file MemorySML.cpp.

References positions.

bmer mems::MemorySML::operator[] gnSeqI  index  )  [virtual]
 

Get the mer at the specified index in the sorted mer list.

Parameters:
index The index of the mer to return.
Returns:
The specified mer.

Implements mems::SortedMerList.

Definition at line 91 of file MemorySML.cpp.

References mems::SortedMerList::GetSeedMer(), mems::bmer::mer, and mems::bmer::position.

boolean mems::MemorySML::Read std::vector< bmer > &  readVector,
gnSeqI  size,
gnSeqI  offset = 0
[virtual]
 

Read a range of mers in the sorted mer list.

This function reads a section of data from the sorted mer list starting at 'offset' and continuing for 'size' mers. The mers are placed into readVector. Anything already in readVector is cleared. Returns false if there was a problem completing the read. If the end of the list is reached, all mers which could be read will be placed into readVector and false will be returned

Parameters:
readVector the vector to read bmers into.
size The number of bmers to read.
offset The mer index in the sorted mer list to start reading from.
Returns:
false if a problem was encountered while reading.

Implements mems::SortedMerList.

Definition at line 65 of file MemorySML.cpp.

References mems::SortedMerList::GetSeedMer(), mems::bmer::mer, and mems::bmer::position.


Member Data Documentation

std::vector<smlSeqI_t> mems::MemorySML::positions [protected]
 

Definition at line 54 of file MemorySML.h.

Referenced by operator=().


The documentation for this class was generated from the following files:
Generated on Fri Mar 14 06:01:42 2008 for libMems by doxygen 1.3.6