10.5522/04/11908209.v1 Richard Mott Richard Mott Example Software in R for Homomorphic Encryption University College London 2020 R homomorphic encryption Quantitative Genetic Analyses Computational Biology 2020-02-28 15:45:33 Software https://rdr.ucl.ac.uk/articles/software/Example_Software_in_R_for_Homomorphic_Encryption/11908209 <div># HEGP.example.R</div><div># Author: Richard Mott, UCL Genetics Institute.</div><div># (C) 2019 Richard Mott</div><div><br></div><div># The function CFW.example() will download public data from Nicod et al 2016 Nature Genetics</div><div># That paper analyses outbred CFW mice for many traits, see http://outbredmice.org. </div><div># The function will by default download genotype dosages just for chromosome 11 </div><div># and the phenotypes for Platelets (after correction for covariates). </div><div># These data are chosen because there is a QTL for Platelets on chr11 </div><div># (see http://mtweb.cs.ucl.ac.uk/qtls/Haem.PLT_chr.11.97045910.pdf)</div><div># It will save these data in a Rdata object D that is organised appropriately for</div><div># encryption and analysis by other functions in this file.</div><div># It then simulates an approprately sized encryyption matrix and </div><div># performs association mapping using both original and encrypted data.</div><div># It also computes diagnostic plots and statistics exploring the</div><div># degree of randomness in the encrypted data (evaluated as the correlation </div><div># between the orioginal and encrypted dosages), and the concordance betgween the </div><div># logP values of the association statistics</div><div><br></div><div># A pdf file of diagnostic plots called "chr11.PLT.pdf"</div><div><br></div><div># Text output should be:</div><div> </div><div># > source("HEGP.examples.R")</div><div># > CFW.example(mixed.model=TRUE)</div><div># estimated heritability 0.02534315</div><div># Built kinship dim 1329 1329</div><div># estimated heritability 0.025049</div><div># gwas logP mean diff 0.003140902 max diff 0.02634605 cor 0.9999849</div><div># Min. 1st Qu. Median Mean 3rd Qu. Max.</div><div># 7.400e-08 1.103e-03 2.158e-03 3.141e-03 3.865e-03 2.635e-02</div><div># correlation of plaintext and ciphertext genotypes</div><div># Min. 1st Qu. Median Mean 3rd Qu. Max.</div><div># 1.330e-06 7.942e-03 1.676e-02 2.061e-02 2.989e-02 8.331e-02</div><div># correlation of plaintext and ciphertext phenotypes</div><div># [,1]</div><div># [1,] 0.01833442</div><div># [1] 1</div><div><br></div>