# Impute-First: Personalized Diploid Reference Generation

This repository contains scripts and workflows to reproduce the analyses and figures from the Impute-First paper. The project implements a novel approach for generating personalized diploid references through genotyping and imputation of downsampled reads.

## Repository Overview

This repository is organized into two main directories:

- **`imputefirst_workflows/`**: Snakemake workflows for the complete Impute-First pipeline
- **`plots_data_scripts/`**: Scripts and data for reproducing figures and analyses from the paper

## Repository Structure

### Workflows (`imputefirst_workflows/`)

#### 1. Upstream Personalization (`upstream_personalization/`)
Generates personalized diploid references from downsampled reads by performing genotyping and imputation using a reference panel.

#### 2. Downstream Analysis with Giraffe (`downstream_analysis_with_giraffe/`)
Performs downstream analysis using Impute-First personalized diploid references built into variation graphs, enabling alignment and lift-over with VG Giraffe.

#### 3. Downstream Analysis with LevioSAM2 (`downstream_analysis_with_leviosam2/`)
Performs downstream analysis using Impute-First personalized diploid FASTA references aligned with BWA-MEM and lifted with LevioSAM2.

### Analysis Scripts (`plots_data_scripts/`)

#### Upstream Plots (`upstream_plots/`)
- Performance metrics and accuracy plots
- Computational overhead
- Sample and panel accuracy analyses

#### Downstream Plots (`downstream_plots/`)
- ROC curves and performance comparisons
- Bias analysis (using biastools)
- Overall overhead analysis

## Detailed Documentation

- [Upstream Personalization Workflow](imputefirst_workflows/upstream_personalization/README.md)
- [Downstream Analysis with Giraffe](imputefirst_workflows/downstream_analysis_with_giraffe/README.md)
- [Downstream Analysis with LevioSAM2](imputefirst_workflows/downstream_analysis_with_leviosam2/README.md)

## Citation

Genome Research (doi:10.1101/gr.280989.125); details and additional resources are also available at [GitHub repository](https://github.com/kvaddad1/impute-first).

