Skip to contents

R-CMD-check Codecov Docker Repository on Quay

Overview

StoatPlot provides a set of lightweight and user-friendly tools for visualizing GWAS results generated by the STOAT tool. It includes functions for generating:

  • Manhattan plots
  • Q-Q plots
  • P-value histograms
  • Genotype-based boxplots
  • Paths length distribution
  • Snarl type histogram

These tools facilitate the visual inspection of association signals and support downstream interpretation of GWAS outputs.

Installation

# Install from GitHub
# install.packages("BiocManager")
BiocManager::install("Pa-Tou/stoat_plot")

If you are having problem, another option is to follow the install.R script (used to install the package in the Docker container). This script is supposed to be run from the root of this folder, so you would have clone the repo first.

Functions

Visualization Function

Function Description
summary_stoat() Print summary information on GWAS results
manhattan_plot() Manhattan plot for GWAS results
qq_plot() Q-Q plot for p-values
plot_pvalue_hist() Histogram of p-values from GWAS
genotype_boxplots() Boxplots of phenotype values by genotype
path_length_distribution() Dot Plot of Path Length Frequencies
snarl_type_histogram() Dot Plot of snarl type histogram

Usage

See the vignettes for examples on how to use it:

  • Soon

A minimal example, to plot the QQ-plot and Manhattan plot, would look like this:

assoc = import_assoc('stoat_output/stoat.assoc.pvalues.tsv.gz')
qq_plot(assoc)
manhattan_plot(assoc)

Sorting and indexing snarl genotypes

To speed up the visualization of associations, genotype_boxplots() extracts the relevant genotypes from an indexed and bgzipped TSV file. To index a snarl_genotypes.tsv.gz (output of stoat vcf or stoat graph) with bgzip and tabix:

(zcat snarl_genotypes.tsv.gz | head -10000 | grep "^#"; zgrep -v "^#" snarl_genotypes.tsv.gz | sort -k3,3n -k4,4n -k5,5n) | bgzip > snarl_genotypes.sorted.tsv.gz
tabix -f -c "#" -s 3 -b 4 -e 5 snarl_genotypes.sorted.tsv.gz

You can then use the snarl_genotypes.sorted.tsv.gz file as input to the genotype_boxplots function (genotype_file parameter).

Contributing

Feel free to open issues or submit pull requests. Contributions are welcome!


License

This package is licensed under the GNU General Public License v3.0 (GPL-3).