prepareSeurat: prepareSeurat

View source: R/scAnnotation.R

prepareSeuratR Documentation

prepareSeurat

Description

According to the QC results of scStatistics, filter cells and genes. Prepare a Seurat object.

Usage

prepareSeurat(
  dataPath,
  statPath,
  savePath,
  sampleName = "sc",
  bool.filter.cell = T,
  bool.filter.gene = T,
  anno.filter = c("mitochondrial", "ribosome", "dissociation"),
  nCell.min = 3,
  bgPercent.max = 1,
  hg.mm.mix = F,
  bool.rmContamination = T,
  vars.add.meta = c("mito.percent", "ribo.percent", "diss.percent"),
  vars.to.regress = c("nCount_RNA", "mito.percent", "ribo.percent")
)

Arguments

dataPath

A path containing the cell ranger processed data. Under this path, folders 'filtered_feature_bc_matrix' and 'raw_feature_bc_matrix' exist generally.

statPath

A path containing the results files of step 'runScStatistics'.

savePath

A path to save the results files. If NULL, the 'statPath' will be used instead.

sampleName

A character string giving a label for this sample.

bool.filter.cell

A logical value indicating whether to filter the cells according to the QC of 'scStatistics'.

bool.filter.gene

A logical value indicating whether to filter the genes according to the QC of 'scStatistics'.

anno.filter

A vector indicating the types of genes to be filtered. Must be some of c("mitochondrial", "ribosome", "dissociation")(default) or NULL.

nCell.min

An integer number used to filter gene. The default is 3. Genes with the number of expressed cells less than this threshold will be filtered.

bgPercent.max

A float number used to filter gene. The default is 1 (no filtering). Genes with the background percentage larger than this threshold will be filtered.

hg.mm.mix

A logical value indicating whether the sample is a mix of human cells and mouse cells(such as PDX sample). If TRUE, the arguments 'hg.mm.thres' and 'mix.anno' should be set to corresponding values.

bool.rmContamination

A logical value indicating whether to remove ambient RNA contamination based on 'SoupX'.

vars.add.meta

A vector indicating the variables to be added to Seurat object's meta.data. The default is c("mito.percent", "ribo.percent", "diss.percent").

vars.to.regress

A vector indicating the variables to regress out in R package Seurat. The default is c("nCount_RNA", "mito.percent", "ribo.percent").

Value

A list of Seurat object and gene.manifest. The Seurat object is after log-normalization, highly variable genes identification, scaling data.


wguo-research/scCancer documentation built on May 26, 2024, 9:12 p.m.