萌新在HPC集群安装R/Cardinal包的踩坑历程

起因

起初,由于一些数据读取的需求,查到需要安装R/Cardinal包,于是普普通通地按照官方说明输入:

>
1
BiocManager::install("Cardinal")

然而,万万没想到,这成为了我漫长踩坑路的开始。

踩坑的开始

首先,出现了这样的报错:

>
1
2
3
4
5
6
7
8
BiocManager::install("Cardinal")
Error: Bioconductor version cannot be validated: no internet connection? See
#troubleshooting section in vignette
In addition: Warning messages:
1:In file(con,"r") :
URL 'https://bioconductor.org/config.yaml' : status was 'SSL peer certificate or SSH remote key was not OK!
2:In file(con,"r") :
URL 'https://bioconductor.org/config.yaml' : status was 'SSL peer certificate or SSH remote key was not OK!

或许是这集群不支持用https?那就改镜像网址!于是尝试修改Bioc_Mirror:

>
1
options(BioC_mirror="http://mirrors.tuna.tsinghua.edu.cn/bioconductor/")

然而,安装时的报错一点都没变!然后又开始查大佬们的解决方式,看到这位大佬的帖子,建议在.Rprofile中增加:

>
1
2
options(download.file.method = 'libcurl')
options(url.method='libcurl')

这位大佬的帖子,建议修改:

>
1
options(BIOCONDUCTOR_ONLINE_VERSION_DIAGNOSIS=TRUE)

;以及这位大佬的帖子,直接建议修改DNS。
然而,这些办法或许对大多数用户都是有效方法,但到我这里,使用前两种办法时,
Error: Bioconductor version cannot be validated: no internet connection?
仍然挥之不去;而我一个卑微的普通用户又不能修改DNS。为之奈何?要不直接联系运维人员帮忙解决罢!于是收到回复:“您好 您手动指一下ca证书试下呢~”

>
1
export REQUESTS_CA_BUNDLE=xxx/cacert.pem

我非常希望自己在输入这条命令后可以高兴地说出“原来是用这种方法解决的吗?,太厉害了!”,但熟悉的Error又出现了:

>
1
2
3
4
5
6
7
8
BiocManager::install("Cardinal")
Error: Bioconductor version cannot be validated: no internet connection? See
#troubleshooting section in vignette
In addition: Warning messages:
1:In file(con,"r") :
URL 'https://bioconductor.org/config.yaml' : status was 'SSL peer certificate or SSH remote key was not OK!
2:In file(con,"r") :
URL 'https://bioconductor.org/config.yaml' : status was 'SSL peer certificate or SSH remote key was not OK!

没完没了了了是吧?要不我直接弃疗?让运维帮我安装算了…

第一次脱坑与差点踏入第二坑

晚饭后,我忽然意识到,自己貌似陷入误区了。既然前面提到了’ https://bioconductor.org/config.yaml ‘,我为什么不把读取这个网址的过程绕过去?于是尝试在BiocManager包里面寻找这个地址的踪迹。终于(一分钟后),我在’path/to/library/BiocManager/doc/BiocManager.R’中发现了以下内容:

>
1
2
3
4
## ---- eval = FALSE------------------------------------------------------------
# options(
# BIOCONDUCTOR_CONFIG_FILE = "file:///path/to/config.yaml"
# )

然后再后知后觉地查看BiocManager的安装说明,上面清清楚楚地提到:
BiocManager also expects to reference an online configuration yaml file for Bioconductor version validation at https://bioconductor.org/config.yaml. With offline use, users are expected to either host this file locally or provide their config.yaml version. The package allows either an environment variable or R-specific option to locate this file, e.g.,

>
1
2
3
options(
BIOCONDUCTOR_CONFIG_FILE = "file:///path/to/config.yaml"
)

所以这其实只是个直接” wget https://bioconductor.org/config.yaml “再用options()改下BIOCONDUCTOR_CONFIG_FILE路径就能轻松解决的小问题。鬼知道我为什么被这种小事情卡了几个小时
我真傻,真的

既然BiocManager的问题解决了,那就可以愉快地装包了吧!你别说,你还真别说……只需要一点点技术性调整:也就再装个libjpeg-devel、libtiff-devel和fftw3就行。虽然没有root权限,且不想再次联系运维,以及不愿意重复漫长的编译过程,但觉得能直接用yumdownloader和rpm2cpio下载并解压,再修改下环境变量的PATH和库就能解决吧(大概)。不过实际使用表明,直接将.rpm解压后并不能直接调用。乱试一通的结果表明,还要在修改一下环境变量的PKG_CONFIG_PATH:

>
1
export PKG_CONFIG_PATH=path/to/new/usr/lib64/pkgconfig:$PKG_CONFIG_PATH

然后我顺手又把

>
1
2
3
4
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include

中的’/usr’替换为了’/path/to/new/usr’(参考rpm解压后生成的目录)。
至此,R/Cardinal包安装终于顺利完成。

感觉

不如翻翻官方文档。

一点补充问题

虽然R/Cardinal包安装顺利完成,但当我尝试在服务器上用其读取空间代谢组数据时,出现了报错信息,但PC上一切正常。报错如下:

1
2
Error in if (representation == "centroid spectrum") [ :
argument is of length zero

经比较本地安装的R、BiocManager和Cardinal版本,意识到可能是我在服务器上装的R-4.3.1版本太新了,故在集群上重新编译安装R-4.2.3,再使用BiocManager安装Cardinal包。结果是积极的:终于可以正常读取.imzML格式的文件了。不负责任地猜想:或许是新版Cardinal在readImzML.R中尝试为representation赋值NULL的结果?

1
2
3
4
5
6
7
8
# spectrum representation
if ( "MS:1000127" %in% names(fileContent)) {
representation <- "centroid spectrum"
} else if ( "MS:1000128" %in% names(fileContent)) {
representation <- "profile spectrum"
} else {
representation <- NULL
}

合成拉谢拉(笑)

很惭愧,做了一点微小的工作(O-O)。

大概也就是看到合成大西瓜蔚然成风(笑)后,参考网上已有的教程,替换了一下合成大西瓜里的图片,并上传到Github Pages。

替换时使用的图片也仅仅是简单地把Surge Concerto官网上的图片拖下来,简单地用paint.net进行一点点处理后直接替换掉游戏中的原文件(害,都怪我不会用Photoshop)。

最终凑出来的合成怪如下所示:

https://raciela.top/synraciela/

欢迎各位dalao莅临参观。

Hello World

Hello World

在Hexo框架下,借用一下Github Pages,姑且生成了一个大概长这样的网页。

如您所见,本页面的作用仅仅是测试一下效果。

然而我并不知道该写些什么内容,所以变成了现在这个样子。

对您因阅读本文而浪费的数秒宝贵时间,我深表歉意(并不

Mehr lesen