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

baseMean in ggmaplot is not real A #198

Closed
QiangShiPKU opened this issue Aug 5, 2019 · 8 comments
Closed

baseMean in ggmaplot is not real A #198

QiangShiPKU opened this issue Aug 5, 2019 · 8 comments
Labels

Comments

@QiangShiPKU
Copy link

QiangShiPKU commented Aug 5, 2019

Hi, I noticed that the baseMean is (R+G)/2 (thus log2( (R+G)/2 ) rather than real A belows
https://en.wikipedia.org/wiki/MA_plot
image
image

@QiangShiPKU QiangShiPKU changed the title baseMean is not real A baseMean in ggmaplot is not real A Aug 5, 2019
@kassambara
Copy link
Owner

ok, thanks. the ggmaplot() expect a column containing mean and log2foldchange for creating the plot. No computation is made inside the function.

@QiangShiPKU
Copy link
Author

QiangShiPKU commented May 10, 2020

ok, thanks. the ggmaplot() expect a column containing mean and log2foldchange for creating the plot. No computation is made inside the function.

The real A in MA plot is the mean of two log-scale values (log first, then mean), instead of log scale of the mean of two values (mean first, then log). However, if I am not mistaken, ggmaplot() uses the log scale of the baseMean column as X axis, that is not real A. If users supply only the mean of two values but not two original values, the real A cannot be calculated. So, I think this function should expect two original/log-scale columns to calculate their mean (real A) as X axis.

@kassambara
Copy link
Owner

thank you @QiangShiPKU for the clarification, I can see now the problem.

Let's keep this issue open

@kassambara kassambara reopened this May 10, 2020
@kassambara
Copy link
Owner

The design of this function was influenced by the DESeq2 pipeline (https://www.bioconductor.org/packages/devel/workflows/vignettes/rnaseqGene/inst/doc/rnaseqGene.html#ma-plot), were log2 fold change is plotted against the basemean in log scale..

Obviously, I think that an option should be available in ggmaplot() to create a real MA-plot as you mentionned.

@QiangShiPKU
Copy link
Author

Great

@kassambara
Copy link
Owner

I think that we should allow two possible formats for the input data:

1/
baseMean | log2FoldChange|padj

Here, we'll use log2(baseMean) as the x-axis variable (like in the current version of the function)

2/
baseMeanLog2 | log2FoldChange|padj

here, baseMeanLog2 is assumed to be the mean of logged values; so we'll use it as x-axis variable without any transformation

@QiangShiPKU
Copy link
Author

That's a good idea

@kassambara
Copy link
Owner

fixed now, thanks

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

No branches or pull requests

2 participants