{"id":31105753,"url":"https://github.com/weinstockj/prs","last_synced_at":"2025-09-17T04:06:23.532Z","repository":{"id":304015366,"uuid":"651620395","full_name":"weinstockj/PRS","owner":"weinstockj","description":"Polygenic Risk Scores with Functional Neutral Network (PRSFNN)","archived":false,"fork":false,"pushed_at":"2025-07-10T16:33:41.000Z","size":42628,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-10T22:57:10.031Z","etag":null,"topics":["genetics","genomics","julia-language","machine-learning","statistical-genetics"],"latest_commit_sha":null,"homepage":"https://weinstockj.github.io/PRS/dev/","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weinstockj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-09T16:46:31.000Z","updated_at":"2025-07-10T16:33:48.000Z","dependencies_parsed_at":"2025-07-10T23:07:24.782Z","dependency_job_id":null,"html_url":"https://github.com/weinstockj/PRS","commit_stats":null,"previous_names":["weinstockj/prs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/weinstockj/PRS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weinstockj%2FPRS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weinstockj%2FPRS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weinstockj%2FPRS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weinstockj%2FPRS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weinstockj","download_url":"https://codeload.github.com/weinstockj/PRS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weinstockj%2FPRS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275531517,"owners_count":25481341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["genetics","genomics","julia-language","machine-learning","statistical-genetics"],"created_at":"2025-09-17T04:03:12.644Z","updated_at":"2025-09-17T04:06:23.521Z","avatar_url":"https://github.com/weinstockj.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PRSFNN.jl\n\n[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://weinstockj.github.io/PRS/dev)\n[![CI](https://github.com/weinstockj/PRS/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/weinstockj/PRS/actions/workflows/ci.yml)\n\n![logo](PRSFNN_logo_small.svg)\n\nPRSFNN (Polygenic Risk Score with Functional Neural Networks) is a Julia module for calculating polygenic risk scores by integrating GWAS summary statistics with functional annotations using neural networks.\n\n## Features\n\n- Integration of GWAS summary statistics with functional annotations\n- Linkage disequilibrium (LD) calculation and correction\n- Coordinate Ascent Variational Inference (CAVI) for posterior effect size estimation\n- Neural network models to learn the relationship between functional annotations and genetic effect sizes\n\n## PRSFNN runner\n\nNote: this Julia module is used for running PRSFNN in individual LD blocks and training the neural network. To run PRSFNN genome-wide is an HPC environment, see our workflow [here](https://github.com/weinstockj/PRSFNN-runner). \n\n## Installation\n\n```julia\n# From the Julia REPL\nusing Pkg\nPkg.add(url=\"https://github.com/weinstockj/PRS.jl\")\n```\n\n## Getting Started\n\nSteps to load this module from the root directory:\n\n1. Run `julia --color=yes --project=.` (requires Julia 1.9.0 or later)\n2. Run `using Revise` # helpful while developing\n3. Run `using PRSFNN`\n\nNow the functions have been loaded. \nTo call an internal function, use `PRSFNN.function_name` \n\nTo run Julia in debugger mode: `JULIA_DEBUG=PRSFNN julia --color=yes --project=.`\n\n## Usage\n\n### Basic Example\n\n```julia\nusing PRSFNN\n\n# Run PRSFNN on a genomic region\nresult = main(\n    output_prefix = \"chr3_block1\",\n    annot_data_path = \"path/to/annotations.parquet\", \n    gwas_data_path = \"path/to/gwas_stats.tsv\",\n    ld_panel_path = \"path/to/ld_panel\"\n)\n```\n\n### Simulating GWAS Data\n\nFor testing and development, you can simulate GWAS summary statistic data:\n\n```julia\n# Generate simulated data\nraw = simulate_raw(;N = 10_000, P = 1_000, K = 100, h2 = 0.10)\n# Extract sufficient statistics needed for PRS\nsummary_stats = estimate_sufficient_statistics(raw.X, raw.Y)\n```\n\n### Training a PRS Model\n\n```julia\n# Train the PRS model\nN = size(raw.X, 1)  # Number of samples\nP = size(raw.X, 2)  # Number of SNPs\nXtX = construct_XtX(summary_stats.R, ones(P), N)\nD = construct_D(XtX)\nXty = construct_Xty(summary_stats.coef, D)\n\nσ2, R2, yty = infer_σ2(\n    summary_stats.coef, \n    summary_stats.SE, \n    XtX, \n    Xty, \n    N, \n    P; \n    estimate = true, \n    λ = 0.50 * N\n)\n\nK = size(raw.G, 2)\nH = 5  # Number of hidden units\n\nlayer_1 = Dense(K =\u003e H, Flux.softplus; init = Flux.glorot_normal(gain = 0.005))\nlayer_output = Dense(H =\u003e 2)\nlayer_output.bias .= [StatsFuns.log(0.001), StatsFuns.logit(0.1)]\nmodel = Chain(layer_1, layer_output)\ninitial_lr = 0.00005\noptim_type = AdamW(initial_lr)\nopt = Flux.setup(optim_type, model)\n\nPRS = train_until_convergence(\n    summary_stats.coef,\n    summary_stats.SE,\n    summary_stats.R, \n    XtX,\n    Xty,\n    raw.G,\n    model = model,\n    opt = opt,\n    σ2 = σ2,\n    R2 = R2,\n    yty = yty,\n    N = fill(N, P),  # Vector of sample sizes\n    train_nn = false,\n    max_iter = 5\n)\n```\n\n## Documentation\n\nFor more detailed documentation, visit the [official documentation site](https://weinstockj.github.io/PRS/dev).\n\n## Running the Tests\n\nRun unit tests with:\n\n```julia\njulia --project=. test/runtests.jl\n```\n\nor interactively with:\n\n```julia\nincludet(\"test/runtests.jl\")\n```\n\n## Contact\n\nPlease address correspondence to:\n- Josh Weinstock \u003cjosh.weinstock@emory.edu\u003e\n- April Kim \u003caprilkim@jhu.edu\u003e\n- Alexis Battle \u003cajbattle@jhu.edu\u003e\n\n## Functions\n\n```@docs\nPRSFNN.main\nPRSFNN.rss \nPRSFNN.elbo\nPRSFNN.joint_log_prob\nPRSFNN.train_until_convergence\nPRSFNN.fit_heritability_nn\nPRSFNN.log_prior\nPRSFNN.estimate_sufficient_statistics\nPRSFNN.compute_LD\nPRSFNN.fit_genome_wide_nn\nPRSFNN.train_cavi\nPRSFNN.simulate_raw\nPRSFNN.infer_σ2\nPRSFNN.poet_cov\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweinstockj%2Fprs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweinstockj%2Fprs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweinstockj%2Fprs/lists"}