最近想研究一下IMvigor210 cohort馋袜,生信技能樹(shù)已經(jīng)把指南寫(xiě)得很清楚了IMvigor210CoreBiologies包安裝指北 (qq.com)脱衙,但是今天發(fā)現(xiàn)了一個(gè)bug开缎,花了我?guī)讉€(gè)小時(shí)時(shí)間沈贝,總算找出答案~~~~我把整個(gè)過(guò)程寫(xiě)下來(lái),研究之后發(fā)現(xiàn)珊燎,R包的安裝有時(shí)候真是一把辛酸淚庐扫。
首先我們按照流程來(lái),我的R版本是4.1
version
#platform x86_64-w64-mingw32
#arch x86_64
#os mingw32
#system x86_64, mingw32
#status
#major 4
#minor 1.0
#year 2021
#month 05
#day 18
#svn rev 80317
#language R
#version.string R version 4.1.0 (2021-05-18)
#nickname Camp Pontanezen
我們直接先本地安裝塑娇,先按照生信技能樹(shù)教程的指引澈侠,去網(wǎng)站下載IMvigor210CoreBiologies_1.0.0.tar.gz和DESeq_1.38.0.tar.gz兩個(gè)文件,然后本地安裝埋酬,接著就報(bào)錯(cuò)了哨啃。
install.packages("IMvigor210CoreBiologies_1.0.0.tar.gz",repos=NULL)
#這個(gè)是可以安裝成功的
load("cds.RData")
#Warning: namespace ‘DESeq’ is not available and has been replaced
#by .GlobalEnv when processing object ‘cds’. 載入需要的程輯包:DESeq
#Failed with error: ‘程輯包‘DESeq’是在R版本3.0.0之前建的:你得重新安裝’
#Error in .requirePackage(package) : unable to find required package ‘DESeq’.
install.packages('DESeq')
#Warning in install.packages :package ‘DESeq’ is not available for this version of R
#A version of this package for your version of R might be available elsewhere,
#see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
可以看到有2個(gè)報(bào)錯(cuò),一個(gè)是當(dāng)我load數(shù)據(jù)集cds.RData的時(shí)候写妥,提示了DESeq包得重新安裝拳球,第二個(gè)是無(wú)法安裝DESeq包,也就是說(shuō)關(guān)鍵在于DESeq包是否成功安裝珍特。
那么有沒(méi)有可能是devtool包的問(wèn)題祝峻,我接著操作了一下,發(fā)現(xiàn)devtools是沒(méi)問(wèn)題的,我之前有安裝過(guò)了扎筒。
library(devtools)
#載入需要的程輯包:usethis
#Warning messages:
#1: 程輯包‘devtools’是用R版本4.1.2 來(lái)建造的
#2: 程輯包‘usethis’是用R版本4.1.2 來(lái)建造的
# devtools::find_rtools()
[1] TRUE
那么我們重新找安裝DESep包的辦法莱找,采用最官方的語(yǔ)句安裝
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("DESeq")
#Warning message:
#package(s) not installed when version(s) same as current; use `force = TRUE` to
#re-install: 'DESeq'
load("cds.RData")
#Warning: namespace ‘DESeq’ is not available and has been replaced
#by .GlobalEnv when processing object ‘cds’
#載入需要的程輯包:DESeq
#Failed with error: ‘程輯包‘DESeq’是在R版本4.0.0之前建的:你得重新安裝’
#Error in .requirePackage(package) :
#unable to find required package ‘DESeq’
#按照它的要求,加上force=TRUE
if (!requireNamespace("BiocManager", force=TRUE)
install.packages("BiocManager")
BiocManager::install("DESeq")
#Warning message:
#package(s) not installed when version(s) same as current; use `force = TRUE` to
#re-install: 'DESeq'
load("cds.RData")
#Warning: namespace ‘DESeq’ is not available and has been replaced
#by .GlobalEnv when processing object ‘cds’
#載入需要的程輯包:DESeq
#Failed with error: ‘程輯包‘DESeq’是在R版本4.0.0之前建的:你得重新安裝’
#Error in .requirePackage(package) :
#unable to find required package ‘DESeq’
可以看到嗜桌,這兩次安裝都有warning,但是沒(méi)報(bào)錯(cuò)奥溺,不過(guò)仍然無(wú)法順利的load("cds.RData"),所以DESeq仍沒(méi)有被正確安裝。我去看了一下bioconductor對(duì)這個(gè)包的注釋?zhuān)l(fā)現(xiàn)這個(gè)包還有一個(gè)本地的安裝包可以用骨宠,就是紅色線(xiàn)上的“DESeq_1.38.0.zip”浮定,我下載下來(lái),本地安裝一下层亿,發(fā)現(xiàn)成功安裝了壶唤,但是仍然沒(méi)作用~~
install.packages("DESeq_1.38.0.zip", repos = NULL, type = "win.binary")
#package ‘DESeq’ successfully unpacked and MD5 sums checked
load("cds.RData")
#Warning: namespace ‘DESeq’ is not available and has been replaced
#by .GlobalEnv when processing object ‘cds’
#載入需要的程輯包:DESeq
#Failed with error: ‘程輯包‘DESeq’是在R版本4.0.0之前建的:你得重新安裝’
#Error in .requirePackage(package) :
#unable to find required package ‘DESeq’
我回頭去看了一下原文的代碼,發(fā)現(xiàn)作者竟然是沒(méi)有安裝DESeq這個(gè)包的(TGF-b attenuates tumor response to PD-L1 blockade by contributing to exclusion of T cells (gene.com)
)棕所,跟他很像的是DESeq2,但是不是這個(gè)啊,這個(gè)我有l(wèi)ibrary之后悯辙,仍然無(wú)效琳省。
我們不要灰心迎吵,把各種報(bào)錯(cuò)信息放到網(wǎng)上找一下答案。試一下這個(gè)针贬,不行~~
太難了~,該怎么辦桦他?我回頭再去細(xì)看一下waring,我總感覺(jué)肯定忽略了什么東西蔫巩,可以看到warning其中比較重要的1句話(huà)是
#Failed with error: ‘程輯包‘DESeq’是在R版本4.0.0之前建的:你得重新安裝
這提示著這個(gè)包或許還沒(méi)有及時(shí)更新,因此用R version 4.1是沒(méi)法運(yùn)作的快压,這時(shí)候我們就得回去bioconductor看一下這個(gè)包的歷史了圆仔,我們可以看到藍(lán)色字體部分,這個(gè)包對(duì)應(yīng)的R版本是3.6蔫劣,那么是不是換成3.6版本就行了嗎坪郭?還有其他原因嗎?再仔細(xì)看一下脉幢,上面說(shuō)的這句“This package is for version 3.10 of Bioconductor; for the stable, up-to-date release version, see DESeq"歪沃,讓我恍然大悟!那么接下來(lái)就簡(jiǎn)單了外驱,我把R version改成3.6育灸,然后將Bioconductor version改為3.10
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version = "3.10")
install.packages("DESeq_1.38.0.tar.gz",repos=NULL)
install.packages("IMvigor210CoreBiologies_1.0.0.tar.gz",repos=NULL)
#因?yàn)閾Q版本了,所以依賴(lài)包都要重新安裝一下昵宇,這里我不展示了
library(IMvigor210CoreBiologies)
load("cds.RData")
cds
#CountDataSet (storageMode: environment)
#assayData: 31286 features, 348 samples
#element names: counts
#protocolData: none
#phenoData
#sampleNames: SAMf2ce197162ce SAM698d8d76b934 ... SAM2de7cffb5f72 (348
# total)
#varLabels: Best Confirmed Overall Response binaryResponse ... TCGA
#Subtype (25 total)
#varMetadata: labelDescription
#featureData
# featureNames: 1 10 ... 9997 (31286 total)
#fvarLabels: entrez_id symbol ... Symbol (6 total)
# fvarMetadata: labelDescription
#experimentData: use 'experimentData(object)'
#Annotation:
漂亮磅崭!沒(méi)報(bào)錯(cuò)了,有了這個(gè)文件瓦哎,下面的表達(dá)矩陣砸喻,臨床信息就都可以提取啦〗總之包的安裝很費(fèi)勁割岛,死活安裝不成功的時(shí)候,不妨仔細(xì)看一看waring,然后到bioconductor仔細(xì)看一下犯助,有時(shí)候或許是Rversion癣漆,bioconductor version在搞事情.....這些都是實(shí)戰(zhàn)經(jīng)驗(yàn)啊~