vis_identifier_grp_comparison: Visualize Comparison of an Molecule Identifier between Groups

Description Usage Arguments Value Examples

View source: R/vis_identifier.R

Description

NOTE: the dataset must be dense matrix in UCSC Xena data hubs.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
vis_identifier_grp_comparison(
  dataset = NULL,
  id = NULL,
  grp_df,
  samples = NULL,
  fun_type = c("betweenstats", "withinstats"),
  type = c("parametric", "nonparametric", "robust", "bayes"),
  pairwise.comparisons = TRUE,
  p.adjust.method = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr",
    "none"),
  ggtheme = cowplot::theme_cowplot(),
  ...
)

Arguments

dataset

the dataset to obtain identifiers.

id

the molecule identifier.

grp_df

When dataset and id are all not NULL, it should be a data.frame with 2 or 3 columns.

  • The first column refers to sample ID.

  • The second column refers to groups indicated in axis X.

  • The third column is optional, which indicates facet variable. When any of dataset and id is NULL, it should be a data.frame with 3 or 4 columns.

  • The first column refers to sample ID.

  • The second column refers to values indicated in axis Y.

  • The third column refers to groups indicated in axis X.

  • The fourth column is optional, which indicates facet variable.

samples

default is NULL, can be common sample names for two datasets.

fun_type

select the function to compare groups.

type

A character specifying the type of statistical approach:

  • "parametric"

  • "nonparametric"

  • "robust"

  • "bayes"

You can specify just the initial letter.

pairwise.comparisons

Logical that decides whether pairwise comparisons are to be displayed (default: TRUE). Please note that only significant comparisons will be shown by default. To change this behavior, select appropriate option with pairwise.display argument. The pairwise comparison dataframes are prepared using the pairwise_comparisons function. For more details about pairwise comparisons, see the documentation for that function.

p.adjust.method

Adjustment method for p-values for multiple comparisons. Possible methods are: "holm" (default), "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none".

ggtheme

A {ggplot2} theme. Default value is ggstatsplot::theme_ggstatsplot(). Any of the {ggplot2} themes (e.g., theme_bw()), or themes from extension packages are allowed (e.g., ggthemes::theme_fivethirtyeight(), hrbrthemes::theme_ipsum_ps(), etc.).

...

other parameters passing to ggstatsplot::ggbetweenstats or ggstatsplot::ggwithinstats.

Value

a (gg)plot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
library(UCSCXenaTools)
expr_dataset <- "TCGA.LUAD.sampleMap/HiSeqV2_percentile"
cli_dataset <- "TCGA.LUAD.sampleMap/LUAD_clinicalMatrix"
id <- "TP53"
cli_df <- XenaGenerate(
  subset = XenaDatasets == "TCGA.LUAD.sampleMap/LUAD_clinicalMatrix"
) %>%
  XenaQuery() %>%
  XenaDownload() %>%
  XenaPrepare()

# group data.frame with 2 columns
vis_identifier_grp_comparison(expr_dataset, id, cli_df[, c("sampleID", "gender")])
# group data.frame with 3 columns
vis_identifier_grp_comparison(
  expr_dataset, id,
  cli_df[, c("sampleID", "pathologic_M", "gender")] %>%
    dplyr::filter(pathologic_M %in% c("M0", "MX"))
)

# When not use the value of `identifier` from `dataset`
vis_identifier_grp_comparison(grp_df = cli_df[, c(1, 2, 71)])
vis_identifier_grp_comparison(grp_df = cli_df[, c(1, 2, 71, 111)])

## End(Not run)

UCSCXenaShiny documentation built on Nov. 17, 2021, 9:06 a.m.