Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification of groups in DMLtest #19

Open
tkanholm opened this issue Nov 8, 2021 · 3 comments
Open

Clarification of groups in DMLtest #19

tkanholm opened this issue Nov 8, 2021 · 3 comments

Comments

@tkanholm
Copy link

tkanholm commented Nov 8, 2021

My understanding from looking at the code is that the methylation difference is calculated as group1 - group2, is that correct? In other words, if methylation in group1 is higher than in group2, the methy.Diff value with be positive. Please let me know!

You may want to clarify the groups in the documentation, rather than saying group1 and group2 are simply "Vectors of sample names or indexes for the two groups to be tested." I assumed my control group would be group1 rather than group2 and was very surprised by the results until I dug into the code to see for myself how the methylation difference is calculated.

Thank you!

@haowulab
Copy link
Owner

haowulab commented Nov 8, 2021

Yes in two-group test (DMLtest function), the difference will be group1 - group2. The output is a data frame like the following. There are mu1/mu2 (for group1/group2). Then intuitively "diff" would be mu1-mu2. Are you suggesting to make this clear in the function help, i.e., to state that diff=mu1-mu2?

chr pos mu1 mu2 diff diff.se stat
chr18 3976129 0.01027497 0.9390339 -0.9287590 0.06544340 -14.19179
chr18 3976138 0.01027497 0.9390339 -0.9287590 0.06544340 -14.19179
chr18 4431501 0.01331553 0.9430566 -0.9297411 0.09273779 -10.02548

It's not clear to me why you were surprised, since you assigned groups when calling the DMLtest function. I mean you can let "control group" to be group1 or group2, it's your choice. Generally speaking, two conditions can be anything. There isn't necessarily a "control", so I used generic name for groups.

@tkanholm
Copy link
Author

tkanholm commented Nov 8, 2021

Thanks for your quick response! I understand your point about keeping groups arbitrary so that it fits all use cases. I would still suggest that you mention that diff=mu1-mu2 in the documentation since the assignment of the groups "matters" in that the direction of methylation change from one group to the other will be opposite depending on which group gets assigned as "1" and which is assigned as "2". Thank you!

@haowulab
Copy link
Owner

haowulab commented Nov 8, 2021

Point taken. I've updated the help functions for DMLtest and callDMR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants