GithubHelp home page GithubHelp logo

wilcas / vaecit Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 39.4 MB

Variational autoencoders to use latent factors in causal inference

License: Apache License 2.0

Python 0.94% Jupyter Notebook 98.84% Shell 0.14% C++ 0.01% R 0.06%

vaecit's Introduction

Causal inference with latent factors

Variational autoencoders to use latent factors in causal inference.

Preliminary results presented at ISMB 2019

Presented poster

vaecit's People

Contributors

wilcas avatar

Watchers

 avatar

vaecit's Issues

Variational autoencoder in tensorflow

the goal is to run code to train an encoder quickly, solely to get a replicable latent representation of input genotypes. The result would ideally be:

  • Smaller/scaled down version of existing architecture
  • easily 'built up' or tweaked for a run on real data (i.e. for latent variables from large groups of genotypes believed to be causal to disease (at least QTLs, GWAS hits, or intersection of the two)
    • This would be allowed to be less efficient at the cost of "better" latent variables
    • Actual "results producing" step would be the CIT, run using LVs as a stand-in for genotype allowing for them to represent complex behavior multiple genotypes in relation to a trait with a much smaller number of variables

Re-do Simulation

Found a bug in simulating independent association, and in generating t statistics. As such I need to re-run the analyses I did on graham, and review those results.

Run CIT comparison to xQTL results

This may not be as straightforward as a one-to-one comparison, but I think it'll still be a useful exercise at first to compare effect p values of CIT results from the xQTL paper to what I get grouping by gene and considering each eQTL SNP at once (even though they may not all directly associate with each probe). I will need to:

  • Debug and get rosmap_cit_replication.py running on orenthal
  • Write up an analysis that makes as direct a comparison as possible to the results in the CIT.txt file on xQTLserve

Improve genotype I/O

First ideas:

  • Load all identifiers and rsids into memory up front and create a table, use table to get correct files for each snp
  • store genotypes as HDF5 and rework better functions that leverage the slicing capabilities of the data

Implement Linear Non-PCA LV Method

Based on Blessings of Multiple Causes paper, it may be appropriate to try som LFA type method fit to the criteria to account for confounds affecting multiple causes. I.e. take LVs from other LFA type methods, fit them to satsify some riteria about how they associate with what I'm summarizing with them, and then use those in causal inference.

Figure out why independent is being called as causal mediation

if you see the simulations I have thus far, it seems that independent association is getting called as full mediation when it definitely shouldn't be.

At first it seemed like the reason may have been that I was using more genotypes, but the issue could be:

  1. Having really large integer effect sizes, and
  2. Having fixed numbers anywhere as coefficients

Test PCA as a baseline for causal inference with multiple genotypes

Need a larger test and need to get a distribution of p values that work

  • Tests on a handful of randomly generated causal data sets seem to be inconclusive
  • 100-1000 probably needed, at 20 s per iteration on average, 4 cores, we get roughly a 10-20 minute test?
  • run simulation script
  • explore result in notebook
  • draw relevant conclusions (i.e. is it really a "fair" baseline? etc.)

Finish Test Cases

So far there are test cases written for code relating to sample matching and most data processing. I still need to put some code for:
-[x] existing discovered bugs and test clean up
-[ ] testing loading in data on orenthal
-[x] subsetting data
-[x] some more high-level data processing tasks (although these may be removed later).

Process Methylation Data to Individual Objects

In selection of other probes, there remains the issue of how to deal with data in expanding the number of mediation events detected. Ideally, I'd be using one nice LV method to reduce data down to 1 dimension, but it seems from simulation that this fails to capture the associations between that data and a target (i.e. more LVs are necessary).

I have a few suggestions as to how to continue/what to do to try to deal with this:

  • Pick representative probes/peaks of highly correlated blocks
  • Break down probes/peaks into multiple LVs and try a multi-target regression version of CIT instead of using linear models
  • Represent probes/peaks with single LV anyways

In each of the above cases I need to decide:

  1. How to group every feature by gene (fixed windows around TSS should be good enough)
  2. Whether or not it's valuable to pre-select sets of SNPs to group and re-do transcriptome/genome wide QT-LV study
  3. How I justify how the method accounts for complex non-linear interaction between omics data

EDIT

For now I'm going to group probes/peaks based on the gene they associate with within a window. Then I am going to take these top (bonferroni corrected threshold) QTMs/eQTAs and summarize them by LV.

To do this I will need to:

  • run an eQTM analysis
  • run an eQTA analysis
  • modify my existing code to run this new embedded CIT analysis, should be as simple as getting the input file right (modifying the CIT.txt-like file) and changing my get mediator functions

Address MMD-VAE Speed issue

MMD-VAE is taking a really long time on a simulation with 5x samples, but 1/4 genotypes. Some issue is probably there, may explore re-writing/writing in a different framework like PyTorch that's easier for me to understand.

eQTM/A Analysis code

I need to write, run, and test code for my eQTM and eQTA analysis required for testing my method genome-wide.

  • eQTM code/experiment running
  • eQTA code/experiment running
  • eQTM debugged
  • eQTA debugged

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.