在MAC m1芯片系统macOS Monterey 12.3中R语言版本4.1.3,BiocManager1.30.16,Bioconductor3.14,安装单细胞测序所需相关代码,打包安装
安装代码如下:
bioPackages <-c(
"dplyr", "patchwork",
"limma", # 差异分析
"celldex", # 细胞类型参考数据集
"scuttle", # 对SummarizedExperiment对象进行计算
"pheatmap",
"BiocGenerics", 'DelayedArray', 'DelayedMatrixStats',
'limma', 'S4Vectors', 'SingleCellExperiment',
'SummarizedExperiment', 'batchelor', 'Matrix.utils',
"Seurat", "SingleR",
"tximport", # 读取Alevin结果到Seurat
"R.utils", "rliger", "fishpond",
"scater", "scran", "TSCAN", "slingshot",
"scRNAseq",
"AnnotationHub", "ensembldb",
"clusterProfiler", "org.Hs.eg.db",
"cowplot", "enrichplot"
)
批量安装
lapply( bioPackages,
function( bioPackage ){
if( ! bioPackage %in% rownames(installed.packages()) ){
CRANpackages <- available.packages()
if( bioPackage %in% rownames( CRANpackages) ){
install.packages( bioPackage, quiet = TRUE )
}else{
BiocManager::install( bioPackage, suppressUpdates = FALSE, update = FALSE, ask = FALSE)
}
}
}
)
运行结果为:
'getOption("repos")' replaces Bioconductor standard repositories, see
'?repositories' for details
replacement repositories:
CRAN: https://mirrors.tuna.tsinghua.edu.cn/CRAN/
Bioconductor version 3.14 (BiocManager 1.30.16), R 4.1.3 (2022-03-10)
Installing package(s) 'limma'
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘limma’
Do you want to attempt to install these from sources? (Yes/no/cancel)
尝试选择yes与no两种形式进行安装,但安装结果似乎为下载后安装源代码,但安装后自动删除,致使一致无法安装。因为是初学者刚接触单细胞测序及R语言相关代码,上述运行结果代码结果自我感觉有可能为指定网址不正确?于是在网上尝试了两行代码,代码如下:
options(install.packages.check.source = "no")
options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
但好像没有什么卵用,运行结果一样,或者可能是源代码问题?这个我就不太明白了,希望大家能给解惑一下🙏
于是本人单独以limma包为例,进行安装尝试,报错结果与上文一致。同时,曾尝试从bioconductor上直接下载limma包进行安装,本人下载网站中macOS 10.13 (High Sierra) limma_3.50.1.tgz此包,在R中安装后,运行:
library(limma)
运行结果为:
错误: package or namespace load failed for ‘limma’:
loadNamespace()里算'limma'时.onLoad失败了,详细内容:
调用: dyn.load(file, DLLpath = DLLpath, ...)
错误: 无法载入共享目标对象‘/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/limma/libs/limma.so’::
dlopen(/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/limma/libs/limma.so, 0x0006): tried: '/Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/library/limma/libs/limma.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
难道是arm的原因?但是同为m1的舍友可以,我就迷茫了,求大家解惑,搞明白上述问题原因,或者其他方法安装这些包也可以,万分感激🙏