ChIPseeker::vennplot() fails with Error in ss[[1]] : subscript out of bounds
2
0
Entering edit mode
enricoferrero ▴ 660
@enricoferrero-6037
Last seen 3.0 years ago
Switzerland

Hello,

I'm getting a subscript out of bound error when using plotvenn() from ChIPseeker on a list of GRanges objects:

# load libraries
library(GenomicRanges)
library(ChIPseeker)

# get some GRanges objects
example(GRanges)

# check intersection
intersect(some.gr, longGR)
GRanges object with 7 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chr1   [6, 10]      +
  [2]     chr1   [5, 10]      *
  [3]     chr2   [2, 10]      +
  [4]     chr2   [1, 10]      -
  [5]     chr2   [4, 10]      *
  [6]     chr3   [7, 10]      +
  [7]     chr3   [9, 10]      -
  -------
  seqinfo: 3 sequences from mock1 genome

# visualise intersection with Venn diagram
vennplot(list(some.gr, longGR))
Error in ss[[1]] : subscript out of bounds

> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.7 (Santiago)

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

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

other attached packages:
 [1] ChIPseeker_1.8.3     GenomicRanges_1.24.0 GenomeInfoDb_1.8.1   IRanges_2.6.1        S4Vectors_0.10.1     BiocGenerics_0.18.0
 [7] nvimcom_0.9-16       BiocInstaller_1.22.3 colorout_1.0-2       setwidth_1.0-4

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.5                             RColorBrewer_1.1-2                      plyr_1.8.4
 [4] XVector_0.12.0                          GenomicFeatures_1.24.2                  bitops_1.0-6
 [7] tools_3.3.0                             zlibbioc_1.18.0                         boot_1.3-18
[10] biomaRt_2.28.0                          gridBase_0.4-7                          RSQLite_1.0.0
[13] gtable_0.2.0                            TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 DBI_0.4-1
[16] gridExtra_2.2.1                         UpSetR_1.2.0                            rtracklayer_1.32.0
[19] dplyr_0.4.3                             caTools_1.17.1                          gtools_3.5.0
[22] Biostrings_2.40.1                       grid_3.3.0                              Biobase_2.32.0
[25] R6_2.1.2                                plotrix_3.6-2                           AnnotationDbi_1.34.3
[28] XML_3.98-1.4                            BiocParallel_1.6.2                      gdata_2.17.0
[31] magrittr_1.5                            ggplot2_2.1.0                           gplots_3.0.1
[34] Rsamtools_1.24.0                        scales_0.4.0                            GenomicAlignments_1.8.0
[37] assertthat_0.1                          SummarizedExperiment_1.2.2              colorspace_1.2-6
[40] KernSmooth_2.23-15                      RCurl_1.95-4.8                          munsell_0.4.3

Am I doing something wrong?

Thank you!

 

chipseeker venn vennplot genomicranges granges • 2.3k views
ADD COMMENT
1
Entering edit mode
enricoferrero ▴ 660
@enricoferrero-6037
Last seen 3.0 years ago
Switzerland

I figured it out: vennplot() expects a named list.

This works:

# load libraries
library(GenomicRanges)
library(ChIPseeker)

# get some GRanges objects
example(GRanges)

# check intersection
intersect(some.gr, longGR)
GRanges object with 7 ranges and 0 metadata columns:
      seqnames    ranges strand
         <Rle> <IRanges>  <Rle>
  [1]     chr1   [6, 10]      +
  [2]     chr1   [5, 10]      *
  [3]     chr2   [2, 10]      +
  [4]     chr2   [1, 10]      -
  [5]     chr2   [4, 10]      *
  [6]     chr3   [7, 10]      +
  [7]     chr3   [9, 10]      -
  -------
  seqinfo: 3 sequences from mock1 genome

# visualise intersection with Venn diagram
vennplot(list(gr1=some.gr, gr2=longGR))
ADD COMMENT
0
Entering edit mode
Guangchuang Yu ★ 1.2k
@guangchuang-yu-5419
Last seen 18 days ago
China/Guangzhou/Southern Medical Univer…
pls checkout the vignette, https://www.bioconductor.org/packages/3.3/bioc/vignettes/ChIPseeker/inst/doc/ChIPseeker.html#overlap-of-peaks-and-annotated-genes On Mon, Jul 4, 2016 at 4:25 PM, enricoferrero [bioc] < noreply@bioconductor.org> wrote: > Activity on a post you are following on support.bioconductor.org > > User enricoferrero <https: support.bioconductor.org="" u="" 6037=""/> wrote Question: > ChIPseeker::vennplot() fails with Error in ss[[1]] : subscript out of bounds > <https: support.bioconductor.org="" p="" 84607=""/>: > > Hello, > > I'm getting a subscript out of bound error when using plotvenn() from ChIPseeker > on a list of GRanges objects: > > # load libraries > library(GenomicRanges) > library(ChIPseeker) > > # get some GRanges objects > example(GRanges) > > # check intersection > intersectsome.gr, longGR) > > GRanges object with 7 ranges and 0 metadata columns: > seqnames ranges strand > <rle> <iranges> <rle> > [1] chr1 [6, 10] + > [2] chr1 [5, 10] * > [3] chr2 [2, 10] + > [4] chr2 [1, 10] - > [5] chr2 [4, 10] * > [6] chr3 [7, 10] + > [7] chr3 [9, 10] - > ------- > seqinfo: 3 sequences from mock1 genome# visualise intersection with Venn diagram > > vennplotlistsome.gr, longGR)) > > Error in ss[[1]] : subscript out of bounds > > > sessionInfo() > R version 3.3.0 (2016-05-03) > Platform: x86_64-pc-linux-gnu (64-bit) > Running under: Red Hat Enterprise Linux Server release 6.7 (Santiago) > > locale: > [1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8 LC_COLLATE=C > [5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=C LC_PAPER=en_GB.UTF-8 LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats4 parallel stats graphics grDevices utils datasets methods base > > other attached packages: > [1] ChIPseeker_1.8.3 GenomicRanges_1.24.0 GenomeInfoDb_1.8.1 IRanges_2.6.1 S4Vectors_0.10.1 BiocGenerics_0.18.0 > [7] nvimcom_0.9-16 BiocInstaller_1.22.3 colorout_1.0-2 setwidth_1.0-4 > > loaded via a namespace (and not attached): > [1] Rcpp_0.12.5 RColorBrewer_1.1-2 plyr_1.8.4 > [4] XVector_0.12.0 GenomicFeatures_1.24.2 bitops_1.0-6 > [7] tools_3.3.0 zlibbioc_1.18.0 boot_1.3-18 > [10] biomaRt_2.28.0 gridBase_0.4-7 RSQLite_1.0.0 > [13] gtable_0.2.0 TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 DBI_0.4-1 > [16] gridExtra_2.2.1 UpSetR_1.2.0 rtracklayer_1.32.0 > [19] dplyr_0.4.3 caTools_1.17.1 gtools_3.5.0 > [22] Biostrings_2.40.1 grid_3.3.0 Biobase_2.32.0 > [25] R6_2.1.2 plotrix_3.6-2 AnnotationDbi_1.34.3 > [28] XML_3.98-1.4 BiocParallel_1.6.2 gdata_2.17.0 > [31] magrittr_1.5 ggplot2_2.1.0 gplots_3.0.1 > [34] Rsamtools_1.24.0 scales_0.4.0 GenomicAlignments_1.8.0 > [37] assertthat_0.1 SummarizedExperiment_1.2.2 colorspace_1.2-6 > [40] KernSmooth_2.23-15 RCurl_1.95-4.8 munsell_0.4.3 > > Am I doing anything wrong? > > Thank you! > > > > ------------------------------ > > Post tags: chipseeker, venn, vennplot, genomicranges, granges > > You may reply via email or visit ChIPseeker::vennplot() fails with Error in ss[[1]] : subscript out of bounds > -- --~--~---------~--~----~------------~-------~--~----~ Guangchuang Yu, PhD Candidate State Key Laboratory of Emerging Infectious Diseases School of Public Health The University of Hong Kong Hong Kong SAR, China www: https://guangchuangyu.github.io -~----------~----~----~----~------~----~------~--~---
ADD COMMENT
1
Entering edit mode

Thanks, however that doesn't really help because the example in the vignette is a list of gene IDs while here I'm using a list of GRanges.

The issue is that the list of GRanges has to be named (see my own answer). It might be worth adding it to the documentation.

ADD REPLY
1
Entering edit mode

thanks for your feedback. I have updated the code to throw error of 'input object should be a named list' if it is not.

 

ADD REPLY

Login before adding your answer.

Traffic: 345 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