R04

2021-08-09  本文已影响0人  rong酱
#! /path/to/Rscript

library(Seurat)
library(dplyr)
library(ggplot2)

rds <- readRDS('Merge.Rdata')
rds1 <- FindNeighbors(rds, dims = 1:10)
rds2 <- FindClusters(rds1, resolution = 0.5)  # resolution 值不同,可以改变分群个数
table(rds2@active.ident) # 可以显示 分多少群
#subpbmc<-subset(x = rds2,idents="2")
#subbset<-subset(x=rds2,cells=colnames(rds2@assays$RNA@counts)[1:30])
#treerds<-BuildClusterTree(rds2)
#PlotClusterTree(treerds)
#install.packages('ape')
#library('ape')
rds4<-CalculateBarcodeInflections(rds2)
#SubsetByBarcodeInflections(rds4)

umaprds4 <- RunUMAP(rds4, dims = 1:10)
head(umaprds4@reductions$umap@cell.embeddings)
tsnerds4 <- RunTSNE(umaprds4, dims = 1:10)
rdsallmarkers <- FindAllMarkers(tsnerds4, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.25)
write.table(rdsallmarkers,'/tp/marker.txt',sep = '\t', row.names = FALSE, col.names = TRUE, quote = FALSE)
上一篇 下一篇

猜你喜欢

热点阅读