Error in GenomeInfoDb:::getDanglingSeqlevels
2
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 14 months ago
Palo Alto, CA, USA

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   

 

ggbio • 3.7k views
ADD COMMENT
0
Entering edit mode
@valerie-obenchain-4275
Last seen 2.9 years ago
United States

The seqlevel() setter was modified last year to include a pruning.mode argument. The error message shows the code necessary to drop seqlevels in using  this argument. This is documented, with examples, on the ?seqlevels man page.

If you are seeing this error from running a function in ggbio and not your own code then likely the problem is how ggbio is calling seqlevels<-. Looking at the ggbio source code, it's likely related to this replacement:

~/repos/svn/Rpacks/ggbio/R >grep seqlevels *
...
plotGrandLinear.R:      seqlevels(.h.pos) <- seqlevels(obj)

I would suggest contacting the ggbio author and asking them to update the code to

seqlevels(.h.pos, pruning.mode="coarse") <- seqlevels(obj)

 

Valerie

ADD COMMENT
2
Entering edit mode

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 with force=TRUE). What has changed in BioC 3.5 is that now the user can control what to do in this situation by using the new pruning.mode argument (it replaces the force argument). So if seqlevels(.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(), and keepStandardChromosomes(): now they behave consistently with the seqlevels() 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(), and keepStandardChromosomes() and identify those that need pruning.mode="coarse" (not all of them necessarily need this).  Calls to the seqlevels() setter that don't use force=TRUE shouldn't need to be touched (and if they use force=TRUE, now they should use pruning.mode="coarse" instead).

Hope this helps,

H.

ADD REPLY
0
Entering edit mode

Dear Herve, many thanks ;) it is working now.

ADD REPLY
0
Entering edit mode

Dear Valerie, thank you very much for your help ;)

ADD REPLY
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 14 months ago
Palo Alto, CA, USA

Dear Herve, many thanks for your detailed message and precious help ;). I will update my R code accordingly. 

ADD COMMENT

Login before adding your answer.

Traffic: 469 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6