Interaction with DESeq2 via DiffBind
6
0
Entering edit mode
rbronste ▴ 60
@rbronste-12189
Last seen 5.1 years ago

Hi wondering how I can use the following DESeq2 logic within the framework of DiffBind for calling differential peaks and looking at multiple interactions:

to look at interaction--
dds<-DESeqDataSetFromMatrix(countData = countData,
                           colData = colData,
                           design = ~ sex + treatment + sex:treatment)
dds$sex<-relevel(dds$sex, ref="female")
dds$age<-relevel(dds$treatment, ref="CO")

dds <- DESeq(dds)
resultsNames(dds)
results(dds, name="sexmale.treatment")
diffbind deseq2 interactions • 3.0k views
ADD COMMENT
2
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 5 weeks ago
Cambridge, UK

Currently DiffBind only handles fairly simple designs. I'm looking to upgrade this in future, but the original idea was that if you wanted to do more complex modelling, you should use the underlying DE package (DESeq2) directly.

Cheers-

Rory

ADD COMMENT
0
Entering edit mode

Thanks Rory! Would it be fair to use the dba.count output matrix and feed that into DESeq2 via DEseqDataSetFromMatrix?

So as to get around having to manually create a read depth adjusted matrix for all of your peaks?

Thanks again.

ADD REPLY
2
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 5 weeks ago
Cambridge, UK

Well, 3 years later, the latest release of DiffBind finally supports unrestricted models, as well as an clean interface for retrieving DESeq2 analysis objects...

ADD COMMENT
0
Entering edit mode

Dear R. Stark,

I am very enjoy to test the last DiffBind package for my data, since you updated it to include more complex design ! I'm a bit loss when I build the model: I try to analyse the effect of Tissue (3 levels) and Condition (3 levels) and Tissue:Condition

model <- dba.contrast(data,design="~Tissue+Condition+Tissue:Condition") But the dba.show() with bContrasts = T function gave me only 6 contrasts, Tissue vs Tissue and Condition versus Condition. The aim of my work is to know if in the Tissue A in Condition 1 vs Tissue B Condition 1 could have differential peaks and if Tissue A is different in Condition 1 vs 2 Using DESeq2 to my RNA-seq data I can build a model with interaction and extract interaction terms or mean effect. It is possible in the current version of DiffBind for my Chip-seq data ?

ADD REPLY
1
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 5 weeks ago
Cambridge, UK

You should be able to use any model design and set up any contrasts that you are able to in DESeq2 directly. You may need to set up some compound factors to get the contrast you want. It can also be helpful to check using bGetCoefficients=TRUE to understand what the coefficients are.

ADD COMMENT
1
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 5 weeks ago
Cambridge, UK

You can relevel the metadata using the reorderMeta parameter to dba.contrast(). You can just set the reference level or all the levels for a metadata factor. See the help page for dba.contrast().

You can specify any contrast that you could using DESeq2 directly. You have to specify them one at a time with separate calls to dba.contrast().

For example:

k4model <- dba.contrast(k4norm,design="~Tissue+Condition+Tissue:Condition", 
                        reorderMeta=list(Tissue="A",Condition="1"))
k4.model.coeffs <- dba.contrast(k4model, bGetCoefficients=TRUE )
k4model <- dba.contrast(k4model, contrast=list("Tissue_C_vs_A","Tissue_B_vs_A" ))
k4model <- dba.contrast(k4model, contrast="TissueB.Condition2") # implies comparison to reference "TissueA.Condition1"

After setting up all the contrasts of interest, you can call dba.analyze() to compute the model and perform the testing for each contrast. Then you can get the results by calling dba.report() or one of the plotting functions. These need to be called in turn for each contrast:

k4model <- dba.analyze(k4model)
k4model.contrast1 <- dba.report(k4model, contrast=1)
k4model.contrast2 <- dba.report(k4model, contrast=2)
ADD COMMENT
0
Entering edit mode
@pierremarin-17659
Last seen 3.9 years ago

Dear R. stark,

Following your answer, these are my steps :

k4dba <- dba(sampleSheet = chipk4)

k4count <- dba.count(k4dba,bParallel = T)

k4norm <- dba.normalize(k4count)

k4model <- dba.contrast(k4norm,design="~Tissue+Condition+Tissue:Condition",bGetCoefficients = T)

The coefficient obtained are:

"Intercept" "Tissue_C_vs_A" "Tissue_B_vs_A" "Condition_3_vs_1" "Condition_2_vs_1" "TissueC.Condition3" "TissueB.Condition3" "TissueC.Condition2" "TissueB.Condition2"

Currently when I want to make a contrast on DESeq2 for example: What is the difference between Tissue C and B ? --> contrast = list( "Tissue_C_vs_A" "Tissue_B_vs_A" ) Or if I want the interaction i.e, the condition 2 on the tissue B --> contrast = c("TissueB.Condition2")

For DiffBind, how to make these contrasts ? Using the dba.contrast() or dba.report() and before the dba.analyse() ?

Moreover, using a simply relevel() can I modify the reference level of the Tissue or Condition ?

Thanks

ADD COMMENT
0
Entering edit mode
@pierremarin-17659
Last seen 3.9 years ago

Dear R. stark,

Thank you, this is perfect for the next steps !

Thank again

P. Marin

ADD COMMENT

Login before adding your answer.

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