locusviz

A comprehensive R package for creating publication-quality visualizations of GWAS (Genome-Wide Association Study) data at specific genomic loci. The package provides LocusZoom-style plots using ggplot2 with support for multiple data types including GWAS summary statistics, fine-mapping results, and gene annotations.

This package is still WIP.

Installation

# Install from GitHub
# remotes::install_github("mkanai/locusviz")
install.packages("locusviz", repos = c('https://mkanai.r-universe.dev', 'https://cloud.r-project.org'))

Features

Main Functions

Core Plotting Functions

Data Processing

Additional Features

Quick Start

library(locusviz)

# Preprocess your GWAS data
data <- preprocess(gwas_summary_stats)

# Create a basic LocusZoom plot
plot_locuszoom(
  data,
  highlight_pos = 123456789,  # Position to highlight
  window = 500000             # Window size around lead variant
)

# Customize panels
plot_locuszoom(
  data,
  plot.manhattan = TRUE,
  plot.fm = TRUE,
  plot.r2 = TRUE,
  plot.gene = TRUE,
  manhattan.title = "GWAS results for trait X",
  fm.legend_title = "95% Credible Set"
)

Data Requirements

Basic GWAS visualization

Fine-mapping visualization

LD visualization

Dependencies

The package relies on:

License

MIT License

Author

Masahiro Kanai mkanai@broadinstitute.org