mRMRe.Data-class {mRMRe} | R Documentation

## Class `"mRMRe.Data"`

### Description

`mRMRe.Data` is the class containing datasets. Most if not all of the routines in the mRMRe package use `mRMRe.Data` objects as primary input.

Such an object is instantiated with a data frame containing the sample sets and optionally, stratum, weight vectors and a prior matrix. In addition to basic accession functions, we describe several methods which serve to manipulate the contents of the dataset.

Note that `mRMR.data` function is a wrapper to easily create `mRMRe.Data` objects.

### Instantiation

Objects are created via calls of the form `new("mRMRe.Data", data, strata, weights, priors)`.

`data`: is expected to be a data frame with samples and features respectively organized as rows and columns. The columns have to be of type :numeric, ordered factor, Surv and respectively interpreted as :continuous, discrete and survival variables.

`strata`: is expected to be a vector of type :ordered factor with the strata associated to the samples provided in `data`.

`weights`: is expected to be a vector of type :numeric with the weights associated to the samples provided in `data`.

`priors`: is expected to be a matrix of type :numeric where `priors[i, j]`: denotes an forced association between features i and j in `data`. The latter takes into consideration the directionality of the relationship and must be a value between 0 and 1.

### Mutual Information Matrix

The `mim` method computes and returns a mutual information matrix. A correlation between continuous features is estimated using an estimator specified in `continuous_estimator`; currently, :pearson, spearman, kendall, frequency are supported. The estimator for discrete features is Cramer's V and for all other combinations, concordance index.

When `outX` is set to `TRUE`, ties are ignored when computing the concordance index and otherwise, these are considered. The correlations are first computed per strata and these are then combined by the inverse variance weight mean of the estimates using a `bootstrap_count` number of bootstraps if the former parameter is greater than 0, and by the relative weights of each strata otherwise. The resulting correlation is then summated with the corresponding value in the priors matrix with the latter being weighed for a proportion `prior_weight` of a final, biased correlation.

### Slots

`sample_names`:

  Object of class `"character"` containing the sample names.

`feature_names`:

  Object of class `"character"` containing the feature names.

`feature_types`:

  Object of class `"numeric"` containing the internal representation of features/variables: `1` for numeric, `2` for ordered factor, and `3` for survival data

`data`:

  Object of class `"matrix"` containing the internal representation of the data set.

`strata`:

  Object of class `"numeric"` containing the feature strata.

`weights`:

  Object of class `"numeric"` containing sample weights.

`priors`:

  Object of class `"matrix"` containing the priors.

### Methods

featureCount

  `signature(object = "mRMRe.Data")`: Returns the number of features.

featureData

  `signature(object = "mRMRe.Data")`: Returns a data frame corresponding to the data set.

featureNames

  `signature(object = "mRMRe.Data")`: Returns a vector containing the feature names.

mim

  `signature(object = "mRMRe.Data", prior_weight = 0, continuous_estimator = c("pearson", "spearman", "kendall", "frequency"), outX = TRUE, bootstrap_count = 0)`: Computes and returns the mutual information matrix.

priors

  `signature(object = "mRMRe.Data")`: Returns a matrix containing the priors.

priors<-

  `signature(object = "mRMRe.Data", value)`: Sets the prior matrix.

sampleCount

  `signature(object = "mRMRe.Data")`: Returns the number of samples.

sampleNames

  `signature(object = "mRMRe.Data")`: Returns a vector containing sample names.

sampleStrata

  `signature(object = "mRMRe.Data")`: Returns a vector containing sample strata.

sampleStrata<-

  `signature(object = "mRMRe.Data", value)`: Sets the sample strata.

sampleWeights

  `signature(object = "mRMRe.Data")`: Returns a vector containing sample weights.

sampleWeights<-

  `signature(object = "mRMRe.Data")`: Sets the sample weights.

subsetData

  `signature(object = "mRMRe.Data", row_indices, column_indices)`: Returns another data object containing only the specified samples and features (rows and columns, respectively.)

### Author(s)

Nicolas De Jay, Simon Papillon-Cavanagh, Benjamin Haibe-Kains

### See Also

`mRMRe.Filter-class`, `mRMRe.Network-class`

### Examples

    showClass("mRMRe.Data")

    set.thread.count(2)

    ## load data
    data(cgps)

    ## equivalent ways of building an mRMRe.Data object
    ge <- mRMR.data(data = data.frame(cgps.ge[ , 1:10, drop=FALSE]))
    ge <- new("mRMRe.Data", data = data.frame(cgps.ge[ , 1:10, drop=FALSE]))

    ## print data
    print(featureData(ge)[1:3, 1:3])

    ## print feature names
    print(featureNames(ge))

    ## print the first sample names
    print(head(sampleNames(ge)))

    ## print the first sample weights
    print(head(sampleWeights(ge)))

[Package mRMRe version 2.0.9 Index]