Title: | A Toolkit for Omics Data Visualization |
Version: | 1.1.3 |
Description: | Provides a suite of tools for the comprehensive visualization of multi-omics data, including genomics, transcriptomics, and proteomics. Offers user-friendly functions to generate publication-quality plots, thereby facilitating the exploration and interpretation of complex biological datasets. Supports seamless integration with popular R visualization frameworks and is well-suited for both exploratory data analysis and the presentation of final results. Key formats and methods are presented in Huang, S., et al. (2024) "The Born in Guangzhou Cohort Study enables generational genetic discoveries" <doi:10.1038/s41586-023-06988-4>. |
License: | MIT + file LICENSE |
URL: | https://github.com/Leslie-Lu/omixVizR |
BugReports: | https://github.com/Leslie-Lu/omixVizR/issues |
Encoding: | UTF-8 |
Language: | en-US |
RoxygenNote: | 7.3.2 |
Suggests: | testthat (≥ 3.0.0), spelling |
Config/testthat/edition: | 3 |
Imports: | data.table, dplyr, genpwr, ggbreak, ggplot2, ggrepel, ggsci, ggtext, grid, magrittr, purrr, scales, showtext, sysfonts |
NeedsCompilation: | no |
Packaged: | 2025-07-20 14:15:45 UTC; luzh2 |
Author: | Zhen Lu |
Maintainer: | Zhen Lu <luzh29@mail2.sysu.edu.cn> |
Repository: | CRAN |
Date/Publication: | 2025-07-20 17:50:05 UTC |
omixVizR: A Toolkit for Omics Data Visualization
Description
Provides a suite of tools for the comprehensive visualization of multi-omics data, including genomics, transcriptomics, and proteomics. Offers user-friendly functions to generate publication-quality plots, thereby facilitating the exploration and interpretation of complex biological datasets. Supports seamless integration with popular R visualization frameworks and is well-suited for both exploratory data analysis and the presentation of final results. Key formats and methods are presented in Huang, S., et al. (2024) "The Born in Guangzhou Cohort Study enables generational genetic discoveries" doi:10.1038/s41586-023-06988-4.
Author(s)
Maintainer: Zhen Lu luzh29@mail2.sysu.edu.cn (ORCID)
See Also
Useful links:
Plot GWAS Statistical Power
Description
Generates a statistical power analysis plot for GWAS studies. Supports binary (case-control) traits over a range of odds ratios and minor allele frequencies, and quantitative traits over a range of effect sizes and minor allele frequencies. This function uses the 'genpwr' package for calculations and creates a highly customized ggplot.
Usage
plot_gwas_power(
trait_type = "bt",
n_cases = NULL,
n_controls = NULL,
sd_trait = NULL,
N = NULL,
maf_levels = c(0.01, 0.02, 0.05, 0.1, 0.2, 0.5),
or_range = seq(1.01, 2, 0.001),
effect_size = seq(0.01, 0.3, 0.001),
alpha = 5e-08,
plot_title = NULL,
save_plot = TRUE,
output_graphics = "png",
width = 17,
height = 9,
dpi = 600
)
Arguments
trait_type |
Character string specifying trait type: "bt" for binary (case-control) or "qt" for quantitative traits. Default: |
n_cases |
Number of cases in the study (required if |
n_controls |
Number of controls in the study (required if |
sd_trait |
Numeric, standard deviation of the quantitative trait (required if |
N |
Numeric, total sample size for quantitative traits (required if |
maf_levels |
A numeric vector of Minor Allele Frequencies (MAFs) to test.
Default: |
or_range |
A numeric vector specifying the sequence of Odds Ratios (ORs) to test.
Default: |
effect_size |
A numeric vector specifying the sequence of effect sizes (beta) to test for quantitative traits.
Default: |
alpha |
The significance level (alpha) for the power calculation.
Default: |
plot_title |
A string for the plot title. Can include newlines ( |
save_plot |
Logical, whether to save the plot to a file. If |
output_graphics |
The file format for saving the plot. Currently supports "png" and "pdf". Default: "png". |
width |
The width of the saved plot in inches. Default: 17. |
height |
The height of the saved plot in inches. Default: 9. |
dpi |
The resolution of the saved plot in dots per inch. Default: 600. |
Details
This function automates the process of calculating and visualizing GWAS power for both binary (case-control) and quantitative traits. For binary traits, it analyzes power across odds ratios, while for quantitative traits, it analyzes power across effect sizes. It highlights the minimum OR/effect size required to achieve 80% power for the lowest and third-lowest MAF levels, adding dashed lines and color-coded labels for clarity.
Value
A list containing two elements:
plot |
The ggplot object for the power plot. |
power_data |
A data.table containing the full results from the power analysis. |
Font Information
The MetroSans font included in this package is sourced from https://fontshub.pro/font/metro-sans-download#google_vignette. It is intended for academic research and non-commercial use only. For commercial use, please contact the font copyright holder.
The font files are included in the package's inst/extdata directory and are automatically loaded for plotting.
Author(s)
Zhen Lu luzh29@mail2.sysu.edu.cn
Examples
# Binary trait example (case-control)
power_results_bt <- plot_gwas_power(
trait_type = "bt",
n_cases = 4324,
n_controls = 93945,
save_plot = FALSE
)
# Quantitative trait example
power_results_qt <- plot_gwas_power(
trait_type = "qt",
sd_trait = 0.09365788681305078,
N = 10000,
maf_levels = c(0.01, 0.02, 0.05, 0.10, 0.20, 0.50),
effect_size = seq(0.01, 0.10, 0.001),
save_plot = FALSE
)
# Access the ggplot object and data
# print(power_results_bt$plot)
# print(power_results_bt$power_data)
Plot GWAS QQ and Manhattan Plots
Description
Create GWAS QQ & Manhattan Plots.
Usage
plot_qqman(
plink_assoc_file,
pheno_name,
maf_filter = NULL,
output_graphics = "png",
save_plot = TRUE,
lambda1_qq_pos = c(2.1, -5.5),
lambda2_qq_pos = c(1.565, -4)
)
Arguments
plink_assoc_file |
Path to the PLINK association file. |
pheno_name |
Phenotype name. |
maf_filter |
Minor allele frequency filter, Default: NULL |
output_graphics |
Output graphics format, Default: 'png' |
save_plot |
Logical, whether to save plots to files. If FALSE, plots are only displayed. Default: TRUE |
lambda1_qq_pos |
A numeric vector of length 2 specifying the |
lambda2_qq_pos |
A numeric vector of length 2 specifying the |
Details
This function reads a PLINK association file and generates Manhattan and QQ plots for the GWAS results.
Value
A list containing the ggplot objects for the Manhattan and QQ plots.
Font Information
The MetroSans font included in this package is sourced from https://fontshub.pro/font/metro-sans-download#google_vignette. It is intended for academic research and non-commercial use only. For commercial use, please contact the font copyright holder.
The font files are included in the package's inst/extdata directory and are automatically loaded for plotting.
Author(s)
Zhen Lu luzh29@mail2.sysu.edu.cn
Yanhong Liu liuyh275@mail2.sysu.edu.cn
Siyang Liu liusy99@mail.sysu.edu.cn
See Also
Examples
sample_file <- system.file("extdata", "sample_gwas.assoc.linear", package = "omixVizR")
# Check if the file exists before running the example
if (file.exists(sample_file)) {
# Run the function with the sample data
plots <- plot_qqman(
plink_assoc_file = sample_file,
pheno_name = "SamplePheno",
save_plot = FALSE
)
# You can then access the plots like this:
# print(plots$manhattan_plot)
# print(plots$qq_plot)
} else {
message("Sample file not found, skipping example.")
}