Coder Social home page Coder Social logo

alexiajm / legit Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 2.0 2.31 MB

An R package for the Latent Environmental & Genetic InTeraction (LEGIT) model

License: GNU General Public License v3.0

R 100.00%
r interactions glm genetics environment gxe latent-variable-models latent-variables genetic-variants gxe-modelling

legit's People

Contributors

alexiajm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

legit's Issues

Rescaling the weights for better interpretation

When there are negative weights in a score, the maximum score is not 1 which complicates interpretation. What we could do is after convergence divide the weights of a score by (maximum possible value - minimal possible values) from the data or a user-given number. This should be an option called "rescale".

Ex: if weight_gene1=.40, weight_gene2=.40, weight_gene1gene2=-.20, then the lowest genetic score is 0 if gene1=0, gene2=0 and the highest score is .40. The rescaled gene weights would thus be weight_gene1_rescaled=1, weight_gene2_rescaled=1, weight_gene1gene2_rescaled=-.50.

Longitudinal cross-validation and custom folds

Although few people work with longitudinal outcome, we often do at the MAVAN. So I should add a small function to get cross-validated folds and then add an argument in LEGIT_cv to be able to put custom folds.

problem of using the GxE_interaction_test

Hi, thank you for developing such a useful pacakge. I was trying to follow the example(https://cran.r-project.org/web/packages/LEGIT/vignettes/GxE_testing.html). The example ran well
ex_dia = example_with_crossover(N=250, c=0, coef_main = c(3,1,2), sigma=1, seed=7)

GxE_test_BIC = GxE_interaction_test(data=ex_dia$data, genes=ex_dia$G, env=ex_dia$E, formula_noGxE = y ~ 1, crossover = c("min","max"), criterion="BIC")

however, I couldn't use my own data for a GxE testibng. I tried to make my own list including any variabels requied, but it didn't work.

mylist1 <- list("data"=data,"G"=G,"E"=E,coef_G=1,coef_E=1,coef_main = c(3,1,2),c=0) GxE_test_BIC = GxE_interaction_test(data=mylist1$data, genes = mylist1$G, env = mylist1$E, formula_noGxE = y ~ G*E+Age+Edu+Race, crossover = c("min", "max"),criterion = "BIC") GxE_test_BIC$results

for it comes up with the error:

Error in str2lang(x) : :2:0: unexpected end of input 1: y ~ G * E + Age + Edu + Race + ^

Would you tell me any solution about this? Example with real data might be helpful (instead of those generated by example_with_crossover and example_2way)

Multiple scores

This is not a priority yet but eventually it might be a good idea to implement a way to create as many scores as desired rather than just two scores (G and E). So we would have S1, ..., Sk scores that can interact in any way. This would make time-varying G and E possible, 3 way with 3 scores possible and lots of other interesting ideas possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.