get_gtex_exp | R Documentation |
This function retrieves gene expression data from the GTEx project that is specific to a certain organ. It performs various checks and processing steps to ensure that the data is consistent and relevant to the specified organ. The filtered and cleaned data is saved as an RDS file for further analysis.
get_gtex_exp(
organ_specific,
file_path,
probe_map_path,
pheno_path,
output_path
)
organ_specific |
A character string specifying the organ to filter the gene expression data by. |
file_path |
A character string specifying the path to the GTEx gene expression data file. |
probe_map_path |
A character string specifying the path to the gtex_probeMap_gencode data file. |
pheno_path |
A character string specifying the path to the GTEx phenotype data file. |
output_path |
A character string specifying the path where the output RDS file will be saved. |
The function begins by checking if the gene expression and phenotype data files exist at the specified paths. It then loads these data files and processes them by setting appropriate row names, modifying column names for clarity, and filtering samples based on the specified organ. The function ensures that only samples present in both datasets are retained for consistency. It also removes any duplicate gene entries to prevent redundancy. Finally, the processed data is saved as an RDS file.
A data frame containing gene expression data for the specified organ. Rows represent genes, and columns represent samples. Note that this function also saves the organ-specific GTEx data as an RDS file at the specified output path.
The function will stop and throw an error if the input files do not exist, or if no samples are found for the specified organ.
CRITICAL: The 'output_path' parameter must end with '.rds' to be properly recognized by the function. It is also highly recommended that the path includes specific identifiers related to the target samples. Please structure the 'output_path' following this pattern: './your_directory/your_sample_type.gtex.rds'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.