GithubHelp home page GithubHelp logo

prsforshuvom's Introduction

fair_sampling

Running

  1. Run the original simulation to generate the true risk file for creating the MAF data and necessary directories: python run_simulation.py --sim 1 --snp_selection ceu --snp_weighting ceu

Create the MAF data

  1. Run this file to get all the MAF variants per population (instead of individually spaced variants): python maf-2.py

  2. Run this R script to import the saved files from step 1 and create the CSV needed for the modified true risk: Rscript maf-analysis.R

  3. Run this script for modified true risk in a separate terminal for each variant type with the following arguments:

    • arg for variant type 1: python modified_true_prs.py -variants top_1k_diff -name top_diff
    • arg for variant type 2: python modified_true_prs.py -variants bottom_1k_diff -name bottom_diff
    • arg for variant type 3: python modified_true_prs.py -variants top_1k_ratio -name top_ratio
    • arg for variant type 4: python modified_true_prs.py -variants bottom_1k_ratio -name bottom_ratio

Use the MAF data to run the modified simulation

  1. Run the following scripts in a separate terminal session to create the MAF data:
  • python make_learning_curve_data.py -variant top_ratio
  • python make_learning_curve_data.py -variant top_diff
  • python make_learning_curve_data.py -variant bottom_diff
  • python make_learning_curve_data.py -variant bottom_ratio

Create the learning curves

  1. Once completed, change the variant type in cells 139 and 144 in this file to the variant you want to create the learning curve data for: https://github.com/stanford-policylab/fair_sampling/blob/main/emp_true_prs_prob.ipynb
  2. Create the learning curves in this R notebook that imports the data from step 1 in this section: https://github.com/stanford-policylab/fair_sampling/blob/main/learning_curves.Rmd

prsforshuvom's People

Watchers

William Cai avatar

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.