Run Cluster-Specific Differential Expression Analysis
run_cluster_de.RdPerforms differential expression between two sample identities within each
specified cell-type cluster using Seurat::FindMarkers. Results are
filtered by adjusted p-value and absolute log2 fold-change thresholds, and
annotated with a regulation-direction label.
Usage
run_cluster_de(
obj,
clusters,
cluster_col = "final_celltype",
ident_col = "sample",
ident1,
ident2,
min.pct = 0.25,
padj_thresh = 0.05,
logfc_thresh = 0.5
)Arguments
- obj
A
Seuratobject containing the RNA assay and metadata columns specified bycluster_colandident_col.- clusters
Character vector of cluster names (values in the
cluster_colmetadata column) to iterate over.- cluster_col
Character string naming the metadata column that holds cell-type cluster assignments. Default
"final_celltype".- ident_col
Character string naming the metadata column to set as the active identity for the DE comparison (e.g.,
"sample","condition"). Default"sample".- ident1
Character string. The first identity level (numerator in the log fold-change calculation). Positive fold-changes indicate genes up-regulated in
ident1.- ident2
Character string. The second identity level (denominator).
- min.pct
Numeric. Minimum fraction of cells in either group that must express a gene for it to be tested. Passed to
Seurat::FindMarkers. Default0.25.- padj_thresh
Numeric. Maximum adjusted p-value for a gene to be retained in the filtered output. Default
0.05.- logfc_thresh
Numeric. Minimum absolute log2 fold-change for a gene to be retained. Default
0.5.