sc-RAN-seq 数据分析||Seurat 3.1 :UMA
Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation' This message will be shown once per session
原因在于:
https://github.com/satijalab/seurat/issues/2025
For a comparison of uwot
with the python implementation of umap, please see this part of the uwot documentation. Based on this, it is expected that the two different implementations won't always agree but we can't really advise on which you "should use". We opted to move the default version to uwot
as it seemed generally comparable in terms of results/runtime while also hopefully making installation a bit simpler (there were quite a number of issues from people trying to link their python packages with R). We did leave both options to maintain reproducibility for those wanting to regenerate old plots.
library(Seurat)
library(ggplot2)
pbmc.data <- Read10X(data.dir = "D:\\Users\\Administrator\\Desktop\\RStudio\\single_cell\\filtered_gene_bc_matrices\\hg19")
pbmc <- CreateSeuratObject(counts = pbmc.data, project = "pbmc3k", min.cells = 3, min.features = 200)
pbmc <- NormalizeData(pbmc, normalization.method = "LogNormalize", scale.factor = 10000)
pbmc <- FindVariableFeatures(pbmc, selection.method = "vst", nfeatures = 2000)
pbmc <- ScaleData(pbmc,features=VariableFeatures(pbmc))
pbmc <- RunPCA(pbmc, features = VariableFeatures(object = pbmc))
pbmc@meta.data
pbmc <- FindNeighbors(pbmc, dims = 1:10)
pbmc <- FindClusters(pbmc, resolution = 0.5)
pbmc <- RunUMAP(pbmc, dims = 1:10)
p0<-DimPlot(pbmc, reduction = "umap")+ggtitle("UWOT")
pbmc <- RunTSNE(pbmc, dims = 1:10)
pbmc <- RunUMAP(pbmc, dims = 1:10,umap.method = "umap-learn",metric = "correlation")
p1<-DimPlot(pbmc, reduction = "umap")+ggtitle("umap-learn")
CombinePlots(plots = list(p0,p1),legend="bottom")
V 3.0.2
RunUMAP(object, ...)
## Default S3 method:
RunUMAP(object, assay = NULL, n.neighbors = 30L,
n.components = 2L, metric = "correlation", n.epochs = NULL,
learning.rate = 1, min.dist = 0.3, spread = 1,
set.op.mix.ratio = 1, local.connectivity = 1L,
repulsion.strength = 1, negative.sample.rate = 5, a = NULL,
b = NULL, seed.use = 42, metric.kwds = NULL,
angular.rp.forest = FALSE, reduction.key = "UMAP_", verbose = TRUE,
...)
## S3 method for class 'Graph'
RunUMAP(object, assay = NULL, n.components = 2L,
metric = "correlation", n.epochs = 0L, learning.rate = 1,
min.dist = 0.3, spread = 1, repulsion.strength = 1,
negative.sample.rate = 5L, a = NULL, b = NULL, seed.use = 42L,
metric.kwds = NULL, verbose = TRUE, reduction.key = "UMAP_", ...)
## S3 method for class 'Seurat'
RunUMAP(object, dims = NULL, reduction = "pca",
features = NULL, graph = NULL, assay = "RNA", n.neighbors = 30L,
n.components = 2L, metric = "correlation", n.epochs = NULL,
learning.rate = 1, min.dist = 0.3, spread = 1,
set.op.mix.ratio = 1, local.connectivity = 1L,
repulsion.strength = 1, negative.sample.rate = 5L, a = NULL,
b = NULL, seed.use = 42L, metric.kwds = NULL,
angular.rp.forest = FALSE, verbose = TRUE, reduction.name = "umap",
reduction.key = "UMAP_", ...)
3.1.0
Usage
RunUMAP(object, ...)
## Default S3 method:
RunUMAP(object, assay = NULL, umap.method = "uwot",
n.neighbors = 30L, n.components = 2L, metric = "cosine",
n.epochs = NULL, learning.rate = 1, min.dist = 0.3, spread = 1,
set.op.mix.ratio = 1, local.connectivity = 1L,
repulsion.strength = 1, negative.sample.rate = 5, a = NULL,
b = NULL, seed.use = 42, metric.kwds = NULL,
angular.rp.forest = FALSE, reduction.key = "UMAP_", verbose = TRUE,
...)
## S3 method for class 'Graph'
RunUMAP(object, assay = NULL,
umap.method = "umap-learn", n.components = 2L,
metric = "correlation", n.epochs = 0L, learning.rate = 1,
min.dist = 0.3, spread = 1, repulsion.strength = 1,
negative.sample.rate = 5L, a = NULL, b = NULL, seed.use = 42L,
metric.kwds = NULL, verbose = TRUE, reduction.key = "UMAP_", ...)
## S3 method for class 'Seurat'
RunUMAP(object, dims = NULL, reduction = "pca",
features = NULL, graph = NULL, assay = "RNA",
umap.method = "uwot", n.neighbors = 30L, n.components = 2L,
metric = "cosine", n.epochs = NULL, learning.rate = 1,
min.dist = 0.3, spread = 1, set.op.mix.ratio = 1,
local.connectivity = 1L, repulsion.strength = 1,
negative.sample.rate = 5L, a = NULL, b = NULL, seed.use = 42L,
metric.kwds = NULL, angular.rp.forest = FALSE, verbose = TRUE,
reduction.name = "umap", reduction.key = "UMAP_", ...)