Learn R Programming

TransProR (version 1.0.2)

merge_gtex_tcga: Merge gene expression data from GTEx and TCGA datasets

Description

This function merges gene expression data obtained from the GTEx (Genotype-Tissue Expression) and TCGA (The Cancer Genome Atlas) datasets. It is assumed that both datasets are in '.rds' format and have genes as row names. The merged dataset is saved as an RDS file at the specified output path.

Usage

merge_gtex_tcga(
  gtex_data_path,
  tcga_exp_path,
  output_path = "./merged_gtex_tcga_data.rds"
)

Value

A data frame where rows represent genes and columns represent samples. The data frame contains expression values from both GTEx and TCGA datasets. It saves the merged dataset to the path specified by 'output_path'.

Arguments

gtex_data_path

A string that specifies the file path to the GTEx data saved in RDS format.

tcga_exp_path

A string that specifies the file path to the TCGA expression data saved in RDS format. This should be a data.frame with rows as genes and columns as samples.

output_path

A string that specifies the path where the merged dataset should be saved. The file is saved in '.rds' format. The default path is "./merged_gtex_tcga_data.rds".

Details

It is assumed that both datasets are in '.rds' format and have genes as row names.

Examples

Run this code
tumor_file <- system.file("extdata",
                          "removebatch_SKCM_Skin_TCGA_exp_tumor_test.rds",
                          package = "TransProR")
Normal_file <- system.file("extdata",
                           "removebatch_SKCM_Skin_Normal_TCGA_GTEX_count_test.rds",
                           package = "TransProR")
ouput_file <- file.path(tempdir(), "all_data.rds")

all_data <- merge_gtex_tcga(gtex_data_path = tumor_file,
                            tcga_exp_path = Normal_file,
                            output_path = ouput_file)

Run the code above in your browser using DataLab