Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currently missing functions to implement for our simulation studies as of Dec 19, 2023 #2

Open
gaow opened this issue Dec 19, 2023 · 1 comment

Comments

@gaow
Copy link
Contributor

gaow commented Dec 19, 2023

Example of prompt based simulation code engineering

  • What if there are dependencies of effects between traits? What about residual covariances?
  • Enrichment based simulation: If a variant is an eQTL that increase the prop it is GWAS variant.

0, 0, 0, 0, 1, 0 for eQTL config of effects.
0.03, 0.03, 0.03, 0.03, 0.5, 0.03 are the prob from which conf of GWAS will be sampled. --->. generate GWAS config. (PT)

Multiple enrichments? --- susie^2 simulation

i want ot code this function called simulate_causual_config,

  • Suppose i have a matrix of annotations A. Each col is a vector of real numbers.
  • each row sstands for annotation of a variant. For each value of the annottaion column, its going to increase or decrease the odds of the variant taking values of either 1 or 0, per unit increase or decrease of annotatio nvalues. We will specificy the odds ratio for each column
  • Across all annotations it will be the product of the odds ratio for each variant.
  • In order to turn this odds ratio to probabily of the variant being 1 or 0, we also need a baseline odds specified. Given baseline odds and odds ratio, you should be able to compute by defintion the probabily of being 1. we call that the causal variant probaibly.

the output of the above should be a vector of causal probailiesi with length of the rows of the annotation matrix. Additionally i want to be able to specify how many samples i want to draw on this vector, so the output will be two things: a vector of the unerlying causal proabilities, as well as a matrix of binary samples generated from the causal probabillities of rows will be the number of replicates spcified, and columns being the variant sites.

Generate the funciton with roxygen document and examples. and testthat tests

@gaow
Copy link
Contributor Author

gaow commented Dec 19, 2023

Action items:

HS:

  • sim_effect_config() to get underlying 0/1 config for B for the colocboost simulation if your h2g is total then draw B values randomly conditional on the 1's ; otherwise set fixed B to those with config = 1

PT:

  • Develop additional simulation codes for susie^2 based on existing codes that others deveoloped that you are using to do the simulation studies, the simulate_enrichment.R code we generated today and whatever you see fit -- generate roxygen2 and unit tests, all into this R package.
  • Implement it in the SoS notebook to run large scale.
  • You can work with HS on this to ask for help if necessary

XC:

  • Clean up the LD matrix related codes taking into consideration what's existing in simulate_linreg.R
  • Work with Zoe to draft the other parts for transQTL project simulation

YB:

  • Take simulation codes generated in this package, try to connect them, and apply methods protptoypes to these codes, to get violin plots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant