View source: R/binned_manhattan.R
binned_manhattan_plot | R Documentation |
Contrary to the traditional manhattan plot, which plots all the points, the binned manhattan plot vertically and horizontally bins the variants into blocks. This speeds up plotting and reduces clutter in the case of high number of variants. The colors of the blocks can also be used to summarise the variants within each block and highlight certain features.
binned_manhattan_plot(x, ...)
## Default S3 method:
binned_manhattan_plot(x, ...)
## S3 method for class 'MPdataBinned'
binned_manhattan_plot(
x,
outfn = NULL,
signif.lwd = 1,
bin.outline = FALSE,
bin.outline.alpha = 0.2,
highlight.colname = NULL,
highlight.counts = TRUE,
bin.palette = "viridis::plasma",
bin.alpha = 0.9,
palette.direction = 1,
nonsignif.default = NULL,
show.legend = TRUE,
legend.title = NULL,
background.col = c("grey90", "white"),
background.alpha = 0.7,
plot.title = ggplot2::waiver(),
plot.subtitle = ggplot2::waiver(),
plot.width = 10,
plot.height = 5,
plot.scale = 1,
...
)
## S3 method for class 'data.frame'
binned_manhattan_plot(
x,
bins.x = 10,
bins.y = 100,
chr.gap.scaling = 0.4,
signif = c(5e-08, 1e-05),
pval.colname = "pval",
chr.colname = "chr",
pos.colname = "pos",
chr.order = NULL,
signif.col = NULL,
preserve.position = TRUE,
pval.log.transform = TRUE,
summarise.expression.list = NULL,
outfn = NULL,
signif.lwd = 1,
bin.outline = FALSE,
bin.outline.alpha = 0.2,
highlight.colname = NULL,
highlight.counts = TRUE,
bin.palette = "viridis::plasma",
bin.alpha = 0.9,
palette.direction = 1,
nonsignif.default = NULL,
show.legend = TRUE,
legend.title = NULL,
background.col = c("grey90", "white"),
background.alpha = 0.7,
plot.title = ggplot2::waiver(),
plot.subtitle = ggplot2::waiver(),
plot.width = 10,
plot.height = 5,
plot.scale = 1,
...
)
## S4 method for signature 'GRanges'
binned_manhattan_plot(
x,
bins.x = 10,
bins.y = 100,
chr.gap.scaling = 0.4,
signif = c(5e-08, 1e-05),
pval.colname = "pval",
chr.order = NULL,
signif.col = NULL,
preserve.position = TRUE,
pval.log.transform = TRUE,
summarise.expression.list = NULL,
outfn = NULL,
signif.lwd = 1,
bin.outline = FALSE,
bin.outline.alpha = 0.2,
highlight.colname = NULL,
highlight.counts = TRUE,
bin.palette = "viridis::plasma",
bin.alpha = 0.9,
palette.direction = 1,
nonsignif.default = NULL,
show.legend = TRUE,
legend.title = NULL,
background.col = c("grey90", "white"),
background.alpha = 0.7,
plot.title = ggplot2::waiver(),
plot.subtitle = ggplot2::waiver(),
plot.width = 10,
plot.height = 5,
plot.scale = 1,
...
)
x |
a |
... |
Ignored |
outfn |
a character. File name to save the Manhattan Plot. If |
signif.lwd |
a number. Line width of the significance threshold line. |
bin.outline |
a logical. Outline each bin. The bins are colored black. |
bin.outline.alpha |
a number. Alpha value of the bin outline. |
highlight.colname |
a character. If you desire to color certain points
(e.g. significant variants) rather than color by chromosome, you can specify the
category in this column, and provide the color mapping in |
highlight.counts |
a logical. If logical, the bins are colored based on the number of points in each block. |
bin.palette |
a character. Palette to color the bins. Only palettes supported by the package |
bin.alpha |
a number. Alpha value of the bins. |
palette.direction |
a number. Direction of the palette. 1 for increasing and -1 for decreasing. |
nonsignif.default |
a character. Default color for bins that are not significant. |
show.legend |
a logical. Show legend if bins are colored based on a variable. |
legend.title |
a character. Title of the legend. |
background.col |
a character. Color of the background panels. Set to |
background.alpha |
a number. Alpha value of the background panels. |
plot.title |
a character. Plot title |
plot.subtitle |
a character. Plot subtitle |
plot.width |
a numeric. Plot width in inches. Corresponds to |
plot.height |
a numeric. Plot height in inches. Corresponds to |
plot.scale |
a numeric. Plot scale. Corresponds to |
bins.x |
an integer. number of blocks to horizontally span the longest chromosome |
bins.y |
an integer. number of blocks to vertically span the plot |
chr.gap.scaling |
a numeric. scaling factor for gap between chromosome if you desire to change it
if x is an |
signif |
a numeric vector. Significant p-value thresholds to be drawn for manhattan plot.
At least one value should be provided. Default value is c(5e-08, 1e-5).
If |
pval.colname |
a character. Column name of |
chr.colname |
a character. Column name of |
pos.colname |
a character. Column name of |
chr.order |
a character vector. Order of chromosomes presented in manhattan plot. |
signif.col |
a character vector of equal length as |
preserve.position |
a logical. If |
pval.log.transform |
a logical. If |
summarise.expression.list |
a list of formulas to summarise data for each bin. Check details for more information. |
Similar to manhattan_plot
, this function accepts summary statistics from GWAS and plots manhattan plot.
The difference is that the variants are binned.
The number of blocks can be controlled by bins.x
and bins.y
.
The blocks can be colored based on a column in the data frame.
Palette for coloring the bins can be chosen from the package paletteer
.
Only palettes available in paletteer
are supported. Furthermore, what palette you can use depends on what kind of
variable you are using to fill the bins. Use discrete palette for categorical variable and continuous palette for continuous variable.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.