%\VignetteEngine{knitr::knitr} %\VignetteIndexEntry{Intro into regionplot}

    library(topr)
    library(dplyr)

regionplot

Zoom-in on the region around the IL23R gene:

regionplot(CD_UKBB, 
           gene="IL23R")
knitr::include_graphics('figures/regionplot.jpg')

Label the top variant with it´s ID (rsid):

regionplot(CD_UKBB, 
           gene="IL23R", 
           annotate=5e-9)
knitr::include_graphics('figures/regionplot_annotate.jpg')

Increase variant label density by setting region_size to 100000.

Annotate with vlines to get a better visual of where the variants are in relation to the genes and exons shown below:

regionplot(CD_UKBB, 
           gene = "IL23R", 
           annotate_with_vline = 5e-9, 
           region_size = 100000)
knitr::include_graphics('figures/regionplot_annotate_vline.jpg')

Zoom in on the IL23R gene for multiple GWAS results

regionplot(list(UC_UKBB,CD_UKBB,CD_FINNGEN), 
           gene = "IL23R", 
           annotate_with_vline = 5e-6,
           legend_labels = c("UC UKBB","CD UKBB","CD FINNGEN"))
knitr::include_graphics('figures/regionplot_multi.jpg')

Locuszoom-like plots

Note!! To be able to use the locuszoom function the input dataframe needs to include the R2 column with the pre-calculated correlation (R2) values, since topr does not do these calculations.

locuszoom(R2_CD_UKBB)
knitr::include_graphics('figures/locuszoom.jpg')

Annotate the variants with vertical lines highlighting their positions on the plot:

locuszoom(R2_CD_UKBB, 
          annotate_with_vline = 1e-9,
          region_size = 100000)
knitr::include_graphics('figures/locuszoom_annotate.jpg')


GenuityScience/topr documentation built on Oct. 20, 2024, 10:23 p.m.