bernatgel / karyoploteR

karyoploteR - An R/Bioconductor package to plot arbitrary data along the genome
https://bernatgel.github.io/karyoploter_tutorial/
298 stars 42 forks source link

kpAddBaseNumbers issue on plot.type=2 #26

Closed freddymonteiro closed 5 years ago

freddymonteiro commented 5 years ago

Hi guys, I stumbled upon the impossibility to add Base Numbers to a Type 2 ideogram. A few months ago I was able to generate a KaryoPlot of type 2 with custom cytobands and custom annotations without any issues. I tried to correct one annotation recycling my code and stumbled upon the impossibility to add base numbers. Here is an example using the shipped datasets:

> kp <- plotKaryotype(genome="hg19",plot.type=2)
> kpAddBaseNumbers(kp)

Error in ccf(chr = rep(chr.name, length(tick.pos)), x = tick.pos) : 
  In coordChangeFunction: data.panel is required

Providing data.panel attribute to kpAddBaseNumbers does not help.

Is this only happening to me, or is it a bug? Thanks in advance for looking into this.

bernatgel commented 5 years ago

That's a bug. I'll try to fix it as soon as I get to a computer. Thanks for reporting it.

El mié., 14 nov. 2018 10:25, Freddy Monteiro notifications@github.com escribió:

Hi guys, I stumbled upon the impossibility to add Base Numbers to a Type 2 ideogram. A few months ago I was able to generate a KaryoPlot of type 2 with custom cytobands and custom annotations without any issues. I tried to correct one annotation recycling my code and stumbled upon the impossibility to add base numbers. Here is an example using the shipped datasets:

kp <- plotKaryotype(genome="hg19",plot.type=2) kpAddBaseNumbers(kp)

Error in ccf(chr = rep(chr.name, length(tick.pos)), x = tick.pos) : In coordChangeFunction: data.panel is required

Is this only happening to me, or is it a bug? Thanks in advance for looking into this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bernatgel/karyoploteR/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/AA4HwSgNxWhIR9HEhz_xAe8YcWoigRJEks5uu-GRgaJpZM4YdVg9 .

bernatgel commented 5 years ago

Hi @freddymonteiro

I thought it was a bug but I think I actually fixed it in a previous version. Could you provide the output of sessionInfo()? Code works for me in latest release version (1.8.2) and latest devel version (1.9.3)

Could you update to the latest version and check if you still see the error?

Bernat

freddymonteiro commented 5 years ago

The issue persists, despite I seem to be running on the last version....

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.6.0
LAPACK: /usr/lib/lapack/liblapack.so.3.6.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=es_ES.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=es_ES.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=es_ES.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
[1] karyoploteR_1.8.2    regioneR_1.14.0      GenomicRanges_1.34.0
[4] GenomeInfoDb_1.18.1  IRanges_2.16.0       S4Vectors_0.20.1    
[7] BiocGenerics_0.28.0 

loaded via a namespace (and not attached):
 [1] Biobase_2.42.0              httr_1.3.1                 
 [3] bit64_0.9-7                 splines_3.5.1              
 [5] Formula_1.2-3               assertthat_0.2.0           
 [7] latticeExtra_0.6-28         blob_1.1.1                 
 [9] BSgenome_1.50.0             GenomeInfoDbData_1.2.0     
[11] Rsamtools_1.34.0            progress_1.2.0             
[13] pillar_1.3.0                RSQLite_2.1.1              
[15] backports_1.1.2             lattice_0.20-38            
[17] biovizBase_1.30.0           digest_0.6.18              
[19] RColorBrewer_1.1-2          XVector_0.22.0             
[21] checkmate_1.8.5             colorspace_1.3-2           
[23] htmltools_0.3.6             Matrix_1.2-15              
[25] plyr_1.8.4                  XML_3.98-1.16              
[27] pkgconfig_2.0.2             biomaRt_2.38.0             
[29] zlibbioc_1.28.0             scales_1.0.0               
[31] BiocParallel_1.16.0         tibble_1.4.2               
[33] htmlTable_1.12              AnnotationFilter_1.6.0     
[35] ggplot2_3.1.0               SummarizedExperiment_1.12.0
[37] GenomicFeatures_1.34.1      nnet_7.3-12                
[39] lazyeval_0.2.1              survival_2.43-1            
[41] magrittr_1.5                crayon_1.3.4               
[43] memoise_1.1.0               foreign_0.8-71             
[45] data.table_1.11.8           tools_3.5.1                
[47] prettyunits_1.0.2           hms_0.4.2                  
[49] matrixStats_0.54.0          stringr_1.3.1              
[51] munsell_0.5.0               bamsignals_1.14.0          
[53] cluster_2.0.7-1             DelayedArray_0.8.0         
[55] ensembldb_2.6.1             AnnotationDbi_1.44.0       
[57] Biostrings_2.50.1           compiler_3.5.1             
[59] bezier_1.1                  rlang_0.3.0.1              
[61] grid_3.5.1                  RCurl_1.95-4.11            
[63] dichromat_2.0-0             rstudioapi_0.8             
[65] VariantAnnotation_1.28.1    htmlwidgets_1.3            
[67] bitops_1.0-6                base64enc_0.1-3            
[69] gtable_0.2.0                curl_3.2                   
[71] DBI_1.0.0                   R6_2.3.0                   
[73] GenomicAlignments_1.18.0    gridExtra_2.3              
[75] knitr_1.20                  rtracklayer_1.42.0         
[77] bit_1.1-14                  Hmisc_4.1-1                
[79] ProtGenerics_1.14.0         stringi_1.2.4              
[81] Rcpp_1.0.0                  rpart_4.1-13               
[83] acepack_1.4.1      

Base numbers are not a strictly necessary. I just found the behavior strange given my previous experience producing these plots without any major issue. Sorry for the trouble. Freddy

bernatgel commented 5 years ago

Hi @freddymonteiro

You are totally correct. The bug was still there. Should be fixed in 1.8.4 (and devel 1.9.5). Available in Bioconductor in a couple of days and right now in github.

Thanks for the bug report.

Bernat

freddymonteiro commented 5 years ago

Thank you for following this up @bernatgel !! Glad this report is useful and the bug can be fixed soon. Have a great week ahead. Freddy