前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >R包安装大全-番外篇一

R包安装大全-番外篇一

作者头像
生信技能树
发布2018-03-09 10:36:27
1.7K0
发布2018-03-09 10:36:27
举报

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

学习之路,任重而道远!

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

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-01-16,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 生信技能树 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 首先是无法安装包
  • 但是在包被载入的时候报错:
  • 包使用的时候报错
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档