scCancer2

安装还算简单,有几个依赖包需要下载.tar手动安装,注意报错提示里的版本号即可。
首先:几个主要模块(按照旧版来看):3个
The workflow of scCancer mainly consists of three modules: scStatistics, scAnnotation, and scCombination.

  • The scStatistics performs basic statistical analyses of raw data and quality control.
    注:计算、可视化的过滤指标,有处理过的数据集(矩阵或 Seurat 对象),您可以单独使用细胞亚型注释和恶性细胞识别模块。

scStatistics,并且不需要。

  • The scAnnotation performs functional data analyses and visualizations, such as low dimensional representation, clustering, cell type classification, cell malignancy estimation, cellular phenotype analyses, gene signature analyses, cell-cell interaction analyses, etc.

  • The scCombination perform multiple samples data integration, batch effect correction and analyses visualization.

注:2,3在新版不同 变成 cellSubtypeAnno.Rmd和 malignantCellIden.Rmd

cellranger后的数据直接跳过 scStatistics, 两个都挺重要,先从注释开始。

首先是输入数据:不管下载新版本还是旧版本(参考下面),都是没有/data 这个子目录的,但没事,大致能确定需要的目录只是cellranger处理后的目录,即:#[1] "barcodes.tsv.gz"features.tsv.gz"matrix.mtx.gz" 所在目录

  • 示例数据:http://lifeome.net/software/sccancer/KC-example.tar.gz

  • 经cellranger处理得到的10X单细胞表达数据。sampleFolder即为代表单个样本。raw_feature_bc_matrixfiltered_feature_bc_matrix分别代表处过滤empty
    droplet前后的单细胞表达数据。

    image
list.files("./data",recursive = T)
#[1] "sample1/filtered_feature_bc_matrix/barcodes.tsv.gz"
#[2] "sample1/filtered_feature_bc_matrix/features.tsv.gz"
#[3] "sample1/filtered_feature_bc_matrix/matrix.mtx.gz"  
#[4] "sample1/raw_feature_bc_matrix/barcodes.tsv.gz"     
#[5] "sample1/raw_feature_bc_matrix/features.tsv.gz"     
#[6] "sample1/raw_feature_bc_matrix/matrix.mtx.gz"

list.files("./results",recursive = T,include.dirs = T)
#[1] "sample1"

下面我把测试成功的最简代码贴出来
参考的官方流程,但是只截取最重要的,避免干扰
官方:scCancer/vignettes/scCancer2.Rmd at master · czythu/scCancer · GitHub

'''

scStatistics

##最核心的 数据类型和位置:就是我说的"barcodes.tsv.gz"features.tsv.gz"matrix.mtx.gz"  所在目录的前两层,注意不是所在目录
path <- "/dssg/home/acct-medwshuai/medwshuai/2025-3-11-xujy_MusPAAD/DZOE2025011103/Cellranger/"
dataPath <- file.path(path, "F_KPC290")
# A path containing the scStatistics results
statPath <- file.path(path, "result")
# The sample name

sampleName <- "F_KPC290-example"

# The author name or a string used to mark the report.
authorName <- "Shen-Lab@SJTU"
# A path used to save the results files
savePath <- file.path(path, "result")

# Run scStatistics
stat.results <- runScStatistics(
    dataPath = dataPath,
    savePath = savePath,
    sampleName = sampleName,
    authorName = authorName,
    bool.runSoupx = F,
    genReport = T
)
'''
![image.png](https://upload-images.jianshu.io/upload_images/18429961-d4fbb7861c9c39b3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

注意,必须有这步才能进行后续的
'''
# Run scAnnotation
anno.results <- runScAnnotation(
    dataPath = dataPath,
    statPath = statPath,
    savePath = savePath,
    authorName = authorName,
    sampleName = sampleName,
    geneSet.method = "average",
    # vars.to.regress = c("nCount_RNA", "mito.percent"),
    bool.runDiffExpr = T,
    bool.runCellClassify = T,
    bool.runCellSubtypeClassify = T,
    subtypeClassifyMethod = "Scoring",
    celltype.list = NULL,
    ct.templates = NULL,
    submodel.path = NULL,
    markers.path = NULL,
    unknown.cutoff = 0.3,
    subtype.umap = T,
    bool.runMalignancy = T,
    malignancy.method = "both", # "xgboost", "inferCNV", "both", recommend "both" for sample < 10000 cells
    bool.intraTumor = T,
    bool.runCellCycle = T,
    bool.runStemness = T,
    bool.runGeneSets = T,
    bool.runExprProgram = T,
    bool.runInteraction = T,
    genReport = T
)
'''
跑完发现好像不是小鼠的,
而且有个提示
'''
For a (much!) faster implementation of the Wilcoxon Rank Sum Test,
(default method for FindMarkers) please install the presto package
--------------------------------------------
install.packages('devtools')
devtools::install_github('immunogenomics/presto')
--------------------------------------------
After installation of presto, Seurat will automatically use the more 
efficient implementation (no further action necessary).
This message will be shown once per session

'''
听从建议安装
![image.png](https://upload-images.jianshu.io/upload_images/18429961-2dd1200dfeb84784.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
报错
重新换成小鼠的,仍然报错
![image.png](https://upload-images.jianshu.io/upload_images/18429961-d6481a2691490451.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
When using repel, set xnudge and ynudge to 0 for optimal results
Error in `[.data.frame`(coor.df, , coor.names[1]) : 
  undefined columns selected

降级版本
![image.png](https://upload-images.jianshu.io/upload_images/18429961-7d2303d7c9e0d1db.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
分析的内容很丰富,可以为初步探索节省时间
![image.png](https://upload-images.jianshu.io/upload_images/18429961-7ac958278eaf90f4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)


下面是恶性细胞识别
[scCancer/vignettes/malignantCellIden.Rmd at master · czythu/scCancer · GitHub](https://kkgithub.com/czythu/scCancer/blob/master/vignettes/malignantCellIden.Rmd)
重新降级了seurat以后还是不行

可能是我光降级没重新加载sccancer包
重新进入,加载发现
Seurat v4 was just loaded with SeuratObject v5; disabling v5 assays and
validation routines, and ensuring assays work in strict v3/v4
compatibility mode
再次重新安装之后跑完流程,非常快
![image.png](https://upload-images.jianshu.io/upload_images/18429961-cbb177ad77e00db3.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)





©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容