plot_genomewide_data: Plot genome-wide statistics

Description Usage Arguments Value Examples

View source: R/plotting_functions.R

Description

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.

Usage

1
2
plot_genomewide_data(input, type = "gwas", scaffold_lengths,
  plotting_column = "stat", col1 = "grey", col2 = "black")

Arguments

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

Value

A ggplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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

nwvankuren/gwplotting documentation built on April 17, 2021, 2:37 p.m.