Run scMalignantFinder malignant spatial region identification
Source:R/RunscMalignantFinder.R
RunscMalignantRegion.RdUse scMalignantFinder spatial utilities to score malignant signatures and
infer malignant spatial regions. For Seurat input, provide spatial.cols
when spatial-neighborhood refinement is requested and the converted AnnData
object does not already contain spatial coordinates.
Usage
RunscMalignantRegion(
srt = NULL,
adata = NULL,
h5ad = NULL,
assay = "RNA",
layer = "counts",
cells = NULL,
signature_gmt,
features = NULL,
nclus = 3,
define_feature = "Malignant_up",
spatial_nn = TRUE,
spatial.cols = NULL,
spatial_key = "spatial",
image = FALSE,
norm_type = NULL,
prefix = "scMalignantFinder_",
return_seurat = !is.null(srt),
verbose = TRUE
)Arguments
- srt
A Seurat object.
- adata
Optional Python AnnData object.
- h5ad
Optional path to an
.h5adfile.- assay
Assay used when
srtis supplied. Default is"RNA".- layer
Layer used when
srtis supplied. Default is"counts".- cells
Optional cells to run. If supplied with
srt, results are appended to these cells and other cells receiveNA.- signature_gmt
Path to the malignant signature
.gmtfile, such assc_malignant_deg.gmtfrom the scMalignantFinder resources.- features
Features in
adata.obsused for region clustering. IfNULL, usesmalignancy_probabilityandMalignant_up, plusimage_scorewhenimage = TRUE.- nclus
Number of clusters used by the spatial region model.
- define_feature
Feature used to select the malignant region cluster.
- spatial_nn
Whether to refine labels by spatial neighbors.
- spatial.cols
Optional two metadata columns used as spatial coordinates for Seurat input.
- spatial_key
Key written to
adata.obsmfor spatial coordinates.- image
Whether to call
scMalignantFinder.spatial.image_cal. Default isFALSEbecause Seurat-to-AnnData conversion does not generally carry histology images.- norm_type
Passed to
scMalignantFinder. UseTRUEfor raw counts that should be library-size normalized; useFALSEfor already normalized input. IfNULL, defaults toTRUEonly for Seurat counts input.- prefix
Optional prefix for output metadata columns. Default preserves the original
scMalignantFindercolumn names.- return_seurat
Whether to return a Seurat object when
srtis supplied. IfFALSE, returns a data frame of predictions.- verbose
Whether to print the message. Default is
TRUE.
Examples
if (FALSE) {
srt <- RunscMalignantRegion(
srt,
signature_gmt = "path/to/sc_malignant_deg.gmt",
spatial.cols = c("x", "y")
)
}