Dear all, please could you advise on how I shall understand and how could I possibly fix the following error :
I am using a R scripts that calls ggbio and the human chomosomes (chr1, chr2, etc ...), and it used to work well before R.3.4.0. On R.3.4.0, the error I am getting is below, and shall I follow the suggestions (at the end of the error message), it does not really work (yet). thanks a lot !
Error in GenomeInfoDb:::getDanglingSeqlevels(x, new2old = new2old, force = force, :
The following seqlevels are to be dropped but are currently in use (i.e. have ranges on them): chr1, chr10, chr11, chr12, chr13, chr14,
chr15, chr16, chr17, chr18, chr19, chr2, chr20, chr22, chr3, chr4, chr5, chr6, chr7, chr8, chr9, chrX. Please use the 'pruning.mode'
argument to control how to prune 'x', that is, how to remove the ranges in 'x' that are on these sequences. For example, do something
like:
seqlevels(x, pruning.mode="coarse") <- new_seqlevels
or
keepSeqlevels(x, new_seqlevels, pruning.mode="coarse")
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS
Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.0
LAPACK: /usr/lib/lapack/liblapack.so.3.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] BiocInstaller_1.26.0
loaded via a namespace (and not attached):
[1] compiler_3.4.0 tools_3.4.0
Hi,
Note that the behavior of the
seqlevels()
setter has not changed when it needs to drop seqlevels that are in use: by default it has been raising an error since the beginning (unless called withforce=TRUE
). What has changed in BioC 3.5 is that now the user can control what to do in this situation by using the newpruning.mode
argument (it replaces theforce
argument). So ifseqlevels(.h.pos) <- seqlevels(obj)
worked in BioC < 3.5, it should still work in BioC >= 3.5 (as long as no used seqlevels need to be dropped).Another thing that has changed is the default behavior of
keepSeqlevels()
,dropSeqlevels()
, andkeepStandardChromosomes()
: now they behave consistently with theseqlevels()
setter i.e. they raise an error instead of silently dropping the seqlevels that are in use. So calls to these functions now fail in this situation. The fix is to specify a pruning mode, typically the"coarse"
mode.All this to say that if upgrading from BioC < 3.5 to BioC >= 3.5 causes code that used to work to break with an error like the one reported by the OP, then you need to look for calls to
keepSeqlevels()
,dropSeqlevels()
, andkeepStandardChromosomes()
and identify those that needpruning.mode="coarse"
(not all of them necessarily need this). Calls to theseqlevels()
setter that don't useforce=TRUE
shouldn't need to be touched (and if they useforce=TRUE
, now they should usepruning.mode="coarse"
instead).Hope this helps,
H.
Dear Herve, many thanks ;) it is working now.
Dear Valerie, thank you very much for your help ;)