Comparing multiple treatment groups

1,469 views
Skip to first unread message

davidf...@gmail.com

unread,
Mar 2, 2017, 8:38:16 AM3/2/17
to methylkit_discussion
We have an RRBS dataset with 4 treatment groups, n=6 samples each group. I'd like to be able to do an ANOVA-style first stage analysis to look for evidence that treatment effects exist in the dataset as a whole, before moving forward into pairwise post-hoc analyses. We've been using Methylkit (beta binomial distribution) for pairwise analyses.  But am I correct that it does not currently support multi-group comparisons? If indeed methylkit doesn't support such analyses, is there another package that does? Otherwise, does anyone have advice about how I might go forward to do this (build my own GLM in R for example)? 

thanks for any advice,
David

Queen Mary University, London

Gmail Marcin

unread,
Mar 2, 2017, 10:01:13 AM3/2/17
to methylkit_...@googlegroups.com
I think it is very good question and yes, methylkit does not support that. As a community, we are there indeed with the analysis where multiple comparisons are necessary. Similar to what limma can do or DEseq2/edgeR for transcriptomic data.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_discussion@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.



--
smoking cigarettes causes cancer

Altuna Akalin

unread,
Mar 2, 2017, 10:32:52 AM3/2/17
to methylkit_...@googlegroups.com
Hi, 
I think there is code base to support the simple case where you are looking for any effect between groups. It might even work out of the box or after removing some of the "checks" in the source code (this has to be done by me or someone else in the development team). 

Have you tried with the latest version and provide a treatment vector such as c(2,2,1,1,0,0) ? If I remember correctly, in this case it should return what you need in the logistic regression version, not beta-binomial. Logistic regression is as good as the beta-binomial model when over-dispersion correction is applied (http://biorxiv.org/content/early/2017/02/17/109512 )

However, you will still need to do pairwise analysis separately, by subsetting your data and changing the treatment vector.

Best,
Altuna



On Thu, Mar 2, 2017 at 4:01 PM, Gmail Marcin <marcin.b...@gmail.com> wrote:
I think it is very good question and yes, methylkit does not support that. As a community, we are there indeed with the analysis where multiple comparisons are necessary. Similar to what limma can do or DEseq2/edgeR for transcriptomic data.
On 2 March 2017 at 14:38, <davidf...@gmail.com> wrote:
We have an RRBS dataset with 4 treatment groups, n=6 samples each group. I'd like to be able to do an ANOVA-style first stage analysis to look for evidence that treatment effects exist in the dataset as a whole, before moving forward into pairwise post-hoc analyses. We've been using Methylkit (beta binomial distribution) for pairwise analyses.  But am I correct that it does not currently support multi-group comparisons? If indeed methylkit doesn't support such analyses, is there another package that does? Otherwise, does anyone have advice about how I might go forward to do this (build my own GLM in R for example)? 

thanks for any advice,
David

Queen Mary University, London

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsubscrib...@googlegroups.com.

To post to this group, send email to methylkit_discussion@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.
--
smoking cigarettes causes cancer

David Clayton

unread,
Mar 3, 2017, 8:09:28 AM3/3/17
to methylkit_...@googlegroups.com, Julia George, Daniel Condliffe
Hi - thanks for your quick and helpful response.  

We’ve now tried what you suggested, providing a treatment vector for all 24 samples in 4 groups, running version 1.1.6.  

As you can see on the attached R Markdown Notebook (methylKit_multi.nb.html), the program runs up to the “calculateDiffMeth” command where it returns an error:
"can not do differential methylation calculation when there are more than two groups”.

Can you suggest anything else we might try? As a workaround, we’re considering a two step strategy where we start by collecting all the sites that surpass a significance threshold (Q < 0.1 and meth.diff > 30%) in any one of the individual pairwise comparisons in methylkit — in our case this yields 311 sites. We would then take the means for each sample (at each site) forward into a GLM, where we can test the statistical significance of a given site when we consider the data from all 4 groups at once.  That’s kind of a backwards approach to the usual ANOVA approach, as we’re effectively doing the post hoc comparison first.

Thanks
David






************************************************************
David F. Clayton, Ph.D, Professor of Neuroscience, FRSB, CIFAR Senior Fellow
Department of Biological & Experimental Psychology
School of Biological & Chemical Sciences
Queen Mary, University of London, UK  E1 4NS
skype: davidfclayton
twitter: @davidfclayton
iMessage: dcla...@mac.com
mobile: +44 (0) 744 747 2943

You received this message because you are subscribed to a topic in the Google Groups "methylkit_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/methylkit_discussion/mTpy8I9dJUk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to methylkit_discus...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.
methylKit_multi.nb.html

Gmail Marcin

unread,
Mar 3, 2017, 8:50:35 AM3/3/17
to methylkit_...@googlegroups.com, Julia George, Daniel Condliffe

As mentioned before by Altuna you need to  subset the vector such as c(0,0,1,1,0,0)

You received this message because you are subscribed to a topic in the Google Groups "methylkit_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/methylkit_discussion/mTpy8I9dJUk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to methylkit_discussion+unsub...@googlegroups.com.

To post to this group, send email to methylkit_discussion@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_discussion@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.



--
smoking cigarettes causes cancer

Altuna Akalin

unread,
Mar 13, 2017, 8:08:06 PM3/13/17
to methylkit_...@googlegroups.com, Julia George, Daniel Condliffe
OK, i need to add this to the future versions then. You can do what Marcin suggested. What you are doing is also could work.

If you want to use a full GLM with multiple treatment groups, as I wrote there is support for that, the internal logReg function can deal with multiple treatment groups and additional covariates:

However, a check has to be removed (https://github.com/al2na/methylKit/blob/master/R/diffMeth.R#L714) before logReg function can work with multiple groups. If you either run the internal logReg function or fork the repo and remove the if clause and confirm calculateDiffMeth works with multiple treatment groups I can add it to the next update.

Best,
Altuna

You received this message because you are subscribed to a topic in the Google Groups "methylkit_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/methylkit_discussion/mTpy8I9dJUk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to methylkit_discussion+unsub...@googlegroups.com.

To post to this group, send email to methylkit_discussion@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

Britta

unread,
Jul 31, 2017, 11:58:21 AM7/31/17
to methylkit_discussion, j.ge...@qmul.ac.uk, d.con...@qmul.ac.uk
Dear Altuna, Dear all,

I am using multiple treatments (6 different groups) and your diffMeth function. Do I have to remove anything (like any if clause - as you wrote before) in the code for this? This is not fully clear for me after I found this discussion here online. Or was this updated in the current version?
It seems working as I get a list for e.g. my hypermethylated positions. 

myDiff25p.hyper
methylDiffDB object with 509 rows
--------------
   chr   start     end strand       pvalue       qvalue meth.diff
1 chrI 1859476 1859476      * 1.917580e-09 1.040584e-03  30.62214
2 chrI 1894439 1894439      * 4.405131e-22 2.390466e-16  32.04457
3 chrI 1961445 1961445      * 7.666745e-15 4.160397e-09  25.88659

Though I found these global statistics for diff meth sites for multiple groups, is there a way to find which groups are significant with which group (a pairwise table of comparisons)? I also saw for the global statistics, you use the absolute value for diff. methylatied sites (meth.diff). But I would be interested to know which of the group is hypo- or hypermethylated (e.g. the actual and not the absolute value). For instance, I saw if you estimate the diffmeth between two groups, you are getting, which of the group has the low methylation. 

In case the two group comparisons can not be implemented in the multiple treatment statistics, I assume I have to do multiple comparisons and standard corrections as bonferroni. Therefore the two follow up questions:
If I apply the bonferroni correction, does this mean that the function adjust the p-values based on the number of treatments? And if so, I don't  have to change the q-value accordingly, right?
If I don't include the bonferroni correction and run multiple pairwise statistics, is it correct if I reduce the q-value based on my multiple comparisons? 

Thanks a lot!
Britta
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit...@googlegroups.com.
--
smoking cigarettes causes cancer

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit...@googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "methylkit_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/methylkit_discussion/mTpy8I9dJUk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to methylkit_discussion+unsub...@googlegroups.com.

To post to this group, send email to methylkit...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.

Altuna Akalin

unread,
Jul 31, 2017, 2:38:01 PM7/31/17
to methylkit_...@googlegroups.com
On Mon, Jul 31, 2017 at 5:58 PM, Britta <britta....@gmail.com> wrote:
Dear Altuna, Dear all,

I am using multiple treatments (6 different groups) and your diffMeth function. Do I have to remove anything (like any if clause - as you wrote before) in the code for this? This is not fully clear for me after I found this discussion here online. Or was this updated in the current version?
It seems working as I get a list for e.g. my hypermethylated positions. 
 
Yes, now multiple group tests works, we changed it in the latest versions.

 

myDiff25p.hyper
methylDiffDB object with 509 rows
--------------
   chr   start     end strand       pvalue       qvalue meth.diff
1 chrI 1859476 1859476      * 1.917580e-09 1.040584e-03  30.62214
2 chrI 1894439 1894439      * 4.405131e-22 2.390466e-16  32.04457
3 chrI 1961445 1961445      * 7.666745e-15 4.160397e-09  25.88659

Though I found these global statistics for diff meth sites for multiple groups, is there a way to find which groups are significant with which group (a pairwise table of comparisons)?

You need to use reorganize() and do the pair-wise tests separately. 
 
I also saw for the global statistics, you use the absolute value for diff. methylatied sites (meth.diff). But I would be interested to know which of the group is hypo- or hypermethylated (e.g. the actual and not the absolute value). For instance, I saw if you estimate the diffmeth between two groups, you are getting, which of the group has the low methylation. 

again for pair-wise interest, you have to do pair-wise comparisons.
 
In case the two group comparisons can not be implemented in the multiple treatment statistics, I assume I have to do multiple comparisons and standard corrections as bonferroni. Therefore the two follow up questions:

You are doing multiple testing in any case, I would just do the pair-wise tests and use the q-value correction. If you want to be cautious, do the pair-wise tests and adjust the p-values from all pairwise comparisons using q-value correction, in that case if you have 10000 CpGs in each pair-wise test, and you are interested in 4 pairs, you are correcting using 40000 p-values. This can not be done in methylKit but you can calculate it via q-value package and replace the values in methylDiff objects with those q-values.

another idea is to first use the multiple treatments test, get the interesting CpGs/regions and only for those CpGs/regions do pair-wise tests, this should shorten the run-time.

Best,
Altuna
 
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsubscrib...@googlegroups.com.
To post to this group, send email to methylkit...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.
--
smoking cigarettes causes cancer

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsubscrib...@googlegroups.com.
To post to this group, send email to methylkit...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the Google Groups "methylkit_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/methylkit_discussion/mTpy8I9dJUk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to methylkit_discussion+unsubscrib...@googlegroups.com.

To post to this group, send email to methylkit...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsubscrib...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_discussion@googlegroups.com.

adefel...@gmail.com

unread,
Jan 31, 2019, 10:38:27 AM1/31/19
to methylkit_discussion
Hi Altuna,

I'm having the same issue and I can't figure out how to analyze multiple treatments groups.
 
On Mon, Jul 31, 2017 at 5:58 PM, Britta <britta....@gmail.com> wrote:
Dear Altuna, Dear all,

I am using multiple treatments (6 different groups) and your diffMeth function. Do I have to remove anything (like any if clause - as you wrote before) in the code for this? This is not fully clear for me after I found this discussion here online. Or was this updated in the current version?
It seems working as I get a list for e.g. my hypermethylated positions. 
 
Yes, now multiple group tests works, we changed it in the latest versions.

It worked for me. Now I have a myDiff object with 5 groups.

myDiff25p.hyper
methylDiffDB object with 509 rows
--------------
   chr   start     end strand       pvalue       qvalue meth.diff
1 chrI 1859476 1859476      * 1.917580e-09 1.040584e-03  30.62214
2 chrI 1894439 1894439      * 4.405131e-22 2.390466e-16  32.04457
3 chrI 1961445 1961445      * 7.666745e-15 4.160397e-09  25.88659

Though I found these global statistics for diff meth sites for multiple groups, is there a way to find which groups are significant with which group (a pairwise table of comparisons)?

You need to use reorganize() and do the pair-wise tests separately. 

I can't reorganize() the myDiff object. So, could you explain how I can do the pair-wise tests using myDiff object, please?

Thank you.

Alexandre
 
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.
--
smoking cigarettes causes cancer

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the Google Groups "methylkit_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/methylkit_discussion/mTpy8I9dJUk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to methylkit_discussion+unsub...@googlegroups.com.

To post to this group, send email to methylkit...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discussion+unsub...@googlegroups.com.

Altuna Akalin

unread,
Feb 6, 2019, 6:27:03 AM2/6/19
to methylkit_...@googlegroups.com
You need to use reorganize and get pairs before applying the test, than you will have pairwise results

To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discus...@googlegroups.com.
To post to this group, send email to methylkit...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.
--
smoking cigarettes causes cancer

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discus...@googlegroups.com.
To post to this group, send email to methylkit...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the Google Groups "methylkit_discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/methylkit_discussion/mTpy8I9dJUk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to methylkit_discus...@googlegroups.com.

To post to this group, send email to methylkit...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discus...@googlegroups.com.
To post to this group, send email to methylkit_...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discus...@googlegroups.com.

To post to this group, send email to methylkit_...@googlegroups.com.
Visit this group at https://groups.google.com/group/methylkit_discussion.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "methylkit_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to methylkit_discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages