赞
踩
installed.packages()
dir.create("D:/Win10 System/Documents/R/win-library/4.2")
.libPaths()
Sys.chmod("C:/Program Files/R/R-4.2.1/library", mode = '7777')
.libPaths("D:/Win10 System/Documents/R/win-library/4.2")
.libPaths(c("D:/Win10 System/Documents/R/win-library/4.2",
"C:/Program Files/R/R-4.2.1/library",
"D:/Win10 System/Documents/R/win-library/4.1","C:/Program Files/R/R-4.1.0/library"))
.libPaths()
getwd()
dir.create("D:/ARDS_scripts_1012/ARDS/Step2_harmony_f200_R3/chb")
setwd("D:/ARDS_scripts_1012/ARDS/Step2_harmony_f200_R3/chb")
getwd()
load(file = "D:/ARDS_scripts_1012/ARDS/Step2_harmony_f200_R3/ws/2022-10-16-epithelial/sepsis_Epithelial cell.rds")
library(installr)
updateR()
## 先卸载先前的安装控制程序
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version = "3.15")
#在安装irGSEA 需要查看自己是否安装了以下这些包
if(1==1){
# install packages from CRAN
cran.packages <- c("msigdbr", "dplyr", "purrr", "stringr","magrittr",
"RobustRankAggreg", "tibble", "reshape2", "ggsci",
"tidyr", "aplot", "ggfun", "ggplotify", "ggridges",
"gghalves", "Seurat", "SeuratObject", "methods",
"devtools", "BiocManager","data.table","doParallel",
"doRNG")
if (!requireNamespace(cran.packages, quietly = TRUE)) {
install.packages(cran.packages, ask = F, update = F)
}
#BiocManager::install(version = '3.15')
# install packages from Bioconductor
bioconductor.packages <- c("GSEABase", "AUCell", "SummarizedExperiment",
"singscore", "GSVA", "ComplexHeatmap", "ggtree",
"Nebulosa")
if (!requireNamespace(bioconductor.packages, quietly = F)) {
BiocManager::install(bioconductor.packages, ask = F, update = T)
}
library(BiocManager)
BiocManager::install(c("GSEABase", "AUCell", "SummarizedExperiment",
"singscore", "GSVA", "ComplexHeatmap", "ggtree",
"Nebulosa"))
sessionInfo(package ="BiocManager" )
# install packages from Github
if (!requireNamespace("UCell", quietly = TRUE)) {
devtools::install_github("carmonalab/UCell")
}
if (!requireNamespace("irGSEA", quietly = TRUE)) {
devtools::install_github("chuiqin/irGSEA")
}
getwd()
}
sessionInfo(package = c('AUCell', 'Nebulosa', 'singscore'))
#顺手设置一下数据集的ident
# set cluster to idents
library(Seurat)
Idents(subset_data) <- subset_data$stim
Idents(subset_data)
library(UCell)
library(irGSEA)
??irGSEA.score
msigdbr::msigdbr_show_species() #Mus musculus
msigdbr::msigdbr_collections()
??install.packages
install.packages('Matrix', version = '1.5.0',lib ="D:/Win10 System/Documents/R/win-library/4.2",
repos = "http://cran.us.r-project.org")
??library
#unloadNamespace("Matrix")
library("Matrix",lib.loc ="D:/Win10 System/Documents/R/win-library/4.2" )
pbmc3k.final <- irGSEA.score(object = subset_data, assay = "RNA",
slot = "data", seeds = 123, ncores = 1,
min.cells = 3, min.feature = 0,
custom = F, geneset = NULL, msigdb = T,
species = "Mus musculus", category = "C2",
subcategory = 'CP:KEGG',
geneid = "symbol",
method = c("AUCell", "UCell", "singscore",
"ssgsea"),
aucell.MaxRank = NULL, ucell.MaxRank = NULL,
kcdf = 'Gaussian')
#> Validating object structure
#> Updating object slots
#> Ensuring keys are in the proper strucutre
#> Ensuring feature names don't have underscores or pipes
#> Object representation is consistent with the most current Seurat version
#> Calculate AUCell scores
#> Warning: Feature names cannot have underscores ('_'), replacing with dashes
#> ('-')
#> Warning in .filterFeatures(expr, method): Feature names cannot have underscores
#> ('_'), replacing with dashes ('-')
#> Finish calculate ssgsea scores
# 返回一个Seurat对象,富集分数矩阵存放在RNA外的assay中
Seurat::Assays(pbmc3k.final)
#> [1] "RNA" "AUCell" "UCell" "singscore" "ssgsea"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。