README.md

CONfounding Factor Estimation Through Independent Component Analysis (CONFETI) R package

Installation Instructions

Dependencies

confeti requires the installation of the following two dependencies. Please follow the installation instructions to install both packages prior to installing confeti.

Installation Instructions

After installing the above packages, run the following code to install confeti.


install.packages("devtools")

library("devtools")

devtools::install_github("jinhyunju/confeti")

Note

A dependency issue is currently being worked out that causes an error in calling the ica_genotype_test() function. The temporary work around is to load the package lrgpr into the main workspace with confeti. I do understand that this is not an optimal solution and apologize for the inconvenience. I am currently trying to fix the issue, but in the mean time lrgpr will be listed in the Depends field in the DESCRIPTION file, which automatically loads lrgpr when confeti is loaded.

Usage

1) Creating a sample covariance matrix using CONFETI

A confeti sample covariance matrix can be constructed by the function confeti().

You will need two objects in your R environment.


library(confeti)

confeti_results = confeti(expr_data, snp_data, return_all = FALSE)


confeti_results will be a list with 2 levels.

2) Fitting a linear mixed model using lrgpr

After generating a sample covariance matrix using the confeti() function you can use it to fit a linear mixed model. For example, to fit an lmm for a single phenotype and single genotype you can use the lrgpr() function from the lrgpr package.


single_pheno = expr_data[1,]

single_geno = snp_data[1,]

lmm_fit = lrgpr(single_pheno ~ single_geno, decomp = svd(confeti_results$Kmx))



jinhyunju/confeti documentation built on May 19, 2019, 10:35 a.m.