Skip to contents

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

Usage

vis_identifier_dim_dist(
  dataset = NULL,
  ids = NULL,
  grp_df,
  samples = NULL,
  return.data = FALSE,
  DR_method = c("PCA", "UMAP", "tSNE"),
  add_margin = NULL,
  palette = "Set1"
)

Arguments

dataset

the dataset to obtain identifiers.

ids

the molecule identifiers.

grp_df

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

  • The first column refers to sample ID.

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

samples

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

return.data

whether to reture the raw meta/matrix data (list) instead of plot

DR_method

the dimension reduction method

add_margin

the marginal plot (NULL, "density", "boxplot")

palette

the color setting of RColorBrewer

Value

a ggplot object.

Examples

# \donttest{
library(UCSCXenaTools)
#> =========================================================================================
#> UCSCXenaTools version 1.4.8
#> Project URL: https://github.com/ropensci/UCSCXenaTools
#> Usages: https://cran.r-project.org/web/packages/UCSCXenaTools/vignettes/USCSXenaTools.html
#> 
#> If you use it in published research, please cite:
#> Wang et al., (2019). The UCSCXenaTools R package: a toolkit for accessing genomics data
#>   from UCSC Xena platform, from cancer multi-omics to single-cell RNA-seq.
#>   Journal of Open Source Software, 4(40), 1627, https://doi.org/10.21105/joss.01627
#> =========================================================================================
#>                               --Enjoy it--
expr_dataset <- "TCGA.LUAD.sampleMap/HiSeqV2_percentile"
ids = c("TP53", "KRAS", "PTEN", "MDM2", "CDKN1A")

cli_dataset <- "TCGA.LUAD.sampleMap/LUAD_clinicalMatrix"
cli_df <- XenaGenerate(
  subset = XenaDatasets == cli_dataset
) %>%
  XenaQuery() %>%
  XenaDownload() %>%
  XenaPrepare()
#> This will check url status, please be patient.
#> All downloaded files will under directory /tmp/RtmpGbjfQa.
#> The 'trans_slash' option is FALSE, keep same directory structure as Xena.
#> Creating directories for datasets...
#> Downloading TCGA.LUAD.sampleMap/LUAD_clinicalMatrix
grp_df = cli_df[, c("sampleID", "gender")]
vis_identifier_dim_dist(expr_dataset, ids, grp_df, DR_method="PCA")
#> Querying data of identifier TP53 from dataset TCGA.LUAD.sampleMap/HiSeqV2_percentile for DR
#> Try querying data #1
#> -> Checking if the dataset has probeMap...
#> -> Done. ProbeMap is found.
#> Saving data to file /tmp/RtmpGbjfQa/UCSCXenaShiny/7bac6e7df6c078cb307b55eb3cc0c512.rds
#> Querying data of identifier KRAS from dataset TCGA.LUAD.sampleMap/HiSeqV2_percentile for DR
#> Try querying data #1
#> -> Checking if the dataset has probeMap...
#> -> Done. ProbeMap is found.
#> Saving data to file /tmp/RtmpGbjfQa/UCSCXenaShiny/7493d9720bf5ffdc743df4da9dc46cf4.rds
#> Querying data of identifier PTEN from dataset TCGA.LUAD.sampleMap/HiSeqV2_percentile for DR
#> Try querying data #1
#> -> Checking if the dataset has probeMap...
#> -> Done. ProbeMap is found.
#> Saving data to file /tmp/RtmpGbjfQa/UCSCXenaShiny/61bd4abf1c20b6812eda21c33f2c8df1.rds
#> Querying data of identifier MDM2 from dataset TCGA.LUAD.sampleMap/HiSeqV2_percentile for DR
#> Try querying data #1
#> -> Checking if the dataset has probeMap...
#> -> Done. ProbeMap is found.
#> Saving data to file /tmp/RtmpGbjfQa/UCSCXenaShiny/b1b235f5007458d1a9eabe92b19a0798.rds
#> Querying data of identifier CDKN1A from dataset TCGA.LUAD.sampleMap/HiSeqV2_percentile for DR
#> Try querying data #1
#> -> Checking if the dataset has probeMap...
#> -> Done. ProbeMap is found.
#> Saving data to file /tmp/RtmpGbjfQa/UCSCXenaShiny/fa7de4460d6e82e06e87c58bd81833ac.rds

# }