Sleipnir
Public Member Functions
Sleipnir::CDatasetCompactMap Class Reference

Augments a compact dataset with a mask to dynamically exclude specific gene pairs. More...

#include <dataset.h>

Inheritance diagram for Sleipnir::CDatasetCompactMap:
Sleipnir::CDatasetCompact Sleipnir::CDatasetCompactImpl Sleipnir::IDataset Sleipnir::CDataImpl

Public Member Functions

bool Open (const char *szFile)
 Opens a binary DAD file using memory mapping and unmasks it.
void Remove (size_t iY, size_t iX)
 Remove all data for the given dataset position.
bool IsExample (size_t iY, size_t iX) const
 Returns true if some data file can be accessed at the requested position.

Detailed Description

Augments a compact dataset with a mask to dynamically exclude specific gene pairs.

A compact dataset mask memory maps a binary DAD. This saves memory but prevents the underlying dataset from being directly modified. To overcome this, the map adds a binary matrix allowing each gene pair to be individually masked; a masked gene pair will return false from IsExample and act like missing data. Unmasked gene pairs will be retrieved from the underlying dataset. Can be used in combination with CDataFilter.

See also:
CDataMask

Definition at line 624 of file dataset.h.


Member Function Documentation

bool Sleipnir::CDatasetCompactMap::IsExample ( size_t  iY,
size_t  iX 
) const [inline, virtual]

Returns true if some data file can be accessed at the requested position.

Parameters:
iYData row.
iXData column.
Returns:
True if a data file can be accessed at the requested position.

A dataset position is a usable example if at least one data file can be accessed at that position; that is, if some data file provides a non-missing value for that gene pair. Implementations that filter pairs in some manner can also prevent particular positions from being usable examples.

Reimplemented from Sleipnir::CDatasetCompact.

Definition at line 635 of file dataset.h.

References Sleipnir::CBinaryMatrix::Get().

bool Sleipnir::CDatasetCompactMap::Open ( const char *  szFile)

Opens a binary DAD file using memory mapping and unmasks it.

Parameters:
szFileFile from which dataset is opened.
Returns:
True if dataset was opened successfully.

Definition at line 663 of file datasetcompact.cpp.

References Sleipnir::CDatasetCompact::GetGenes(), Sleipnir::CHalfMatrix< tType >::GetSize(), Sleipnir::CBinaryMatrix::Initialize(), Sleipnir::CDatasetCompact::IsExample(), Sleipnir::CMeta::MapRead(), Sleipnir::CBinaryMatrix::Set(), and Sleipnir::CMeta::Unmap().

void Sleipnir::CDatasetCompactMap::Remove ( size_t  iY,
size_t  iX 
) [inline, virtual]

Remove all data for the given dataset position.

Parameters:
iYData row.
iXData column.

Unloads or masks data from all encapsulated files for the requested gene pair.

Remarks:
For efficiency, bounds checking is not performed; the given row and column should both be less than GetGenes. Not supported by all implementations.

Reimplemented from Sleipnir::CDatasetCompact.

Definition at line 631 of file dataset.h.

References Sleipnir::CBinaryMatrix::Set().


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