Merges individual .rds files from the results output directory into one.
dataframe. Can also handle results lists directly.
Alternatively, can simply provide save_dir
and .rds
files will be searched for and imported.
merge_results(save_dir = NULL, res_files = NULL, list_name_column = "hpo_id")
Folder to save merged results in.
The output of ewce_para (can be either a list of file names, or a nested list of results).
The name of the gene_data column that has the gene list names.
dataframe and merged results.
set.seed(2023)
gene_data <- HPOExplorer::load_phenotype_to_genes()
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2023-10-09
ctd <- load_example_ctd()
list_names <- unique(gene_data$hpo_id)[seq(3)]
res_files <- ewce_para(ctd = ctd,
gene_data = gene_data,
list_names = list_names,
force_new = TRUE,
reps = 10)
#> Retrieving all genes using: gprofiler
#> Retrieving all organisms available in gprofiler.
#> Using stored `gprofiler_orgs`.
#> Mapping species name: human
#> Common name mapping found for human
#> 1 organism identified from search: hsapiens
#> Gene table with 62,663 rows retrieved.
#> Returning all 62,663 genes from human.
#> Returning 62,663 unique genes from entire human genome.
#> + Version: 2023-11-14
#> Computing gene counts.
all_results <- merge_results(res_files=res_files)