我最近在整理Bioconductor一系列包,但是每次都會(huì)遇到一些bug,這次是在安裝R包時(shí)遇到問題柏卤,卡了5天,一直以為是自己設(shè)置的問題匀油,今天終于解決了缘缚。
Bioconductor安裝的麻煩就在于,每個(gè)包依賴的包太多了敌蚜,而且這次主要是很多包都依賴IRanges桥滨,這是基礎(chǔ),不安裝很多包都用不了。 這個(gè)系列如果不設(shè)置鏡像(下載慢)该园,不經(jīng)常更新(每次都提醒你更新)酸舍,不嘗試多方檢索解決問題(有前人的經(jīng)驗(yàn)),可能要郁悶死了里初。
報(bào)錯(cuò)的幾個(gè)包
TCGAbiolinks包
Iranges包
Biostrings包
這個(gè)報(bào)錯(cuò)檢索了很久,各種嘗試設(shè)置也不行忽舟,我又要崩潰了双妨。
不知是不是巧合,也是我自己能get到叮阅,每次我從檢索生信技能樹的教程得到啟發(fā)刁品,崩潰幾天,然后解決浩姥,這次是這兩個(gè)推送:
【緊急通知】下載R包卻聯(lián)網(wǎng)失斕羲妗?初學(xué)者的痛
BiocManager無法安裝R包
解決辦法
我采取的辦法就是卸載重裝勒叠,先在Rstudio中右下角工作環(huán)境中package處移除這個(gè)包兜挨,然后關(guān)閉Rstudio,再把下載目錄(就是你的包下載后存放的地方)下有關(guān)包的文件全部刪掉眯分。
然后重啟Rstudio拌汇,輸入安裝代碼。如下:
options()$repos
options()$BioC_mirror
options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/")
options("repos" = c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
options()$repos
options()$BioC_mirror
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("IRanges")
library(IRanges)
BiocManager::install("Biostrings")
library(Biostrings)
然后包就下載成功弊决,再次加載就沒有問題了噪舀。
附:報(bào)錯(cuò)的一長(zhǎng)串,一開始看到真的還挺慌的…………
反思:不知道是哪兒設(shè)置出了問題飘诗,或者就是下載目錄被動(dòng)過与倡。總之昆稿,R真的是應(yīng)了那句纺座,遇事不決,重啟解決貌嫡。
雞湯一句: 遇到問題不要沮喪比驻,萬物皆有裂痕,那是光照進(jìn)來的地方岛抄。
Error: package or namespace load failed for ‘IRanges’ in namespaceExport(ns, exports):
出口不存在:diff.AtomicList, window<-.Vector, window<-.vector, window<-.factor, splitAsList, multisplit, solveUserSEW0, IRanges, solveUserSEW, successiveIRanges, slidingIRanges, breakInChunks, whichAsIRanges, asNormalIRanges, rangeComparisonCodeToLetter, IPos, NCList, NCLists, H2LGrouping, Dups, PartitioningByEnd, PartitioningByWidth, PartitioningMap, RangedData, RangedSelection, RangesList, IRangesList, RleViewsList, %over%, %within%, %outside%, %pover%, %pwithin%, %poutside%, mergeByOverlaps, findOverlapPairs, MaskCollection.show_frame, Mask, read.gapMask, read.agpMask, read.liftMask, read.rmMask, read.trfMask, successiveViews, slidingViews, LogicalList, IntegerList, NumericList, ComplexList, CharacterList, RawList, RleList, FactorList, DataFrameList, SplitDataFrameList, ManyToOneGrouping, ManyToManyGrouping, regroup, heads, tails, selectNearest, INCOMPATIBLE_ARANGES_MSG, extractListFragments, equisplit, ranges, rglist, mstack, mid, isNormal, whichFirstNotNormal, subject, ranges<-, Views, trim, subviews, viewApply, viewMins, viewMaxs, viewSums, viewMeans, viewWhichMins, viewWhichMaxs, viewRangeMins, viewRangeMaxs, nobj, grouplengths, members, vmembers, togroup, togrouplength, high2low, low2high, grouprank, togrouprank, mapOrder, findRange, splitRanges, extractList, columnMetadata, columnMetadata<-, universe, universe<-, nir_list, desc, desc<-, maskedwidth, maskedratio, findOverlaps, countOverlaps, overlapsAny, subsetByOverlaps, overlapsRanges, poverlaps, narrow, update_ranges, shift, resize, flank, reflect, promoters, restrict, threebands, reduce, gaps, disjoin, isDisjoint, disjointBins, reverse, coverage, cvg, slice, punion, pintersect, psetdiff, pgap, precede, follow, nearest, distance, distanceToNearest, tile, slidingWindows, ifelse2
Failed with error: ‘無法載入程輯包‘IRanges’’