[R] how to create a plot of permutation of 30 random values and show proportion of values

Ana Marija @okov|c@@n@m@r|j@ @end|ng |rom gm@||@com
Thu Jan 23 21:10:12 CET 2020


Hello,

I have a data frame which looks like this:

> head(a,20)
             rs   pvalue
 1: rs185642176 0.267407
 2: rs184120752 0.787681
 3:  rs10904045 0.508162
 4:  rs35849539 0.875910
 5: rs141633513 0.787759
 6:   rs4468273 0.542171
 7:   rs4567378 0.539484
 8:   rs7084251 0.126445
 9: rs181605000 0.787838
10:  rs12255619 0.192719
11: rs140367257 0.788008
12:  rs10904178 0.969814
13:   rs7918960 0.436341
14:  rs61688896 0.526256
15: rs151283848 0.787284
16: rs140174295 0.989107
17: rs145945079 0.787015
18:   rs4881370 0.455089
19: rs183895035 0.787015
20: rs181749526 0.787015
> dim(a)
[1] 3859763       2

What I would like to do is to take random subsets of 30 of those rs
throughout the dataframe and find out which subsets of those generated
have FDR value <0.05

FDR I would calculate I guess with:
a$fdr=p.adjust(a$pvalue,method="BH")

but I also guess I would be calculating only FDR for a particular
subset of 30 randomly chosen rs, not for the whole data set.

The result I would like to present like in the attached plot. The
x-axis say proportion of SNPs and in my case SNP is equivalent to rs

Can you please help with this, I really don't have idea how to go about this.

Thanks
Ana

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2020-01-23 at 2.09.26 PM.png
Type: image/png
Size: 352485 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20200123/9648e05d/attachment.png>


More information about the R-help mailing list