projectR {projectR} | R Documentation

## Generic projectR function

### Description

A function for the projection of new data into a previously defined feature space.

### Usage

    projectR(data, loadings, dataNames = NULL, loadingsNames = NULL, ...)

    ## S4 method for signature 'matrix,matrix'
    projectR(
      data,
      loadings,
      dataNames = NULL,
      loadingsNames = NULL,
      NP = NA,
      full = FALSE,
      family = "gaussianff",
      bootstrapPval = FALSE,
      bootIter = 1000
    )

    ## S4 method for signature 'matrix,LinearEmbeddingMatrix'
    projectR(
      data,
      loadings,
      dataNames = NULL,
      loadingsNames = NULL,
      NP = NA,
      full = FALSE,
      model = NA,
      family = "gaussianff",
      bootstrapPval = FALSE,
      bootIter = 1000
    )

    ## S4 method for signature 'matrix,prcomp'
    projectR(
      data,
      loadings,
      dataNames = NULL,
      loadingsNames = NULL,
      NP = NA,
      full = FALSE
    )

    ## S4 method for signature 'matrix,rotatoR'
    projectR(
      data,
      loadings,
      dataNames = NULL,
      loadingsNames = NULL,
      NP = NA,
      full = FALSE
    )

    ## S4 method for signature 'matrix,correlateR'
    projectR(
      data,
      loadings,
      dataNames = NULL,
      loadingsNames = NULL,
      NP = NA,
      full = FALSE,
      bootstrapPval = FALSE,
      bootIter = 1000
    )

    ## S4 method for signature 'matrix,hclust'
    projectR(
      data,
      loadings,
      dataNames = NULL,
      loadingsNames = NULL,
      full = FALSE,
      targetNumPatterns,
      sourceData,
      bootstrapPval = FALSE,
      bootIter = 1000
    )

    ## S4 method for signature 'matrix,kmeans'
    projectR(
      data,
      loadings,
      dataNames = NULL,
      loadingsNames = NULL,
      full = FALSE,
      sourceData,
      bootstrapPval = FALSE,
      bootIter = 1000
    )

### Arguments

`data` | Target dataset into which you will project. It must of type matrix.
`loadings` | loadings learned from source dataset.
`dataNames` | a vector containing unique name, i.e. gene names, for the rows of the target dataset to be used to match features with the loadings, if not provided by `rownames(data)`. Order of names in vector must match order of rows in data.
`loadingsNames` | a vector containing unique names, i.e. gene names, for the rows ofloadings to be used to match features with the data, if not provided by `rownames(loadings)`. Order of names in vector must match order of rows in loadings.
`...` | Additional arguments to projectR
`NP` | vector of integers indicating which columns of loadings object to use. The default of NP=NA will use entire matrix.
`full` | logical indicating whether to return the full model solution. By default only the new pattern object is returned.
`family` | VGAM family function for model fitting (default: "gaussianff")
`bootstrapPval` | logical to indicate whether to generate p-values using bootstrap, not available for prcomp and rotatoR objects
`bootIter` | number of bootstrap iterations, default = 1000
`model` | Optional arguements to choose method for projection
`targetNumPatterns` | desired number of patterns with hclust
`sourceData` | data used to create cluster object

### Details

`loadings` can belong to one of several classes depending on upstream analysis. Currently permitted classes are `matrix`, `CogapsResult`, `CoGAPS`, `pclust`, `prcomp`, `rotatoR`, and `correlateR`.

### Value

A matrix of sample weights for each input basis in the loadings matrix (if full=TRUE, full model solution is returned).

### Examples

    projectR(data=p.ESepiGen4c1l$mRNA.Seq,loadings=AP.RNAseq6l3c3t$Amean,
    dataNames = map.ESepiGen4c1l[["GeneSymbols"]])

    library("CoGAPS")
    CR.RNAseq6l3c3t <- CoGAPS(p.RNAseq6l3c3t, params = new("CogapsParams",
    nPatterns=5))
    projectR(data=p.ESepiGen4c1l$mRNA.Seq,loadings=CR.RNAseq6l3c3t,
    dataNames = map.ESepiGen4c1l[["GeneSymbols"]])

    pca.RNAseq6l3c3t<-prcomp(t(p.RNAseq6l3c3t))
    pca.ESepiGen4c1l<-projectR(data=p.ESepiGen4c1l$mRNA.Seq,
    loadings=pca.RNAseq6l3c3t, dataNames = map.ESepiGen4c1l[["GeneSymbols"]])

    pca.RNAseq6l3c3t<-prcomp(t(p.RNAseq6l3c3t))
    r.RNAseq6l3c3t<-rotatoR(1,1,-1,-1,pca.RNAseq6l3c3t$rotation[,1:2])
    pca.ESepiGen4c1l<-projectR(data=p.ESepiGen4c1l$mRNA.Seq,
    loadings=r.RNAseq6l3c3t, dataNames = map.ESepiGen4c1l[["GeneSymbols"]])

    c.RNAseq6l3c3t<-correlateR(genes="T", dat=p.RNAseq6l3c3t, threshtype="N",
    threshold=10, absR=TRUE)
    cor.ESepiGen4c1l<-projectR(data=p.ESepiGen4c1l$mRNA.Seq, loadings=c.RNAseq6l3c3t,
    NP="PositiveCOR", dataNames = map.ESepiGen4c1l[["GeneSymbols"]])

[Package projectR version 1.4.0 Index]