You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' @title Neighbourhood-based multiple linear regression of gene expression values
249
-
#' @name nb_lm
250
-
#' @description
251
-
#' Fit a multiple linear regression for a gene of interest using neighbourhood cell count for each cell type as independent variables
252
-
#'
253
-
#' @details
254
-
#' This function is based on fastLm() function from RcppEigen pakage. In case user wanted to include one or more confounfing (random) variables into the model,
255
-
#' the function lmer() in instead used to fit a mixed effect model. In both cases, the output is a data frame reporting regression coefficient and pvalue for each independent variable.
256
-
#'
257
-
#' @param seurat a Seurat object containing Kandinsky data slot
258
-
#' @param label character string specifying the name of the variable to be used for cell type annotation.
259
-
#' @param which name of the cell type to consider for fitting linear models. Currently only one cell type is accepted as input
260
-
#' @param features character vector containing gene identifiers to be fitted
261
-
#' @param layer name of Seurat layer to use for gene expression data
262
-
#' @param rand name of random variables to be included in a mixed effect model.
263
-
#' @param minprop numeric, genes expressed in less than this proportion of cells will be excluded from the analysis
264
-
#'
265
-
#' @returns data frame reporting, for each gene, the regression coefficient and p-value associated with each cell type
#' For each gene expressed within a dataset, given a cell type of interest,
435
-
#' this function will calculate a contamination score expressed as the fold change between the average expression of each cell belonging to the defined cell type
436
-
#' and the average expression of their neighbouring cells defined by Kandinsky belonging to different cell types. A high or low contamination score indicates a lower or higher expression of a gene within a cell than its neighbouring cells, respectively.
437
-
#'
438
-
#' @param seurat Seurat object containing Kandinsky data slot
439
-
#' @param label character string indicating meta data variable containing cell type annotation
440
-
#' @param which character vector indicating for which cell type the gene contamination scores will be calculated
441
-
#' @returns named vector of contamination scores, with each score named with its corresponding gene symbol
0 commit comments