RCM {RCM} | R Documentation

## Wrapper function for the RCM() function

### Description

This is a wrapper function, which currently only fits the negative binomial distribution, but which could easily be extended to other ones.

### Usage

    RCM(dat, ...)

    ## S4 method for signature 'phyloseq'
    RCM(dat, covariates = NULL, confounders = NULL, ...)

    ## S4 method for signature 'matrix'
    RCM(
      dat,
      k = 2,
      round = FALSE,
      prevCutOff = 0.05,
      minFraction = 0.1,
      rowWeights = "uniform",
      colWeights = "marginal",
      confModelMat = NULL,
      confTrimMat = NULL,
      covModelMat = NULL,
      centMat = NULL,
      allowMissingness = FALSE,
      ...
    )

### Arguments

`dat` | an nxp count matrix or a phyloseq object with an otu_table slot
`...` | Further arguments passed on to the RCM.NB() function
`covariates` | In case 'dat' is a phyloseq object, the names of the sample variables to be used as covariates in the constrained analysis, or 'all' to indicate all variables to be used. In case 'dat' is a matrix, a nxf matrix or dataframe of covariates. Character variables will be converted to factors, with a warning. Defaults to NULL, in which case an unconstrained analysis is carried out.
`confounders` | In case 'dat' is a phyloseq object, the names of the sample variables to be used as confounders to be filtered out. In case 'dat' is a matrix, a nxf dataframe of confounders. Character variables will be converted to factors, with a warning. Defaults to NULL, in which case no filtering occurs.
`k` | an integer, the number of dimensions of the RCM solution
`round` | a boolean, whether to round to nearest integer. Defaults to FALSE.
`prevCutOff` | a scalar, the prevalance cutoff for the trimming. Defaults to 2.5e-2
`minFraction` | a scalar, each taxon's total abundance should equal at least the number of samples n times minFraction, otherwise it is trimmed. Defaults to 10%
`rowWeights, colWeights` | character strings, the weighting procedures for the normalization of row and column scores. Defaults to 'uniform' and 'marginal' respectively
`confTrimMat, confModelMat, covModelMat, centMat` | Dedicated model matrices constructed based on phyloseq object.
`allowMissingness` | A boolean, should NA values be tolerated?

### Details

This function should be called on a raw count matrix, without rarefying or normalization to proportions. This functions trims on prevalence and total abundance to avoid instability of the algorithm. Covariate and confounder matrices are constructed, so that everything is passed on to the workhorse function RCM.NB() as matrices.

### Value

see `RCM_NB`

### See Also

`RCM_NB`,`plot.RCM`, `residualPlot`,`plotRespFun`

### Examples

    data(Zeller)
    require(phyloseq)
    tmpPhy = prune_taxa(taxa_names(Zeller)[1:100],
    prune_samples(sample_names(Zeller)[1:50], Zeller))
    zellerRCM = RCM(tmpPhy, round = TRUE)

[Package RCM version 1.8.0 Index]