Package 'aplotExtra'

Title: Creating Composite Plots using 'aplot'
Description: Many complex plots are actually composite plots, such as 'oncoplot', 'funkyheatmap', 'upsetplot', etc. We can produce subplots using 'ggplot2' and combine them to create composite plots using 'aplot'. In this way, it is easy to customize these complex plots, by adding, deleting or modifying subplots in the final plot. This package provides a set of utilities to help users to create subplots and complex plots.
Authors: Guangchuang Yu [aut, cre] , Shuangbin Xu [ctb] , Chun-Hui Gao [ctb] , Shensuo Li [ctb]
Maintainer: Guangchuang Yu <[email protected]>
License: Artistic-2.0
Version: 0.0.2.001
Built: 2024-10-31 18:37:59 UTC
Source: https://github.com/yulab-smu/aplotextra

Help Index


funky_bar

Description

create bar plot for funkyheatmap

Usage

funky_bar(data, cols)

Arguments

data

data frame

cols

selected columns

Value

ggplot object

Author(s)

Guangchuang Yu


funky_heatmap

Description

create a funkyheatmap

Usage

funky_heatmap(..., data = NULL, widths = NULL, options = NULL)

Arguments

...

funky plots (e.g., outputs of funky_point, funky_bar, etc.)

data

If data is provided, create a funkyheatmap from it. Otherwise, create composite plot from ...

widths

relative widths of the plots

options

any ggplot component that can be added to the plots

Value

gglist object

Author(s)

Guangchuang Yu


funky_point

Description

create dot plot for funkyheatmap

Usage

funky_point(data, cols, cols2 = NULL, ...)

Arguments

data

data frame

cols

selected columns

cols2

selected columns to keep names

...

additional parameters, passing to geom_star

Value

ggplot object

Author(s)

Guangchuang Yu


funky_text

Description

create text plot (i.e., rownames) for funkyheatmap

Usage

funky_text(data, cols = 1, hjust = 0)

Arguments

data

data frame

cols

selected column

hjust

text alignment adjustment

Value

ggplot object

Author(s)

Guangchuang Yu


Get the items/names/ids of subsets from a named list

Description

Get the items/names/ids of subsets from a named list

Usage

get_all_subsets(list, name_separator = "/")

Arguments

list

a named list

name_separator

default is /

Value

a tibble

Examples

list = list(A = sample(LETTERS, 20),
            B = sample(LETTERS, 22),
            C = sample(LETTERS, 24),
            D = sample(LETTERS, 30, replace = TRUE))
get_all_subsets(list)

ploting oncoplot with aplot

Description

ploting oncoplot with aplot

Usage

oncoplot(maf, genes = 20)

Arguments

maf

MAF object.

genes

the gene names or the number, default is 20.

Value

oncoplot object, which is also a aplot object

Examples

laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
laml.clin <- system.file('extdata', 'tcga_laml_annot.tsv', package = 'maftools')
laml <- maftools::read.maf(maf = laml.maf, clinicalData = laml.clin)
oncoplot(maf = laml, genes = 20)

upsetplot2

Description

Plot a upset plot

Usage

upset_plot(
  list,
  nintersects = NULL,
  order.intersect.by = c("size", "name"),
  order.set.by = c("size", "name")
)

Arguments

list

a list of sets

nintersects

number of intersects. If NULL, all intersections will show.

order.intersect.by

one of 'size' or 'name'

order.set.by

one of 'size' or 'name'

Details

This function generate a upset plot by creating a composite plot which contains subplots generated by ggplot2.

Value

an upset plot

Examples

list = list(A = sample(LETTERS, 20),
             B = sample(LETTERS, 22),
             C = sample(LETTERS, 14),
             D = sample(LETTERS, 30, replace = TRUE))
 upset_plot(list)
 upset_plot(list, order.intersect.by = "name")
 upset_plot(list, nintersects = 6)