Title: | A Wrapper for 'Seurat' and Related R Packages for End-to-End Single Cell Analysis |
Version: | 0.2.0.0 |
Author: | Viswanadham Sridhara
|
Maintainer: | Viswanadham Sridhara <Sridhara.Omics@gmail.com> |
Description: | Reports markers list, differentially expressed genes, associated pathways, cell-type annotations, does batch correction and other related single cell analyses all wrapped within 'Seurat'. |
Imports: | Seurat, batchelor, dplyr, ReactomeGSA, celldex, SingleR, SummarizedExperiment, biomaRt, magrittr, rlang |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
VignetteBuilder: | knitr |
Suggests: | knitr, rmarkdown |
NeedsCompilation: | no |
Packaged: | 2025-03-05 20:54:01 UTC; vishs |
Repository: | CRAN |
Date/Publication: | 2025-03-07 11:40:06 UTC |
Annotate cells in a Seurat object using SingleR with Celldex
Description
This function annotates the cells in a Seurat object using the SingleR package with reference data obtained from the Celldex package.
Usage
AnnotateCellsWithSingleR(seurat_object, reference_data = NULL, assay = "RNA")
Arguments
seurat_object |
A Seurat object to be annotated. |
reference_data |
A reference dataset to use for annotation (e.g., HumanPrimaryCellAtlasData from Celldex). If NULL, HumanPrimaryCellAtlasData is used by default. |
assay |
The assay in the Seurat object to use for annotation. Default is "RNA". |
Value
The Seurat object with cell annotations added to the metadata.
Convert Gene Identifiers in a Seurat Object
Description
This function takes a Seurat object with gene identifiers as row names (e.g., RefSeq, Ensembl, Entrez) and converts those identifiers to gene symbols (or Ensembl Gene IDs) using the biomaRt package. The function can handle various types of gene identifiers and returns a Seurat object with updated row names.
Usage
ConvertGeneIdentifiers(
seurat_object,
id_type = "refseq",
to_id_type = "symbol"
)
Arguments
seurat_object |
A Seurat object. The row names of the Seurat object's data or assay slot should represent gene identifiers (e.g., RefSeq, Ensembl, or Entrez IDs). |
id_type |
A string specifying the type of the input gene identifiers. Options are: "refseq", "ensembl", "entrez". Default is "refseq". |
to_id_type |
A string specifying the type of output gene identifiers. Options are: "symbol", "ensembl". Default is "symbol". |
Value
A Seurat object with updated gene names (row names) based on the specified conversion.
Examples
# Read 10X counts data from matrix.mtx, barcodes.tsv and genes.tsv
library(Seurat)
counts <- Read10X(data.dir = "../inst/extdata", gene.column = 1)
# Create Seurat object without batch correction
seurat_obj <- SeuratPreprocess(counts)
seurat_obj <- SeuratLowDim(seurat_obj)
# Convert RefSeq IDs to gene symbols
seurat_obj_converted <- ConvertGeneIdentifiers(
seurat_obj,
id_type = "refseq",
to_id_type = "symbol"
)
Reactome Data Analysis for Seurat Object
Description
This function performs pathway analysis using ReactomeGSA on a Seurat object with cluster information.
Usage
ReactomeData(lowdim_seurat_object)
Arguments
lowdim_seurat_object |
Seurat object that has clusters information |
Value
A list containing:
- GSVA result (gsva_result
)
- Pathway expression data (pathway_expression
)
- Max difference between pathway expression values (max_difference
)
Examples
library(Seurat)
# Read 10X counts data from matrix.mtx, barcodes.tsv and genes.tsv
counts <- Read10X(data.dir = "../inst/extdata", gene.column = 1)
# Create Seurat object without batch correction
seurat_obj <- SeuratPreprocess(counts)
seurat_obj <- SeuratLowDim(seurat_obj)
# Reactome Analysis
seurat_reactome <- ReactomeData(seurat_obj)
Create a Low dimensional Seurat object from scaled seurat object
Description
This function converts the transformed data to low-dimensional data for downstream analysis.
Usage
SeuratLowDim(scaled_seurat_object, ...)
Arguments
scaled_seurat_object |
A scaled Seurat object. |
... |
Additional arguments to be passed for downstream analyses. |
Value
A Seurat object.
Examples
library(Seurat)
# Read 10X counts data from matrix.mtx, barcodes.tsv and genes.tsv
counts <- Read10X(data.dir = "../inst/extdata", gene.column = 1)
# Create Seurat object without batch correction
seurat_obj <- SeuratPreprocess(counts)
seurat_obj <- SeuratLowDim(seurat_obj)
A thresholded markers list for better calculation of DE genes
Description
This function calculates differentially expressed genes using Seurat::FindAllMarkers.
Usage
SeuratMarkers(lowdim_seurat_object)
Arguments
lowdim_seurat_object |
Seurat object with cluster information |
Value
A list containing two marker lists:
- Full markers list
- Thresholded markers list with min.pct = 0.1
Examples
library(Seurat)
# Read 10X counts data from matrix.mtx, barcodes.tsv and genes.tsv
counts <- Read10X(data.dir = "../inst/extdata", gene.column = 1)
# Create Seurat object without batch correction
seurat_obj <- SeuratPreprocess(counts)
seurat_obj <- SeuratLowDim(seurat_obj)
# Create Markers list
seurat_markers <- SeuratMarkers(seurat_obj)
Preprocess count data and create a Seurat object
Description
This function preprocesses count data, optionally applying batch correction using batchelor::fastMNN, and creates a Seurat object.
Usage
SeuratPreprocess(
counts_data,
meta.data = NULL,
batch_column = NULL,
use_fastMNN = FALSE,
...
)
Arguments
counts_data |
A matrix or data frame of count data. |
meta.data |
A data frame containing metadata to include in the Seurat object. Default is NULL. |
batch_column |
A vector or factor specifying batch assignments for each cell. Default is NULL. |
use_fastMNN |
Logical. Whether to apply batch correction using fastMNN. Default is FALSE. |
... |
Additional arguments to be passed to Seurat::CreateSeuratObject. |
Value
A Seurat object.
Examples
library(Seurat)
# Read 10X counts data from matrix.mtx, barcodes.tsv and genes.tsv
counts <- Read10X(data.dir = "../inst/extdata", gene.column = 1)
# Create Seurat object without batch correction
seurat_obj <- SeuratPreprocess(counts)
Transfer annotations to Seurat clusters
Description
This function assigns cluster-level annotations in a Seurat object based on the majority annotation of cells within each cluster.
Usage
TransferAnnotations(seurat_object, annotation_col, cluster_col, output_col)
Arguments
seurat_object |
Seurat object containing cluster and annotation information. |
annotation_col |
The name of the metadata column with annotations (character string). |
cluster_col |
The name of the metadata column with cluster information (character string). |
output_col |
The name of the output column to store cluster annotations (character string). |
Value
The Seurat object with an additional column in its metadata, specified by output_col
.