Diffbind plotting on contrasts
1
0
Entering edit mode
medinaale • 0
@medinaale-7249
Last seen 9.3 years ago
Canada

Hi !

Hi

I want to draw a venn diagram of the peaks shared across four Tissues in my data set, but I'm not able to correctly select the set of peaks or create a contrast that achieves this.

The idea is to get four way vennDiagram with the four Tissues.

I have tried different things

> Example.data <- dba(sampleSheet=Example.table, minOverlap=1)
> Example.data.counts <- dba.count(Example.data, minOverlap=2,  score=score.value )
> Example.data.counts

8 Samples, 101978 sites in matrix:

       ID Tissue Factor Condition Replicate Caller Intervals FRiP

1 Tissue1_1  Tissue1     AC        EC         1 counts    101978 0.64

2 Tissue1_2  Tissue1     AC        EC         2 counts    101978 0.77

3 Tissue2_1  Tissue2 not_AC        EC         1 counts    101978 0.62

4 Tissue2_2  Tissue2 not_AC        EC         2 counts    101978 0.73

5  Tissue3_1   Tissue3 not_AC     NotEC         1 counts    101978 0.54

6  Tissue3_2   Tissue3 not_AC     NotEC         2 counts    101978 0.53

7 Tissue4_1  Tissue4 not_AC     NotEC         1 counts    101978 0.71

8 Tissue4_2  Tissue4 not_AC     NotEC         2 counts    101978 0.62

8 Samples, 101978 sites in matrix:

       ID Tissue Factor Condition Replicate Caller Intervals FRiP

1 Tissue1_1  Tissue1     AC        EC         1 counts    101978 0.64

2 Tissue1_2  Tissue1     AC        EC         2 counts    101978 0.77

3 Tissue2_1  Tissue2 not_AC        EC         1 counts    101978 0.62

4 Tissue2_2  Tissue2 not_AC        EC         2 counts    101978 0.73

5  Tissue3_1   Tissue3 not_AC     NotEC         1 counts    101978 0.54

6  Tissue3_2   Tissue3 not_AC     NotEC         2 counts    101978 0.53

7 Tissue4_1  Tissue4 not_AC     NotEC         1 counts    101978 0.71

8 Tissue4_2  Tissue4 not_AC     NotEC         2 counts    101978 0.62

> Example.data.counts.2 <- dba.contrast(Example.data.counts.2,categories=DBA_TISSUE, minMembers=2)


> Example.data.counts.2
8 Samples, 101978 sites in matrix:
       ID Tissue Factor Condition Replicate Caller Intervals FRiP
1 Tissue1_1  Tissue1     AC        EC         1 counts    101978 0.64
2 Tissue1_2  Tissue1     AC        EC         2 counts    101978 0.77
3 Tissue2_1  Tissue2 not_AC        EC         1 counts    101978 0.62
4 Tissue2_2  Tissue2 not_AC        EC         2 counts    101978 0.73
5  Tissue3_1   Tissue3 not_AC     NotEC         1 counts    101978 0.54
6  Tissue3_2   Tissue3 not_AC     NotEC         2 counts    101978 0.53
7 Tissue4_1  Tissue4 not_AC     NotEC         1 counts    101978 0.71
8 Tissue4_2  Tissue4 not_AC     NotEC         2 counts    101978 0.62

10 Contrasts:
   Group1 Members1 Group2 Members2
1   Tissue1        2  Tissue2        2
2   Tissue1        2   Tissue3        2
3   Tissue1        2  Tissue4        2
4   Tissue1        2 !Tissue1        6
5   Tissue2        2   Tissue3        2
6   Tissue2        2  Tissue4        2
7   Tissue2        2 !Tissue2        6
8    Tissue3        2  Tissue4        2
9    Tissue3        2  !Tissue3        6
10  Tissue4        2 !Tissue4        6


> dba.plotVenn(Example.data.counts.2, contrast=3)
Error in dba.plotVenn(Example.data.counts.2, contrast = 3) : 
  No peaksets meet specified criteria.
In addition: Warning message:
No valid contrasts/methods specified. 


I tried several contrast number and vectors and I never get a plot.

The I tried to do what is shown in the manual example:

> Example.data.counts.2 <- dba.peakset(Example.data.counts.2, consensus = DBA_TISSUE, minOverlap=0.66)
Add consensus: Tissue1
Add consensus: Tissue2
Add consensus: Tissue3
Add consensus: Tissue4
> dba.plotVenn(Example.data.counts.2, Example.data.counts.2$masks$Consensus)
Error in dba.plotVenn(Example.data.counts.2, Example.data.counts.2$masks$Consensus) : 
  Too many peaksets in mask.

Which makes sense since:
> Example.data.counts.2$masks$Consensus
Tissue1_1 Tissue1_2 Tissue2_1 Tissue2_2  Tissue3_1  Tissue3_2 Tissue4_1 Tissue4_2   Tissue1   Tissue2 
   TRUE    TRUE    TRUE    TRUE    TRUE    TRUE    TRUE    TRUE    TRUE    TRUE 
   Tissue3   Tissue4 
   TRUE    TRUE 

I thoguth that the idea of asking for the tissue consensus was to only get TRUEs in the last four terms since the other are the Replicate names.

Then I tried this:

dba.plotVenn(Example.data.counts.2, Example.data.counts.2$masks$Tissue1,Example.data.counts.2$masks$Tissue2,Example.data.counts.2$masks$Tissue3, Example.data.counts.2$masks$Tissue4 )

Now I don't get an error but I don't get a graph either.

If someone could provide some clues on how to achieve this I would really appreciate it.

diffbind chip-seq • 1.9k views
ADD COMMENT
0
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 14 days ago
Cambridge, UK

Sorry it has taken a while to respond but I am travelling right now. I'll have to check later why the Consensus mask is all TRUE, but I can give you a workaround. Try:

dba.plotVenn(Example.data.counts.2, 9:12)

 

 

 

ADD COMMENT
0
Entering edit mode

I have looked into this further. in the development release (1,17) and onwards, dba,peakset() will abort with an error if you try to added consensus peaksets to what is already a consensus object after counting. dba.overlap() and dba.plotVenn() will, however, work if you want to see which of the peaks in the consensus were called in which sam

ADD REPLY

Login before adding your answer.

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