美文网首页测试软件
空间转录组数据分析软件推荐---SpaCET

空间转录组数据分析软件推荐---SpaCET

作者: 单细胞空间交响乐 | 来源:发表于2023-02-09 14:34 被阅读0次

    作者,Evil Genius

    这一篇给大家推荐一个空转分析的优秀软件---SpaCET,文章在Estimation of cell lineages in tumors from spatial transcriptomics data,2023年1月发表于NC,个人感觉软件集中了空转分析的重要功能,包括细胞互作和共定位,软件在SpaCET

    SpaCET是一个R包,用于分析癌症空间转录组学(ST)数据集,以估计肿瘤微环境中的细胞谱系和细胞间相互作用。简单地说,SpaCET首先通过整合常见恶性肿瘤的基因模式来估计癌细胞的丰度。SpaCET随后使用约束回归模型校准局部组织密度,并确定基质细胞和免疫细胞谱系分数。此外,SpaCET可以揭示肿瘤微环境中假定的细胞-细胞相互作用。此外,SpaCET可以整合匹配的scRNA-seq数据集作为自定义参考来进行细胞类型反卷积。

    安装
    # install.packages("devtools")
    devtools::install_github("data2intelligence/SpaCET")
    

    示例一、依据内置数据集分析空间数据

    创建对象(10X数据)
    library(SpaCET)
    
    # set the path to the in-house breast cancer ST data. User can set the paths to their own data.
    visiumPath <- file.path(system.file(package = "SpaCET"), "extdata/Visium_BC")
    
    # load ST data to create an SpaCET object.
    SpaCET_obj <- create.SpaCET.object.10X(visiumPath = visiumPath)
    
    # show this object.
    str(SpaCET_obj)
    # show this object.
    SpaCET_obj@input$counts[1:8,1:6]
    ## 8 x 6 sparse Matrix of class "dgCMatrix"
    ##             50x102 59x19 14x94 47x13 73x43 61x97
    ## MIR1302-2HG      .     .     .     .     .     .
    ## FAM138A          .     .     .     .     .     .
    ## OR4F5            .     .     .     .     .     .
    ## AL627309.1       .     .     .     .     .     1
    ## AL627309.3       .     .     .     .     .     .
    ## AL627309.2       .     .     .     .     .     .
    ## AL627309.4       .     .     .     .     .     .
    ## AL732372.1       .     .     .     .     .     .
    
    展示基础信息
    # calculate the QC metrics
    SpaCET_obj <- SpaCET.quality.control(SpaCET_obj)
    
    # plot the QC metrics
    SpaCET.visualize.spatialFeature(
      SpaCET_obj, 
      spatialType = "QualityControl", 
      spatialFeatures=c("UMI","Gene")
    )
    
    图片.png
    Deconvolve ST data

    通过两个阶段,SpaCET.deconvolution将所有ST spot的混合物分解为恶性细胞、免疫细胞和基质细胞。SpaCET首先通过拷贝数改变(CNA)的基因模式和常见恶性肿瘤的表达变化来估计恶性细胞的比例。随后,基于来自不同癌症类型的单细胞RNA-seq数据集的内部分层细胞谱系,使用约束回归模型来确定免疫和基质细胞分数,并包括一个无法识别的组件来校准跨组织区域的细胞密度变化

    具体来说,需要使用cancerType参数指定该肿瘤ST数据集中的癌症类型,利用该参数选择癌症类型特异性的CNA或表达特征来推断恶性细胞分数。癌症类型的代码可以在下拉列表中找到。当将ST点的表达谱与癌症类型特异性标记相关联时,将癌症类型特异性CNA标记作为第一选项,因为染色体不稳定性被广泛认为是人类肿瘤的一个一致特征。或者,如果没有点与CNA特征强相关,癌症类型特异性表达特征将被激活。这种情况可能是由于低CNA的染色体稳定的癌细胞。对于数据集中未包含的癌症类型,通过平均所有癌症类型特异性表达特征来创建泛癌症表达特征。

    How many caner types are in the gene pattern dictionary?
    # deconvolve ST data
    SpaCET_obj <- SpaCET.deconvolution(SpaCET_obj, cancerType="BRCA", coreNo=8)
    
    # show the ST deconvolution results
    SpaCET_obj@results$deconvolution$propMat[1:13,1:6]
    
    ##                   50x102 59x19        14x94        47x13        73x43
    ## Malignant   2.860636e-01     1 6.845966e-02 3.899756e-01 9.608802e-01
    ## CAF         3.118545e-01     0 3.397067e-01 1.111980e-01 3.372692e-02
    ## Endothelial 5.510895e-02     0 1.427060e-01 3.080531e-02 5.263544e-03
    ## Plasma      2.213392e-02     0 1.507382e-02 1.183170e-02 9.071809e-06
    ## B cell      3.885793e-03     0 9.271616e-02 1.406470e-01 1.329085e-06
    ## T CD4       1.344389e-01     0 1.554305e-02 1.249414e-01 1.112392e-05
    ## T CD8       7.578696e-03     0 2.514558e-07 1.379856e-03 1.123043e-06
    ## NK          7.104005e-04     0 1.670019e-06 4.890387e-08 3.562557e-07
    ## cDC         1.421632e-07     0 8.278023e-02 7.584295e-02 2.851146e-07
    ## pDC         1.606443e-06     0 2.283754e-02 1.805671e-02 3.878344e-07
    ## Macrophage  1.703304e-01     0 5.021248e-02 9.531511e-02 9.253645e-07
    ## Mast        7.905067e-08     0 1.621498e-05 1.333430e-07 1.162099e-07
    ## Neutrophil  1.380073e-05     0 9.528996e-07 1.167503e-08 9.908635e-05
    
    可视化
    # show the spatial distribution of malignant cells and macrophages.
    SpaCET.visualize.spatialFeature(
      SpaCET_obj, 
      spatialType = "CellFraction", 
      spatialFeatures=c("Malignant","Macrophage")
    )
    
    # show the spatial distribution of all cell types.
    SpaCET.visualize.spatialFeature(
      SpaCET_obj, 
      spatialType = "CellFraction", 
      spatialFeatures="All", 
      pointSize = 0.1, 
      nrow=5
    )
    
    图片.png
    细胞互作
    识别细胞共定位

    SpaCET provides SpaCET.CCI.colocalization and SpaCET.visualize.colocalization to compute and visualize the co-localized cell-type pairs.

    # calculate the cell-cell colocalization.
    SpaCET_obj <- SpaCET.CCI.colocalization(SpaCET_obj)
    
    # visualize the cell-cell colocalization.
    SpaCET.visualize.colocalization(SpaCET_obj)
    
    Analyze the L-R network enrichment within ST spots

    细胞共定位并不直接表明物理相互作用。因此,我们通过分析ST点内配体-受体(L-R)的相互作用来寻求细胞-细胞相互作用的进一步证据。

    # calculate the L-R network score across ST spots.
    SpaCET_obj <- SpaCET.CCI.LRNetworkScore(SpaCET_obj,coreNo=8)
    
    # visualize the L-R network score.
    SpaCET.visualize.spatialFeature(
      SpaCET_obj, 
      spatialType = "LRNetworkScore", 
      spatialFeatures=c("Network_Score","Network_Score_pv")
    )
    

    每个ST点的L-R网络评分表明了每个位置配体-受体相互作用的总体强度,而不是两种细胞类型之间的具体相互作用。因此,SpaCET进一步对每个细胞类型对进行了L-R网络评分的富集分析。例如,对于CAF和M2细胞在乳腺肿瘤组织中的共定位,SpaCET将所有ST点分为四类:CAF-M2共定位,CAF或M2占主导。分析发现,CAF- m2共定位点比CAF/ m2主导点具有更实质性的L-R交互网络评分。


    Enrich cell-cell interactions at the tumor-immune interface
    # Identify the Tumor-Stroma Interface
    SpaCET_obj <- SpaCET.identify.interface(SpaCET_obj)
    
    # Visualize the Interface
    SpaCET.visualize.spatialFeature(SpaCET_obj, spatialType = "Interface")
    
    # Compute the distance of CAF-M2 to tumor border
    SpaCET.distance.to.interface(SpaCET_obj, cellTypePair=c("CAF", "Macrophage M2"))
    
    Explore cancer cell states

    肿瘤细胞的基因表达谱(即癌细胞状态)由肿瘤细胞的遗传背景和周围环境的细胞-细胞相互作用共同决定。作为探索性扩展,SpaCET可以自动探索不同癌细胞状态的空间分布。

    # further deconvolve malignant cell states
    SpaCET_obj <- SpaCET.deconvolution.malignant(SpaCET_obj, malignantCutoff = 0.7, coreNo = 8)
    
    # show cancer cell state fraction of the first five spots
    SpaCET_obj@results$deconvolution$propMat[c("Malignant cell state A","Malignant cell state B"),1:6]
    
    ##                           50x102        59x19        14x94     47x13        73x43     61x97
    ## Malignant cell state A 0.2295498 9.999900e-01 6.845962e-02 0.2038680 9.608802e-01 0.6517794
    ## Malignant cell state B 0.0565137 1.239573e-11 3.921715e-08 0.1861075 2.340661e-09 0.2675332
    
    SpaCET.visualize.spatialFeature(
      SpaCET_obj, 
      spatialType = "CellFraction", 
      spatialFeatures=c("Malignant","Malignant cell state A","Malignant cell state B"), 
      nrow=1
    )
    

    示例二、依据匹配的单细胞数据集分析空间数据

    library(SpaCET)
    
    PDAC_Path <- system.file("extdata", 'oldST_PDAC', package = 'SpaCET')
    load(paste0(PDAC_Path,"/st_PDAC.rda"))
    
    # show count matrix
    counts[1:6,1:5]
    
    ##        10x10 10x13 10x14 10x15 10x16
    ## A1CF       0     0     0     0     0
    ## A2M       13     0     4     0     0
    ## A4GALT     1     0     0     0     0
    ## A4GNT      0     0     1     0     0
    ## AAAS       0     0     0     0     0
    ## AACS       0     0     0     0     0
    
    # show coordinate matrix
    spotCoordinates[1:5,]
    
    ##        X  Y
    ## 10x10 10 10
    ## 10x13 10 13
    ## 10x14 10 14
    ## 10x15 10 15
    ## 10x16 10 16
    
    # load ST data to create an SpaCET object.
    SpaCET_obj <- create.SpaCET.object(
      counts=counts,
      spotCoordinates=spotCoordinates,
      imagePath=NA,
      platform = "oldST"
    )
    
    # show this object.
    str(SpaCET_obj)
    
    解卷积
    # load sc data
    PDAC_Path <- system.file("extdata", 'oldST_PDAC', package = 'SpaCET')
    load(paste0(PDAC_Path,"/sc_PDAC.rda"))
    
    # show count matrix
    sc_counts[1:6,1:5]
    
    ##         c1 c2 c3 c4 c5
    ## A1BG     0  0  0  0  0
    ## A1CF     0  0  0  1  0
    ## A2M      0  0  0  0  0
    ## A2ML1    0  0  0  0  0
    ## A3GALT2  0  0  0  0  0
    ## A4GALT   0  0  0  0  0
    
    # show cell annotation matrix
    sc_annotation[1:6,]
    
    ##    cellID bio_celltype                            
    ## c1 "c1"   "Acinar cells"                          
    ## c2 "c2"   "Ductal - terminal ductal like"         
    ## c3 "c3"   "Ductal - terminal ductal like"         
    ## c4 "c4"   "Ductal - CRISP3 high/centroacinar like"
    ## c5 "c5"   "Cancer clone A"                        
    ## c6 "c6"   "Cancer clone A" 
    
    # show cell type lineage tree
    head(sc_lineageTree)
    
    ## $Cancer
    ## [1] "Cancer clone A" "Cancer clone B"
    ## 
    ## $Ductal
    ## [1] "Ductal - APOL1 high/hypoxic"            "Ductal - CRISP3 high/centroacinar like"
    ## [3] "Ductal - MHC Class II"                  "Ductal - terminal ductal like"         
    ## 
    ## $Macrophage
    ## [1] "Macrophages A" "Macrophages B"
    ## 
    ## $mDC
    ## [1] "mDCs A" "mDCs B"
    ## 
    ## $`Acinar cells`
    ## [1] "Acinar cells"
    ## 
    ## $`Endocrine cells`
    ## [1] "Endocrine cells"
    
    SpaCET_obj <- SpaCET.deconvolution.matched.scRNAseq(
      SpaCET_obj, 
      sc_counts=sc_counts, 
      sc_annotation=sc_annotation, 
      sc_lineageTree=sc_lineageTree, 
      coreNo=8
    )
    
    SpaCET.visualize.spatialFeature(
      SpaCET_obj, 
      spatialType = "CellFraction",
      spatialFeatures = c("Cancer clone A","Cancer clone B","Acinar cells","Ductal - CRISP3 high/centroacinar like"),
      nrow=2
    )
    
    基因空间表达可视化
    # Markers for cancer clone A and B, acinar cell, and centroacinar like ductal cell
    SpaCET.visualize.spatialFeature(
      SpaCET_obj,
      spatialType = "GeneExpression",
      spatialFeatures = c("TM4SF1","S100A4","PRSS1","CRISP3"),
      nrow=2
    )
    
    可以依据以上操作进一步分析空间转录组的共定位及通讯分析。

    生活很好,有你更好

    相关文章

      网友评论

        本文标题:空间转录组数据分析软件推荐---SpaCET

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