用Seurat做RNA Velocity

作者: 生信编程日常 | 来源:发表于2020-04-04 22:42 被阅读0次

    安装加载相应的包

    devtools::install_github('satijalab/seurat-wrappers')
    library(Seurat)
    library(velocyto.R)
    library(SeuratWrappers)
    

    If you don't have velocyto's example mouse bone marrow dataset, download with the CURL command
    curl::curl_download(url = 'http://pklab.med.harvard.edu/velocyto/mouseBM/SCG71.loom', destfile = '~/Downloads/SCG71.loom')

    读入loom文件,并与分析基因表达矩阵一样的流程分析spliced文件

    ldat <- ReadVelocity(file = "~/Downloads/SCG71.loom")
    bm <- as.Seurat(x = ldat)
    bm <- SCTransform(object = bm, assay = "spliced")
    bm <- RunPCA(object = bm, verbose = FALSE)
    bm <- FindNeighbors(object = bm, dims = 1:20)
    bm <- FindClusters(object = bm)
    bm <- RunUMAP(object = bm, dims = 1:20)
    

    将velocity变化显示在分群数据上

    bm <- RunVelocity(object = bm, deltaT = 1, kCells = 25, fit.quantile = 0.02)
    ident.colors <- (scales::hue_pal())(n = length(x = levels(x = bm)))
    names(x = ident.colors) <- levels(x = bm)
    cell.colors <- ident.colors[Idents(object = bm)]
    names(x = cell.colors) <- colnames(x = bm)
    show.velocity.on.embedding.cor(emb = Embeddings(object = bm, reduction = "umap"), vel = Tool(object = bm, 
        slot = "RunVelocity"), n = 200, scale = "sqrt", cell.colors = ac(x = cell.colors, alpha = 0.5), 
        cex = 0.8, arrow.scale = 3, show.grid.flow = TRUE, min.grid.cell.mass = 0.5, grid.n = 40, arrow.lwd = 1, 
        do.par = FALSE, cell.border.alpha = 0.1)
    
    image.png

    欢迎关注~


    公众号二维码.jpg

    参考:
    https://htmlpreview.github.io/?https://github.com/satijalab/seurat-wrappers/blob/master/docs/velocity.html

    相关文章

      网友评论

        本文标题:用Seurat做RNA Velocity

        本文链接:https://www.haomeiwen.com/subject/oxvsphtx.html