markersPathology: Determines associations between cell type estimates and...

Description Usage Arguments Value References Examples

View source: R/bretMarkerEffectOnPathology.R

Description

A function that runs a linear model on the cell-type proportion estimates by BRETIGEA.

Usage

1
markersPathology(markerMat, metadata, covar, pathologyName, cellTypeNames)

Arguments

markerMat

The $SPVS of the return of findCellsMod once converted to a dataframe with the first column being Sample corresponding to the metadata Sample id. (Dataframe with Sample column and then estimate of cell type proportion calculated by BRETIGEA findCells for each cell type in cellTypeNames)

metadata

A dataframe with subjects also in countDf and rows indicating the subjects id, some covariate, and disease state score or pathology.

covar

A covariate to be taken into account when running linear models to check the association between the cell type indicated by cell and the pathology indicated by pathologyNames.

pathologyName

The pathology associated with the disease in question for which the association between it and the cell type indicated by cell is being examined.

cellTypeNames

The names of all the unique cell types for which there are markers in bretCellMarkers: unique(bretCellMarkers$cell)

Value

Returns a matrix array ready to be formatted by bretigeaMarkersAddition

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.

Chambers, J. M. and Hastie, T. J. (1992) Statistical Models in S, Wadsworth & Brooks/Cole.

R Core Team (2020). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.

Wilkinson, G. N. and Rogers, C. E. (1973). Symbolic descriptions of factorial models for analysis of variance. Applied Statistics, 22, 392–399. doi: 10.2307/2346786.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# Examples 1:
# Using bretCellMarkers, metadata datasets available with package

rownames(countDf) <- countDf$Gene
countDf <- countDf[,-1]
bretigeaMarkers <- findCellsMod(
               inputMat = countDf,
               markers = bretCellMarkers,
               nMarker = 10,
               method = "SVD",
               scale = TRUE)
markerMat <- as.data.frame(bretigeaMarkers$SPVS)
markerMat <- tibble::rownames_to_column(markerMat, var = 'Sample')
markersPathologyResults <- markersPathology(
                      markerMat = markerMat,
                      metadata = metadata,
                      covar = "Covariate",
                      pathologyName = "DiseasePhenotypeScore",
                      cellTypeNames = unique(bretCellMarkers$cell))

meconsens/CellTyPETool documentation built on Jan. 1, 2021, 9:25 a.m.