打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
R包安装大全-番外篇一

SingleCellExperiment是单细胞转录组数据的基础包,大部分其它单细胞转录组数据处理的包都依赖于它,就跟芯片数据里面的ExpressionSet对象一样,需要拼了命的理解透,才有可能做好数据分析。

首先是无法安装包

最近MAC升级就死机,好不容易通过谷歌救活了,但是R里面安装SingleCellExperiment包却开始报错,

## try http:// if https:// URLs are not supported
source("https://bioconductor.org/biocLite.R")
biocLite("SingleCellExperiment")
Bioconductor version 3.5 (BiocInstaller 1.26.1), ?biocLite for help
A newer version of Bioconductor is available for this version of R, ?BiocUpgrade
 for help
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.5 (BiocInstaller 1.26.1), R 3.4.3 (2017-11-30).
Installing package(s) 'SingleCellExperiment'
Warning message:
package 'SingleCellExperiment' is not available (for R version 3.4.3)

按照我当初总结好的R包安装大全,R包终极解决方案 (请务必点击仔细阅读!!!)

下载它的macos版本压缩文件,直接解压到R的库目录,最后成功的安装了这个包

但是在包被载入的时候报错:

suppressPackageStartupMessages(library(scater))
# Error: This is R 3.4.3, package 'SingleCellExperiment' needs >= 3.5

很诡异的,当时硬是想不通为啥子,就去上海聚会了,放松了五天,回来检查了我的浏览器记录,发现这个SingleCellExperiment居然是有两个url,如下:

https://bioconductor.org/packages/release/bioc/html/SingleCellExperiment.html
https://bioconductor.org/packages/3.7/bioc/html/SingleCellExperiment.html

我有点诧异,一般来说,用最新版的即可。我进入仔细对比,发现依赖于3.7版本的bioconductor的那个包介绍页面里面写着依赖于 R (>= 3.5) 顿时尴尬了,现在是 2018年01月15日21:51:39 ,最新版的R还是3.4呀~!!

原来是当初我下载的SingleCellExperiment版本太超前了,尽管我把它挪到了library的目录,我的R也无法使用它,我删除了该目录,重新下载了一个!

wget https://bioconductor.org/packages/release/bioc/bin/macosx/el-capitan/contrib/3.4/SingleCellExperiment_1.0.0.tgz

这个时候这个包可以被载入,但是仍然报错

包使用的时候报错

本以为安装成功了,也可以载入,就万事大吉了,事实证明我还是太年轻

suppressPackageStartupMessages(library(scater))
data("sc_example_counts")
data("sc_example_cell_info")

example_sce <- SingleCellExperiment(
   assays = list(counts = sc_example_counts), colData = sc_example_cell_info)

#Error in checkSlotAssignment(object, name, value) :
#  assignment of an object of class "GRangesList" is not valid for slot 'rowRanges' in an object of class "SingleCellExperiment"; is(value, "GenomicRanges_OR_GRangesList") is not TRUE

很明显仍然是包不兼容的问题。

我又回过头想了想,为什么不能自然而然的安装包呢?看到了升级选项:

biocLite("BiocUpgrade")
> source("https://bioconductor.org/biocLite.R")
Bioconductor version 3.6 (BiocInstaller 1.28.0), ?biocLite for help
> biocLite("SingleCellExperiment")
BioC_mirror: https://bioconductor.org
Using Bioconductor 3.6 (BiocInstaller 1.28.0), R 3.4.3 (2017-11-30).
Installing package(s) 'SingleCellExperiment'
trying URL 'https://bioconductor.org/packages/3.6/bioc/bin/macosx/el-capitan/contrib/3.4/SingleCellExperiment_1.0.0.tgz'
Content type 'application/x-gzip' length 857294 bytes (837 KB)
==================================================
downloaded 837 KB

学习之路,任重而道远!

切勿纠结,放松两天,也许思路就慢慢理顺了!

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
R语言 | 可以愉快的更新最新版R了!
几种R包安装方式
不用biocLite安装Bioconductor包
R语言Bioconductor包的安装指南
一文搞定R包安装报错
有了它再也不用担心R包安不上啦!
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服