Sleipnir
Public Types | Public Member Functions
Sleipnir::CSeekQuery Class Reference

Representation of a query gene-set that is used by Seek. More...

#include <seekquery.h>

Public Types

enum  PartitionMode { LEAVE_ONE_IN = 0, LEAVE_ONE_OUT = LEAVE_ONE_IN + 1, CUSTOM_PARTITION = LEAVE_ONE_OUT + 1 }
 Query partitioning mode. More...

Public Member Functions

 CSeekQuery ()
 Constructor.
 ~CSeekQuery ()
 Destructor.
bool Reset ()
 The reset function.
bool InitializeQuery (const vector< char > &)
 Initialize with a 0-1 query presence vector.
bool InitializeQuery (const vector< utype > &, const utype &)
 Initialize with a vector of query genes' ID.
utype GetNumFold () const
 Get the number of query partitions.
const vector< utype > & GetQuery () const
 Get the query genes as a vector.
const vector< char > & GetQueryPresence () const
 Get the query presence as a char vector.
const vector< utype > & GetCVQuery (utype &) const
 Get the i-th query partition.
bool CreateCVPartitions (const gsl_rng *, const enum PartitionMode &, const utype=-1)
 Create N random query partitions.

Detailed Description

Representation of a query gene-set that is used by Seek.

Includes vectors for storing the query genes, and utilities for partitioning query genes into specified number of groups

There are two ways to represent a query.

Definition at line 45 of file seekquery.h.


Member Enumeration Documentation

Query partitioning mode.

Let us consider a query of size N.

LEAVE_ONE_IN : create N partitions, where each partition is one of the query genes

LEAVE_ONE_OUT : create N partitions, where each partition is everything excluding one of the query genes

CUSTOM_PARTITION : create X equally sized partitions, where each partition is N / X number of genes. X is a user-given parameter.

Definition at line 65 of file seekquery.h.


Member Function Documentation

bool Sleipnir::CSeekQuery::CreateCVPartitions ( const gsl_rng *  ,
const enum PartitionMode ,
const utype  = -1 
)

Create N random query partitions.

Parameters:
rndA random number generator
pThe partitioning mode
iFoldThe number of partitions to be created
Remarks:
The parameter iFold is not used if the partitioning mode is LEAVE_ONE_IN or LEAVE_ONE_OUT, because the number of partitions in this case is the size of the query.

Definition at line 93 of file seekquery.cpp.

References Sleipnir::CSeekTools::IsNaN().

const vector< utype > & Sleipnir::CSeekQuery::GetCVQuery ( utype &  i) const

Get the i-th query partition.

Parameters:
iThe index of partition to return
Returns:
The vector of genes in i-th partition
Remarks:
No bound checking on i.

Definition at line 89 of file seekquery.cpp.

Referenced by Sleipnir::CSeekWeighter::CVWeighting(), and Sleipnir::CSeekWeighter::OneGeneWeighting().

Get the number of query partitions.

Returns:
The number of query partitions

Definition at line 77 of file seekquery.cpp.

Referenced by Sleipnir::CSeekWeighter::CVWeighting().

const vector< utype > & Sleipnir::CSeekQuery::GetQuery ( ) const

Get the query genes as a vector.

Returns:
The query genes as a utype vector

Definition at line 85 of file seekquery.cpp.

Referenced by Sleipnir::CSeekWeighter::CVWeighting(), Sleipnir::CSeekWeighter::OneGeneWeighting(), and Sleipnir::CSeekCentral::VarianceWeightSearch().

const vector< char > & Sleipnir::CSeekQuery::GetQueryPresence ( ) const

Get the query presence as a char vector.

Returns:
The query genes as a presence char vector

Definition at line 81 of file seekquery.cpp.

bool Sleipnir::CSeekQuery::InitializeQuery ( const vector< char > &  query)

Initialize with a 0-1 query presence vector.

Parameters:
queryA char vector (0 or 1) that specifies the location of the query genes,
Remarks:
The parameter query: based on the gene_map.txt, all genes are mapped to integers between 0 to 21000 (or whatever the upper limit is). In the char vector query, query[q] = 1 for q in Q. All other genes: query[g] = 0.

Definition at line 50 of file seekquery.cpp.

References Reset().

bool Sleipnir::CSeekQuery::InitializeQuery ( const vector< utype > &  query,
const utype &  iGenes 
)

Initialize with a vector of query genes' ID.

Parameters:
queryA utype-vector that stores the query genes' ID
iGenesThe number of genes in the genome
Remarks:
This is an alternative way of defining query input. An example of a valid query parameter is <201, 242, 42>, and iGenes is 21000 (if there are 21000 genes).

Definition at line 63 of file seekquery.cpp.

References Reset().


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