### Load Downloaded Datasets with XenaPrepare
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaPrepare.html
Example of using XenaPrepare to load downloaded datasets. This snippet demonstrates a typical workflow starting from generating Xena objects to preparing the downloaded data.
```R
if (FALSE) { # \dontrun{
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub")
hosts(xe)
xe_query = XenaQuery(xe)
xe_download = XenaDownload(xe_query)
dat = XenaPrepare(xe_download)
} # }
```
--------------------------------
### Example: Get TCGA data without downloading
Source: https://docs.ropensci.org/UCSCXenaTools/reference/getTCGAdata.html
This example demonstrates how to use `getTCGAdata` to retrieve information about TCGA datasets without actually downloading them. This is useful for previewing available data.
```R
###### get data, but not download
```
--------------------------------
### Example Usage of XenaDownload
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaDownload.html
Demonstrates how to use XenaDownload to obtain genomic data. This example first generates a query object for a specific Xena host, then queries for available data, and finally downloads the selected dataset.
```R
if (FALSE) { # \dontrun{
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub")
hosts(xe)
xe_query = XenaQuery(xe)
xe_download = XenaDownload(xe_query)
} # }
```
--------------------------------
### Install UCSCXenaTools with Vignettes from GitHub
Source: https://docs.ropensci.org/UCSCXenaTools/index.html
Installs the development version of UCSCXenaTools from GitHub, including building the vignettes. This option is useful for local development or if you want to generate documentation locally.
```R
remotes::install_github("ropensci/UCSCXenaTools", build_vignettes = TRUE, dependencies = TRUE)
```
--------------------------------
### Query All Hosts, Cohorts, and Datasets
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaHub.html
This example demonstrates how to query all available hosts, cohorts, and datasets by creating a default XenaHub object.
```R
xe = XenaHub()
xe
```
--------------------------------
### Example: Download RNASeq Data - R
Source: https://docs.ropensci.org/UCSCXenaTools/reference/downloadTCGA.html
Example of downloading RNASeq data for a specific TCGA project (UVM).
```r
if (FALSE) { # \dontrun{
# download RNASeq data (use UVM as example)
downloadTCGA(project = "UVM",
data_type = "Gene Expression RNASeq",
file_type = "IlluminaHiSeq RNASeqV2")
} # }
```
--------------------------------
### Install UCSCXenaTools Development Version from GitHub
Source: https://docs.ropensci.org/UCSCXenaTools/index.html
Installs the latest development version of the UCSCXenaTools package directly from GitHub. This is useful for accessing the newest features or bug fixes.
```R
# install.packages("remotes")
remotes::install_github("ropensci/UCSCXenaTools")
```
--------------------------------
### Install UCSCXenaTools from CRAN
Source: https://docs.ropensci.org/UCSCXenaTools/articles/USCSXenaTools.html
Installs the stable release of the UCSCXenaTools package from CRAN.
```R
install.packages("UCSCXenaTools")
```
--------------------------------
### Interactive Program Notice (GNU GPL)
Source: https://docs.ropensci.org/UCSCXenaTools/LICENSE.html
Display this notice when a program starts in interactive mode to inform users about its free software status, warranty, and redistribution conditions.
```text
UCSCXenaTools Copyright (C) 2019 Shixiang Wang
This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'show c' for details.
```
--------------------------------
### Download Data with Resume from Breakpoint
Source: https://docs.ropensci.org/UCSCXenaTools/articles/USCSXenaTools.html
Download data using XenaDownload, with options to resume from a breakpoint using 'curl' or 'wget' methods. Ensure the respective command-line tools are installed.
```R
library(UCSCXenaTools)
xe = XenaGenerate(subset = XenaDatasets == "TcgaTargetGtex_expected_count")
xe
xq = XenaQuery(xe)
# You cannot resume from breakpoint in default mode
XenaDownload(xq, destdir = "~/test/", force = TRUE)
# You can do it with 'curl' command
XenaDownload(xq, destdir = "~/test/", method = "curl", extra = "-C - -L", force = TRUE)
# You can do it with 'wget' command
XenaDownload(xq, destdir = "~/test/", method = "wget", extra = "-c", force = TRUE)
```
--------------------------------
### Install UCSCXenaTools from r-universe/CRAN
Source: https://docs.ropensci.org/UCSCXenaTools/index.html
Installs the stable release of the UCSCXenaTools package from the r-universe or CRAN repositories. Ensure you have the necessary repositories configured.
```R
install.packages('UCSCXenaTools', repos = c('https://ropensci.r-universe.dev', 'https://cloud.r-project.org'))
```
--------------------------------
### Get Default Xena Hosts
Source: https://docs.ropensci.org/UCSCXenaTools/reference/xena_default_hosts.html
Retrieves a character vector of current default Xena hosts. No setup or imports are required beyond having the package installed.
```R
xena_default_hosts()
```
--------------------------------
### Query Only TCGA Hosts
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaHub.html
This example shows how to create a XenaHub object specifically for TCGA hosts by specifying the hostName argument.
```R
xe = XenaHub(hostName = "tcgaHub")
xe
```
--------------------------------
### GNU GPL License Text for Source Files
Source: https://docs.ropensci.org/UCSCXenaTools/LICENSE.html
Include this text at the start of each source file to state the exclusion of warranty and specify redistribution terms under the GNU GPL.
```text
An R package for accessing genomics data from UCSC Xena platform, from cancer multi-omics to single-cell RNA-seq.
Copyright (C) 2019 Shixiang Wang
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
```
--------------------------------
### Get all TCGA ProjectIDs, DataTypes, and FileTypes
Source: https://docs.ropensci.org/UCSCXenaTools/reference/availTCGA.html
Call availTCGA with 'all' to retrieve a comprehensive list of available TCGA ProjectIDs, DataTypes, and FileTypes. Note that not all projects may have all data types and file types listed; use the showTCGA function for specific project checks.
```R
availTCGA("all")
```
--------------------------------
### Get Samples by Datasets in R
Source: https://docs.ropensci.org/UCSCXenaTools/reference/samples.html
Retrieves samples from each dataset within a specified Xena Hub cohort. Useful for analyzing sample distribution across different datasets on a single host.
```R
if (FALSE) { # \dontrun{
xe = XenaHub(cohorts = "Cancer Cell Line Encyclopedia (CCLE)")
# samples in each dataset, first host
x = samples(xe, by="datasets", how="each")[[1]]
lengths(x) # data sets in ccle cohort on first (only) host
} # }
```
--------------------------------
### Get Default Xena Hosts
Source: https://docs.ropensci.org/UCSCXenaTools/reference/xena_default_hosts.html
This function returns a character vector containing the current default Xena hosts.
```APIDOC
## xena_default_hosts()
### Description
Return Xena default hosts.
### Usage
```R
xena_default_hosts()
```
### Value
A character vector include current defalut hosts.
```
--------------------------------
### Query ProbeMap URL for Datasets
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaQueryProbeMap.html
Use this function to get ProbeMap URLs. It requires a XenaHub object as input and returns a data frame with host, dataset, and URL information. Datasets without ProbeMaps are ignored.
```R
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub")
hosts(xe)
#> [1] "https://tcga.xenahubs.net"
if (FALSE) { # \dontrun{
xe_query = XenaQueryProbeMap(xe)
} # }
```
--------------------------------
### Generate Specific XenaHub Datasets by Cohort
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaGenerate.html
Use the subset argument with a logical expression to filter datasets. This example retrieves all datasets associated with 'TCGA Breast Cancer (BRCA)'.
```R
XenaGenerate(subset = XenaCohorts == "TCGA Breast Cancer (BRCA)")
```
--------------------------------
### Prepare Downloaded Data for Analysis
Source: https://docs.ropensci.org/UCSCXenaTools/index.html
Prepares the downloaded data into a list format suitable for R analysis. The output is a list where each element corresponds to a downloaded dataset.
```r
cli = XenaPrepare(xe_download)
class(cli)
#> [1] "list"
names(cli)
#> [1] "LUNG_clinicalMatrix" "LUAD_clinicalMatrix" "LUSC_clinicalMatrix"
```
--------------------------------
### Query and Download Datasets
Source: https://docs.ropensci.org/UCSCXenaTools/articles/USCSXenaTools.html
Queries the specified datasets from the XenaHub object and initiates the download process. The download status and progress are reported.
```r
XenaQuery(df_todo) %>%
XenaDownload() -> xe_download
#> This will check url status, please be patient.
#> All downloaded files will under directory /tmp/RtmpM4lf4m.
#> The 'trans_slash' option is FALSE, keep same directory structure as Xena.
#> Creating directories for datasets...
#> Downloading TCGA.LUNG.sampleMap/LUNG_clinicalMatrix
#> Downloading TCGA.LUAD.sampleMap/LUAD_clinicalMatrix
#> Downloading TCGA.LUSC.sampleMap/LUSC_clinicalMatrix
```
--------------------------------
### XenaPrepare Function
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaPrepare.html
This function prepares downloaded datasets for use in R. It can load data from local files or URLs, and offers flexibility in subsetting rows and selecting columns.
```APIDOC
## XenaPrepare
### Description
Prepare (Load) Downloaded Datasets to R
### Usage
```R
XenaPrepare(
objects,
objectsName = NULL,
use_chunk = FALSE,
chunk_size = 100,
subset_rows = TRUE,
select_cols = TRUE,
callback = NULL,
comment = "#",
na = c("", "NA", "[Discrepancy]"),
...
)
```
### Arguments
* **objects** (character vector or data.frame): A character vector specifying local files/directory and download URLs, or a data.frame returned by XenaDownload.
* **objectsName** (character vector, optional): Specify names for elements of the return object.
* **use_chunk** (boolean): Default is `FALSE`. Set to `TRUE` to select a subset of original data and specify `chunk_size`, `select_direction`, `select_names`, `callback`.
* **chunk_size** (numeric): The number of rows to include in each chunk when `use_chunk` is `TRUE`.
* **subset_rows** (logical expression): Indicates elements or rows to keep. Missing values are taken as false. Can be a representation of a data frame for subsetting.
* **select_cols** (expression): Indicates columns to select from a data frame. For example, `select_cols = colnames(x)[1:3]` will keep only the first to third columns.
* **callback** (function, optional): A function to call on each chunk. Defaults to `NULL`. Overrides `subset_rows` and `select_cols` operations.
* **comment** (character): Specifies comment rows in files. Defaults to "#".
* **na** (character vector): Specifies `NA` values in files. Defaults to `c("", "NA", "[Discrepancy]")`.
* **...**: Other arguments to be passed to `read_tsv` or `read_tsv_chunked` from the `readr` package.
### Value
A list containing tibble-formatted file data.
### Author
Shixiang Wang
### Examples
```R
if (FALSE) { # \dontrun{
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub")
hosts(xe)
xe_query = XenaQuery(xe)
xe_download = XenaDownload(xe_query)
dat = XenaPrepare(xe_download)
}
```
```
--------------------------------
### Get Datasets
Source: https://docs.ropensci.org/UCSCXenaTools/reference/datasets.html
Retrieves a character vector containing the names of all available datasets from a given XenaHub object.
```APIDOC
## datasets
### Description
Get datasets of XenaHub object
### Usage
```R
datasets(x)
```
### Arguments
* `x` (XenaHub object) - A XenaHub object from which to retrieve datasets.
### Value
A character vector containing the names of the datasets available in the XenaHub object.
```
--------------------------------
### Query and Download Data
Source: https://docs.ropensci.org/UCSCXenaTools/index.html
Queries the selected datasets from the XenaHub object and initiates the download process. Downloaded files are stored in a temporary directory.
```r
XenaQuery(df_todo) %>%
XenaDownload() -> xe_download
#> This will check url status, please be patient.
#> All downloaded files will under directory /var/folders/h0/s_35svc15n1glmp65lbbkx9w0000gn/T//RtmpmgBjSb.
#> The 'trans_slash' option is FALSE, keep same directory structure as Xena.
#> Creating directories for datasets...
#> Downloading TCGA.LUNG.sampleMap/LUNG_clinicalMatrix
#> Downloading TCGA.LUAD.sampleMap/LUAD_clinicalMatrix
#> Downloading TCGA.LUSC.sampleMap/LUSC_clinicalMatrix
```
--------------------------------
### Get cohorts of XenaHub object
Source: https://docs.ropensci.org/UCSCXenaTools/reference/cohorts.html
Retrieves a character vector containing the names of all available cohorts from a given XenaHub object.
```APIDOC
## Function: cohorts
### Description
Retrieves a character vector containing the names of all available cohorts from a given XenaHub object.
### Usage
```R
cohorts(x)
```
### Arguments
* `x` (XenaHub object): An object representing a connection to a Xena Hub.
### Value
A character vector where each element is the name of a cohort.
### Examples
```R
# Generate a XenaHub object for the TCGA Hub
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub")
# Get the list of cohorts available in the TCGA Hub
c = cohorts(xe)
# Print the list of cohorts
print(c)
```
```
--------------------------------
### Get XenaHub hosts
Source: https://docs.ropensci.org/UCSCXenaTools/reference/hosts.html
Use the `hosts` function to retrieve a character vector of host URLs from a XenaHub object. This is often done after specifying a subset like 'tcgaHub'.
```R
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub"); hosts(xe)
```
--------------------------------
### Generate XenaHub Objects for Browsing
Source: https://docs.ropensci.org/UCSCXenaTools/articles/USCSXenaTools.html
Create XenaHub objects to specify cohorts and datasets for browsing. Use XenaFilter to narrow down the selection.
```R
XenaGenerate(subset = XenaHostNames=="tcgaHub") %>%
XenaFilter(filterDatasets = "clinical") %>%
XenaFilter(filterDatasets = "LUAD") -> to_browse
to_browse
```
```R
XenaGenerate(subset = XenaHostNames=="tcgaHub") %>%
XenaFilter(filterDatasets = "clinical") %>%
XenaFilter(filterDatasets = "LUAD|LUSC") -> to_browse2
to_browse2
```
--------------------------------
### Generate and List Xena Datasets
Source: https://docs.ropensci.org/UCSCXenaTools/reference/datasets.html
Connect to a Xena hub and list all available datasets for a specific host. This is useful for exploring the data available for a particular cancer type or study.
```R
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub"); datasets(xe)
```
--------------------------------
### Filter XenaHub Object by Datasets
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaFilter.html
Use XenaFilter to get all datasets containing 'clinical' in their names from a TCGA XenaHub object. This is useful for isolating specific types of data, such as clinical matrices.
```R
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub")
xe2 = XenaFilter(xe, filterDatasets = "clinical")
datasets(xe2)
```
--------------------------------
### Generate XenaHub Object and Query Datasets
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaQuery.html
Generates a XenaHub object for a specific host and then queries for available datasets. The `XenaQuery` function returns a data frame containing hosts, datasets, and their corresponding URLs.
```R
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub")
hosts(xe)
#> [1] "https://tcga.xenahubs.net"
if (FALSE) { # \dontrun{
xe_query = XenaQuery(xe)
}
```
--------------------------------
### samples Function
Source: https://docs.ropensci.org/UCSCXenaTools/reference/samples.html
Retrieves samples from a XenaHub object based on specified criteria for hosts, cohorts, or datasets.
```APIDOC
## samples Function
### Description
Get Samples of a XenaHub object according to 'by' and 'how' action arguments. One is often interested in identifying samples or features present in each data set, or shared by all data sets, or present in any of several data sets. Identifying these samples, including samples in arbitrarily chosen data sets.
### Usage
```R
samples(
x,
i = character(),
by = c("hosts", "cohorts", "datasets"),
how = c("each", "any", "all")
)
```
### Arguments
x
a XenaHub object
i
default is a empty character, it is used to specify the host, cohort or dataset by `by` option otherwise info will be automatically extracted by code
by
a character specify `by` action
how
a character specify `how` action
### Value
a list include samples
### Examples
```R
if (FALSE) { # \dontrun{
xe = XenaHub(cohorts = "Cancer Cell Line Encyclopedia (CCLE)")
# samples in each dataset, first host
x = samples(xe, by="datasets", how="each")[[1]]
lengths(x) # data sets in ccle cohort on first (only) host
} # }
```
```
--------------------------------
### Get XenaHub cohorts
Source: https://docs.ropensci.org/UCSCXenaTools/reference/cohorts.html
Use this function to retrieve a character vector of available cohorts from a XenaHub object. Ensure you have generated a XenaHub object first, specifying the desired hub using the 'subset' argument.
```R
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub"); cohorts(xe)
```
--------------------------------
### Download multiple data types for a TCGA project
Source: https://docs.ropensci.org/UCSCXenaTools/reference/getTCGAdata.html
Use this to download various data types for a specified TCGA project. Ensure you have the necessary data types enabled.
```R
getTCGAdata(project = "LUAD", mRNASeq = TRUE, mRNAArray = TRUE,
mRNASeqType = "normalized", miRNASeq = TRUE, exonRNASeq = TRUE,
RPPAArray = TRUE, Methylation = TRUE, MethylationType = "450K",
GeneMutation = TRUE, SomaticMutation = TRUE)
```
--------------------------------
### XenaQuery
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaQuery.html
Queries the URL of datasets before downloading them. It takes a XenaHub object as input and returns a data frame containing hosts, datasets, and their URLs.
```APIDOC
## XenaQuery
### Description
Queries the URL of datasets before downloading them. It takes a XenaHub object as input and returns a data frame containing hosts, datasets, and their URLs.
### Usage
```R
XenaQuery(x)
```
### Arguments
* `x` (XenaHub object) - A XenaHub object from which to query dataset information.
### Value
A `data.frame` containing hosts, datasets, and their corresponding URLs.
### Examples
```R
# Generate a XenaHub object for the tcgaHub
xe <- XenaGenerate(subset = XenaHostNames == "tcgaHub")
# Get the host URL
hosts(xe)
# Query dataset URLs (example within a dontrun block)
if (FALSE) { # \dontrun{
xe_query <- XenaQuery(xe)
}
```
```
--------------------------------
### Browse Multiple Datasets/Cohorts
Source: https://docs.ropensci.org/UCSCXenaTools/articles/USCSXenaTools.html
When opening multiple links is intended, set the 'multiple' option to TRUE. This is necessary when working with XenaHub objects containing more than one dataset or cohort.
```R
XenaBrowse(to_browse2, multiple = TRUE)
```
```R
XenaBrowse(to_browse2, type = "cohort", multiple = TRUE)
```
--------------------------------
### Browse Datasets and Cohorts in Browser
Source: https://docs.ropensci.org/UCSCXenaTools/articles/USCSXenaTools.html
Use XenaBrowse to open dataset or cohort links in your default web browser. By default, it limits to one link.
```R
# This will open you web browser
XenaBrowse(to_browse)
```
```R
XenaBrowse(to_browse, type = "cohort")
```
--------------------------------
### Generate XenaHub Object
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaHub.html
Use this function to create a XenaHub object. Specify hosts, cohorts, datasets, or hostName. If no arguments are provided, all hosts and datasets are returned.
```R
XenaHub(
hosts = xena_default_hosts(),
cohorts = character(),
datasets = character(),
hostName = c("publicHub", "tcgaHub", "gdcHub", "icgcHub", "toilHub", "pancanAtlasHub",
"treehouseHub", "pcawgHub", "atacseqHub", "singlecellHub", "kidsfirstHub", "tdiHub")
)
```
--------------------------------
### XenaDownload Function
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaDownload.html
Downloads datasets from UCSC Xena Hubs. It takes a query object and optional arguments to specify download location, probe map inclusion, and download behavior.
```APIDOC
## XenaDownload
### Description
Downloads datasets from UCSC Xena Hubs. It takes a query object and optional arguments to specify download location, probe map inclusion, and download behavior.
### Usage
```R
XenaDownload(
xquery,
destdir = tempdir(),
download_probeMap = FALSE,
trans_slash = FALSE,
force = FALSE,
max_try = 3L,
...
)
```
### Arguments
* **xquery** (tibble) - A tibble object generated by XenaQuery function.
* **destdir** (string) - Specify a location to store download data. Default is system temp directory.
* **download_probeMap** (logical) - If `TRUE`, also download ProbeMap data, which used for id mapping.
* **trans_slash** (logical) - Default is `FALSE`. If `TRUE`, transform slash '/' in dataset id to '__'. This option is for backwards compatibility.
* **force** (logical) - If `TRUE`, force to download data no matter whether files exist. Default is `FALSE`.
* **max_try** (integer) - Time limit to try downloading the data.
* **...** - Other arguments to `download.file` function
### Value
A tibble.
### Examples
```R
if (FALSE) { # \dontrun{
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub")
hosts(xe)
xe_query = XenaQuery(xe)
xe_download = XenaDownload(xe_query)
} # }
```
```
--------------------------------
### XenaPrepare Function Signature
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaPrepare.html
This is the function signature for XenaPrepare. It outlines the available arguments for loading and preparing downloaded Xena datasets.
```R
XenaPrepare(
objects,
objectsName = NULL,
use_chunk = FALSE,
chunk_size = 100,
subset_rows = TRUE,
select_cols = TRUE,
callback = NULL,
comment = "#",
na = c("", "NA", "[Discrepancy]"),
...
)
```
--------------------------------
### Browse UCSC Xena Datasets/Cohorts
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaBrowse.html
Opens dataset or cohort links from UCSC Xena in the default browser. Requires a XenaHub object and can be configured to open multiple links.
```R
XenaBrowse(x, type = c("dataset", "cohort"), multiple = FALSE)
```
```R
# \donttest{
XenaGenerate(subset = XenaHostNames == "tcgaHub") %>%
XenaFilter(filterDatasets = "clinical") %>%
XenaFilter(filterDatasets = "LUAD") -> to_browse
# }
```
--------------------------------
### Generate All XenaHub Datasets
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaGenerate.html
Call XenaGenerate() without arguments to retrieve all available datasets from XenaHub. This provides a comprehensive overview of the data accessible through the package.
```R
XenaGenerate()
```
--------------------------------
### Access XenaHub Object Properties
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaHub.html
After creating a XenaHub object, you can use accessor functions to retrieve hosts, cohorts, datasets, and samples.
```R
hosts(xe)
cohorts(xe)
datasets(xe)
samples(xe)
```
--------------------------------
### XenaQueryProbeMap
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaQueryProbeMap.html
Queries the ProbeMap URL for datasets. Accepts a XenaHub object and returns a data.frame containing hosts, datasets, and their corresponding ProbeMap URLs.
```APIDOC
## Function: XenaQueryProbeMap
### Description
Queries the ProbeMap URL for datasets. If a dataset does not have a ProbeMap, it will be ignored.
### Usage
```R
XenaQueryProbeMap(x)
```
### Arguments
* `x` (XenaHub object) - A XenaHub object.
### Value
A `data.frame` containing hosts, datasets, and their ProbeMap URLs.
### Examples
```R
# Generate a XenaHub object for the tcgaHub
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub")
# Get the hosts from the XenaHub object
hosts(xe)
# Query ProbeMap URLs (example within a dontrun block)
if (FALSE) { # \dontrun{
xe_query = XenaQueryProbeMap(xe)
}
```
```
--------------------------------
### Citation for UCSC Xena Platform
Source: https://docs.ropensci.org/UCSCXenaTools/index.html
Provides the citation for the UCSC Xena Platform. This should be used when referring to the platform itself in publications.
```text
Goldman, Mary, et al. "The UCSC Xena Platform for cancer genomics data
visualization and interpretation." BioRxiv (2019): 326470.
```
--------------------------------
### XenaHub Class Structure
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaHub-class.html
This snippet details the structure of the XenaHub S4 class, outlining its key slots: hosts, cohorts, and datasets.
```APIDOC
## Class XenaHub
Source: `R/XenaHub-class.R`
`XenaHub-class.Rd`
a S4 class to represent UCSC Xena Data Hubs
### Slots
`hosts`
hosts of data hubs
`cohorts`
cohorts of data hubs
`datasets`
datasets of data hubs
```
--------------------------------
### hosts() function
Source: https://docs.ropensci.org/UCSCXenaTools/reference/hosts.html
Retrieves the hosts of a XenaHub object. This function takes a XenaHub object as input and returns a character vector containing the hosts.
```APIDOC
## hosts(x)
### Description
Get hosts of XenaHub object
### Arguments
* `x` (XenaHub object) - A XenaHub object.
### Value
A character vector containing hosts.
### Examples
```R
xe = XenaGenerate(subset = XenaHostNames == "tcgaHub"); hosts(xe)
#> [1] "https://tcga.xenahubs.net"
```
```
--------------------------------
### List of Xena Datasets
Source: https://docs.ropensci.org/UCSCXenaTools/news/index.html
This output shows a list of dataset filenames available in Xena. It is typically generated by a function call within the package.
```R
[1] "TCGA_survival_data_2.txt"
[2] "clinical_CellLinePolyA_21.06_2021-06-15.tsv"
[3] "CellLinePolyA_21.06_hugo_log2tpm_58581genes_2021-06-15.tsv"
```
--------------------------------
### Load and Inspect XenaData
Source: https://docs.ropensci.org/UCSCXenaTools/index.html
Loads the XenaData object into R and displays the first few rows to show available datasets and their metadata. This object is essential for creating XenaHub instances.
```r
library(UCSCXenaTools)
#> =========================================================================================
#> UCSCXenaTools version 1.6.0
#> 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--
data(XenaData)
head(XenaData)
#> # A tibble: 6 × 17
#> XenaHosts XenaHostNames XenaCohorts XenaDatasets SampleCount DataSubtype Label
#>
#> 1 https://… publicHub Breast Can… ucsfNeve_pu… 51 gene expre… Neve…
#> 2 https://… publicHub Breast Can… ucsfNeve_pu… 57 phenotype Phen…
#> 3 https://… publicHub Glioma (Ko… kotliarov20… 194 copy number Kotl…
#> 4 https://… publicHub Glioma (Ko… kotliarov20… 194 phenotype Phen…
#> 5 https://… publicHub Lung Cance… weir2007_pu… 383 copy number CGH
#> 6 https://… publicHub Lung Cance… weir2007_pu… 383 phenotype Phen…
#> # ℹ 10 more variables: Type , AnatomicalOrigin , SampleType ,
#> # Tags , ProbeMap , LongTitle , Citation , Version ,
#> # Unit , Platform
```
--------------------------------
### Download clinical data for multiple TCGA projects
Source: https://docs.ropensci.org/UCSCXenaTools/reference/getTCGAdata.html
Use this to download clinical data for multiple TCGA projects simultaneously. Set download to TRUE to initiate the download.
```R
getTCGAdata(project = c("LUAD", "LUSC"), clinical = TRUE, download = TRUE)
```
--------------------------------
### XenaHub Function
Source: https://docs.ropensci.org/UCSCXenaTools/reference/XenaHub.html
Generates an XenaHub object by specifying hosts, cohorts, datasets, or hostName. If no arguments are provided, it returns all hosts and their corresponding datasets.
```APIDOC
## XenaHub
### Description
It is used to generate original `XenaHub` object according to hosts, cohorts, datasets or hostName. If these arguments not specified, all hosts and corresponding datasets will be returned as a `XenaHub` object. All datasets can be found at https://xenabrowser.net/datapages/.
### Usage
```R
XenaHub(
hosts = xena_default_hosts(),
cohorts = character(),
datasets = character(),
hostName = c("publicHub", "tcgaHub", "gdcHub", "icgcHub", "toilHub", "pancanAtlasHub",
"treehouseHub", "pcawgHub", "atacseqHub", "singlecellHub", "kidsfirstHub", "tdiHub")
)
```
### Arguments
hosts
a character vector specify UCSC Xena hosts, all available hosts can be found by `xena_default_hosts()` function. `hostName` is a more recommend option.
cohorts
default is empty character vector, all cohorts will be returned.
datasets
default is empty character vector, all datasets will be returned.
hostName
name of host, available options can be accessed by `.xena_hosts` This is an easier option for user than `hosts` option. Note, this option will overlap `hosts`.
### Value
a XenaHub object
### Examples
```R
if (FALSE) { # \dontrun{
#1 query all hosts, cohorts and datasets
xe = XenaHub()
xe
#2 query only TCGA hosts
xe = XenaHub(hostName = "tcgaHub")
xe
hosts(xe) # get hosts
cohorts(xe) # get cohorts
datasets(xe) # get datasets
samples(xe) # get samples
} # }
```
```
--------------------------------
### Show All TCGA Project Data Structure
Source: https://docs.ropensci.org/UCSCXenaTools/reference/showTCGA.html
Call `showTCGA` with 'all' to retrieve a data frame containing the data structure information for all TCGA projects. This is useful for understanding the breadth of available data.
```R
showTCGA("all")
```
--------------------------------
### Download TCGA Data - R
Source: https://docs.ropensci.org/UCSCXenaTools/reference/downloadTCGA.html
Use this function to download TCGA data. Specify project, data_type, and file_type. Defaults to system temp directory for downloads.
```r
downloadTCGA(
project = NULL,
data_type = NULL,
file_type = NULL,
destdir = tempdir(),
force = FALSE,
...
)
```