Holly,
Looks like you created your peaks without assigning names for each
range. The helper function BED2RangedData or GFF2RangedData
automatically does that for you. The makeVennDiagram in ChIPpeakAnno
2.4 version assumes the RangedData has names. This assumption has been
removed in ChIPpeakAnno dev 2.5.10 which you can download at
http://bioconductor.org/packages/devel/bioc/html/ChIPpeakAnno.html.
Alternatively, you can add names to your RangedData by using the above
helper functions or using the code below before calling
makeVennDiagram.
rownames(Peaks_A)=1:dim(Peaks_A)[1]
rownames(Peaks_B)=1:dim(Peaks_B)[1]
Please let me know if it works out for you.
Best regards,
Julie
On 8/1/12 11:45 AM, "Holly" <xyang2@uchicago.edu> wrote:
Julie,
Yes, the following example runs well. I attached my two peaks. Thanks
a lot.
Holly
> peaks1 = RangedData(IRanges(start = c(967654, 2010897, 2496704),
+ end = c(967754, 2010997, 2496804), names = c("Site1", "Site2",
"Site3")),
+ space = c("1", "2", "3"),
strand=as.integer(1),feature=c("a","b","f"))
> peaks2 = RangedData(IRanges(start = c(967659,
2010898,2496700,3075866,3123260),
+ end = c(967869, 2011108, 2496920, 3076166, 3123470),
+ names = c("t1", "t2", "t3", "t4", "t5")),
+ space = c("1", "2", "3", "1", "2"), strand = c(1, 1, -1,-1,1),
feature=c("a","b","c","d","a"))
> makeVennDiagram(RangedDataList(peaks1,peaks2), NameOfPeaks=c("TF1",
"TF2"),
+ totalTest=100)
$p.value
[1] 6.184292e-05
$vennCounts
TF1 TF2 Counts
[1,] 0 0 95
[2,] 0 1 2
[3,] 1 0 0
[4,] 1 1 3
attr(,"class")
[1] "VennCounts"
Warning message:
In findOverlappingPeaks(Peaks[[1]], Peaks[[2]], NameOfPeaks1 =
NameOfPeaks[1], :
Please use select instead of multiple!
On 8/1/2012 8:32 AM, Zhu, Lihua (Julie) wrote:
Re: more question about makeVennDiagram Holly,
Could you please try to run the example code in the help page
(?makeVennDiagram) ? If the example works as expected, then please
send me the .Rdata with the two peak files.
For setting the totalTest, please refer to faq at
http://www.bioconductor.org/help/course-
materials/2011/BioC2011/LabStuff/ChIPpeakAnno-BioC2011.pdf
The p.value is obtained from hypergeometric test.
Best regards,
Julie
On 8/1/12 11:25 AM, "Holly" <xyang2@uchicago.edu> wrote:
Julie,
I think the release may not be the issue. The Bioconductor 2.10 is
designed for R2.15.
I installed the package within R as following:
> source("
http://bioconductor.org/biocLite.R"
<http: bioconductor.org="" bioclite.r=""> )
BiocInstaller version 1.4.7, ?biocLite for help
> biocLite("ChIPpeakAnno")
BioC_mirror:
http://bioconductor.org
Using R version 2.15, BiocInstaller version 1.4.7.
Installing package(s) 'ChIPpeakAnno'
trying URL '
http://www.bioconductor.org/packages/2.10/bioc/bin/window
s/contrib/2.15/ChIPpeakAnno_2.4.0.zip'
Content type 'application/zip' length 8028874 bytes (7.7 Mb)
opened URL
downloaded 7.7 Mb
package ChIPpeakAnno successfully unpacked and MD5 sums checked
BTW, should we consider the "totalTest" as a background number of
peaks in the whole genome that a transcription factor could bind?
Do you use FET to calculate the p-value?
Thanks,
Holly
On 8/1/2012 7:52 AM, Zhu, Lihua (Julie) wrote:
Re: more question about makeVennDiagram Holly,
According to your session information, you are using R dev and
released version of ChIPpeakAnno. Please either updpate ChIPpeakAnno
to dev version or use R released version instead. Please let us know
if the issue goes away. Thanks!
Best regards,
Julie
On 8/1/12 12:38 AM, "Holly" <xyang2@uchicago.edu> wrote:
Hey, Julie,
After reading the message at
https://stat.ethz.ch/pipermail/bioconductor/2010-June/033941.html
I enlarged the "totalTest", but still got strange results as
following. Could you please help to debug?
My Peaks_A has 55872 reads, while Peaks_B has 1316 reads.
Thanks,
Holly
> makeVennDiagram(RangedDataList(Peaks_A, Peaks_B),
NameOfPeaks=c("A", "B"),
+ maxgap=0, totalTest=50000000, cex = 1, counts.col =
"red",useFeature=FALSE)
$p.value
[1] 0
$vennCounts
A B Counts
[1,] 0 0 50000062
[2,] 0 1 -62
[3,] 1 0 -62
[4,] 1 1 62
attr(,"class")
[1] "VennCounts"
Warning messages:
1: In findOverlappingPeaks(Peaks[[1]], Peaks[[2]], NameOfPeaks1 =
NameOfPeaks[1], :
Please use select instead of multiple!
2: In findVennCounts(Peaks = Peaks, NameOfPeaks = NameOfPeaks,
maxgap = maxgap, :
negative counts generated when multiple peaks overlap with one
peak!
> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-pc-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] grid stats graphics grDevices utils datasets
methods
[8] base
other attached packages:
[1] ChIPpeakAnno_2.4.0 limma_3.12.1
[3] org.Hs.eg.db_2.7.1 GO.db_2.7.1
[5] RSQLite_0.11.1 DBI_0.2-5
[7] AnnotationDbi_1.18.1
BSgenome.Ecoli.NCBI.20080805_1.3.17
[9] BSgenome_1.24.0 GenomicRanges_1.8.9
[11] Biostrings_2.24.1 IRanges_1.14.4
[13] multtest_2.12.0 Biobase_2.16.0
[15] biomaRt_2.12.0 BiocGenerics_0.2.0
[17] gplots_2.11.0 MASS_7.3-17
[19] KernSmooth_2.23-7 caTools_1.13
[21] bitops_1.0-4.1 gdata_2.11.0
[23] gtools_2.7.0 BiocInstaller_1.4.7
loaded via a namespace (and not attached):
[1] RCurl_1.91-1.1 splines_2.15.0 stats4_2.15.0
survival_2.36-12
[5] tools_2.15.0 XML_3.9-4.1
[[alternative HTML version deleted]]