meta <- ov_cancer@meta.data
> meta_summ <- meta %>%
+ group_by(sample) %>%
+ summarise(counts = n()) %>%
+ filter(counts > 250)
> ov_cancer <- subset(ov_cancer, subset = sample %in% meta_summ$sample) #过滤取子集
> table(ov_cancer@meta.data$sample)
BT1303 BT1307 scrSOL001 scrSOL003 scrSOL004
2130 2338 1906 1803 4005
> ov_t <- ov_cancer # 过滤后的ov_cancer赋值给ov_t
> ov_t[["RNA"]] <- split(ov_t[["RNA"]], f = ov_t$sample)
Warning: Assay RNA changing from Assay to Assay5
Warning message:
Input is a v3 assay and `split()` only works for v5 assays; converting to a v5 assay
> ov_t <- SCTransform(ov_t) #归一化,用了之后不需要进行NormalizeData() ScaleData() FindVariableFeatures()
Running SCTransform on assay: RNA
Running SCTransform on layer: counts.BT1303
vst.flavor='v2' set. Using model with fixed slope and excluding poisson genes.
Variance stabilizing transformation of count matrix of size 15520 by 2130
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 2130 cells
Error: useNames = NA is defunct. Instead, specify either useNames = TRUE or useNames = FALSE.
查看一下我目前matrixStats的版本
package.version('matrixStats')
[1] "1.2.0"
GitHub上搜索了一下解决办法:
错误:useNames = NA 已失效。相反,请指定 useNames = TRUE 或 useNames = FALSE。·期号 #256 ·LTLA/单人 ·GitHub上
总结一下:
remotes::install_version("matrixStats", version="1.1.0",lib="/home/zyt/R/x86_64-pc-linux-gnu-library/4.2')
BiocManager::install(version = "3.18") #我的R版本是4.2,BiocManager3.18版本支持R4.3以上版本所以我选择了第一个方法,重新安装matrixStats 版本1.1
参考了CSDN另一个博主的文章:https://blog.csdn.net/weixin_46128755/article/details/136395843