View source: R/plotting_functions.R
plot_genomewide_data | R Documentation |
This function will plot the results from genome-wide analyses of diversity, association, etc., that can be generated by a small variety of programs. As of 2019-01, it will handle any tibbles produced by the file_loading_functions. In reality, any tibble containing columns with the names "scaf" (scaffold), "ps" (position on scaffold), "stat" (statistic for plotting), and "chr" (chromosome the scaffold is assigned to, usually a dummy on first load) can be used as input.
plot_genomewide_data(
input,
type = "gwas",
scaffold_lengths,
plotting_column = "stat",
col1 = "grey",
col2 = "black"
)
input |
A tibble with four named columns (scaf, ps, stat, and chr) |
type |
Type of input: gwas, popgen. gwas will -log10 the stat, while popgen will estimate the ylimits. |
scaffold_lengths |
Name of a two-column tab delimited file containing scaffold and length. |
plotting_column |
Name of the column to plot. Usually will be 'stat' |
col1 |
Color of odd chromosomes |
col2 |
Color of even chromosomes |
A ggplot
a1 <- system.file("extdata", "test.gemma_gwas.txt.gz",
package = "gwplotting")
a2 <- system.file("extdata", "test.chromSizes.txt.gz",
package="gwplotting")
b <- load_gemma_gwas( a1, pval = 'p_wald' )
c <- plot_genomewide_data( b, type = 'gwas', scaffold_lengths = a2,
plotting_column = 'stat', col1 = 'black',
col2 = 'grey' )
c
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.