plot_trumpets {TrumpetPlots} | R Documentation |
Trumpets
Description
This function generates trumpet plots
Usage
plot_trumpets(
dataset = toy_data,
rsID = "rsID",
freq = "freq",
A1_beta = "A1_beta",
Analysis = "Analysis",
Gene = "Gene",
calculate_power = TRUE,
show_power_curves = TRUE,
exist_datapwr = NULL,
threshold = c(0.7, 0.9),
N = 1e+05,
alpha = 5e-08,
Nfreq = 500,
power_color_palette = c("purple", "deeppink"),
analysis_color_palette = c("#018571", "#a6611a")
)
Arguments
dataset |
Input text file with genetic association results. Columns required are rsID, freq, A1_beta, Analysis and Gene. |
rsID |
(required) Single Nucleotide Polymorphism (SNP) name. |
freq |
(required) allele frequency of effect SNP. |
A1_beta |
(required) risk allele effect size. |
Analysis |
(optional) adds colour to the type of analysis (e.g. GWAS, Sequencing). |
Gene |
(optional) Candidate gene name (can be empty). |
calculate_power |
(TRUE/FALSE) Calculate power curves. Choose TRUE to add power curves for a given threshold, alpha, sample size N and number of allele frequencies. Choose FALSE if you already ran powerCurves() outside or do not want to show power curves. |
show_power_curves |
(TRUE/FALSE) Show power curves in plot |
exist_datapwr |
Existing dataframe containing columns: freq, pos.b.for.f, neg.b.for.f, powerline. |
threshold |
Required if power == TRUE. Can be a single number or a vector of statistical power thresholds. |
N |
(Required if calculate_power == TRUE). Sample size used to test the association. |
alpha |
(Required if calculate_power == TRUE). |
Nfreq |
(Required if calculate_power == TRUE). Number of allele frequency data points generated to calculate the power curves. We recommend Nfreq>1000 for power curves with high resolution. Note that this will slow down the rendering of the plot. |
power_color_palette |
A vector of colours for the power curves. Number of colors should match number of thresholds supplied. |
analysis_color_palette |
A vector of colours for the analysis types. |
Value
Creates a Trumpet plot with variant allele frequency (X axis, log10 scale) and effect size information (Y axis).
Examples
plot_trumpets(dataset = toy_data)