pseudobulk: Pseudobulk Seurat objects at whole sample or celltype level

View source: R/helperfunctions.R

pseudobulkR Documentation

Pseudobulk Seurat objects at whole sample or celltype level

Description

Pseudobulking is performed adding up gene expression values for each cell, for either cell types or whole sample.

Usage

pseudobulk(obj, grouping_colname_in_md, metadata, rawh5_path, assay, slot)

Arguments

obj
  • seurat object, or a matrix

grouping_colname_in_md
  • optional, a string, the column name of sobj@meta.data (if obj is a seurat object) or metadata (if using matrix and metadata input) to use as "cell types" or any other grouping for pseudobulking at group level. if not provided, pseudobulk the entire matrix. default, not used.

metadata
  • data.frame with cell metadata, similar to seuratobject@meta.data. pass this only if

rawh5_path
  • optional, a string, the path to a rawH5 file, if provided will use the raw matrix subsetted by cells in sobj; if not will just pseudobulk the seurat object. useful if some filtering was applied to seurat object but you want to pseudobulk the whole matrix without that filtering, but with only using cells in seurat object. Default is not to use this.

assay
  • optional, a string, the name of the Seurat object assay to pull matrix from if rawh5_path is not provided. Default is "RNA" assay

slot
  • optional, a string, the name of the Seurat object slot within the designated object assay to pull matrix from if rawh5_path is not provided. Default is "counts" slot

Value

a data.frame. if grouping_colname_in_md is provided, each celltype will have a pseudobulked column, if not the data.frame will just be one column for the whole sample matrix.


FerrenaAlexander/FerrenaSCRNAseq documentation built on March 10, 2023, 9:31 a.m.