[R] how do I add text lables on QQ plot

Ana Marija @okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Wed Mar 11 05:51:40 CET 2020


Hello,

I am making QQ plot via:

library(ggman)
qq(fdr2_sorted$FDR.q.val2, main = "RG_All", pch = 17,
col=fdr1_sorted$group, cex = 1, las = 1)

data frames used look like this:

> head(fdr1_sorted)
                                       NAME             GS<br> follow
link to MSigDB  GS DETAILS SIZE         ES       NES NOM p-val
1:                 GO_DNA_PACKAGING_COMPLEX
GO_DNA_PACKAGING_COMPLEX Details ...   77  0.6757226  2.466745
0
2:                   GO_PROTEIN_DNA_COMPLEX
GO_PROTEIN_DNA_COMPLEX Details ...  132  0.5958179  2.346520         0
3:         GO_RESPONSE_TO_TYPE_I_INTERFERON
GO_RESPONSE_TO_TYPE_I_INTERFERON Details ...   52 -0.7521569 -2.533148
        0
4:          GO_RESPONSE_TO_INTERFERON_GAMMA
GO_RESPONSE_TO_INTERFERON_GAMMA Details ...  101 -0.6370415 -2.420473
       0
5: GO_CELLULAR_RESPONSE_TO_INTERFERON_GAMMA
GO_CELLULAR_RESPONSE_TO_INTERFERON_GAMMA Details ...   85 -0.6571892
-2.402153         0
6:                 GO_GRANULOCYTE_MIGRATION
GO_GRANULOCYTE_MIGRATION Details ...   43 -0.7332099 -2.398983
0
   FDR q-val FWER p-val RANK AT MAX                   LEADING EDGE V12
group FDR.q.val2
1:         0          0        1111 tags=43%, list=10%, signal=47%  NA
    2      1e-10
2:         0          0        1516 tags=39%, list=13%, signal=45%  NA
    2      1e-10
3:         0          0        1427 tags=54%, list=12%, signal=61%  NA
    4      1e-10
4:         0          0        1819 tags=45%, list=16%, signal=52%  NA
    4      1e-10
5:         0          0        1216 tags=38%, list=11%, signal=42%  NA
    4      1e-10
6:         0          0         491  tags=28%, list=4%, signal=29%  NA
    4      1e-10

> head(fdr2_sorted)
                                       NAME             GS<br> follow
link to MSigDB  GS DETAILS SIZE         ES       NES NOM p-val
1:                 GO_DNA_PACKAGING_COMPLEX
GO_DNA_PACKAGING_COMPLEX Details ...   77  0.6757226  2.466745
0
2:                   GO_PROTEIN_DNA_COMPLEX
GO_PROTEIN_DNA_COMPLEX Details ...  132  0.5958179  2.346520         0
3:         GO_RESPONSE_TO_TYPE_I_INTERFERON
GO_RESPONSE_TO_TYPE_I_INTERFERON Details ...   52 -0.7521569 -2.533148
        0
4:          GO_RESPONSE_TO_INTERFERON_GAMMA
GO_RESPONSE_TO_INTERFERON_GAMMA Details ...  101 -0.6370415 -2.420473
       0
5: GO_CELLULAR_RESPONSE_TO_INTERFERON_GAMMA
GO_CELLULAR_RESPONSE_TO_INTERFERON_GAMMA Details ...   85 -0.6571892
-2.402153         0
6:                 GO_GRANULOCYTE_MIGRATION
GO_GRANULOCYTE_MIGRATION Details ...   43 -0.7332099 -2.398983
0
   FDR q-val FWER p-val RANK AT MAX                   LEADING EDGE V12
FDR.q.val2
1:         0          0        1111 tags=43%, list=10%, signal=47%  NA
     1e-10
2:         0          0        1516 tags=39%, list=13%, signal=45%  NA
     1e-10
3:         0          0        1427 tags=54%, list=12%, signal=61%  NA
     1e-10
4:         0          0        1819 tags=45%, list=16%, signal=52%  NA
     1e-10
5:         0          0        1216 tags=38%, list=11%, signal=42%  NA
     1e-10
6:         0          0         491  tags=28%, list=4%, signal=29%  NA
     1e-10

and I would like to get the plot like the one in attach.

Please advise,
Ana

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rsz_qqanot.png
Type: image/png
Size: 76403 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20200310/d24efc4e/attachment.png>


More information about the R-help mailing list