Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions R/merge_ml_results.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ buildTopFeatsPq <- function(
full.names = TRUE,
recursive = TRUE
)

files <- files[basename(files) != "all_top_features.parquet"]

if (length(files) == 0) {
stop(
"No files matching '_top_features.parquet' were found in: ",
Expand Down Expand Up @@ -489,7 +490,8 @@ buildTopFeatsPqYearCountry <- function(
top_feat_dir_path
) {
files <- list.files(top_feat_dir_path, pattern = "\\.parquet$", full.names = TRUE)

files <- files[!basename(files) %in% c("year_top_features.parquet", "country_top_features.parquet")]

# Read and combine
merged_df <- files |>
purrr::set_names() |>
Expand Down Expand Up @@ -540,7 +542,8 @@ buildTopFeatsPqLOODrug <- function(
top_feat_dir_path
) {
files <- list.files(top_feat_dir_path, pattern = "\\.parquet$", full.names = TRUE)

files <- files[!basename(files) %in% c("LOO_drug_top_features.parquet")]

# Read and combine
merged_df <- files |>
purrr::set_names() |> # keeps file names attached
Expand Down Expand Up @@ -572,6 +575,7 @@ buildTopFeatsPqMDR <- function(
top_feat_dir_path) {

files <- list.files(top_feat_dir_path, pattern = "\\.parquet$", full.names = TRUE)
files <- files[!basename(files) %in% c("MDR_top_features.parquet")]

# Read and combine
merged_df <- files|>
Expand Down Expand Up @@ -737,7 +741,8 @@ buildTopFeatsPqLOOCountry <- function(
top_feat_dir_path
) {
files <- list.files(top_feat_dir_path, pattern = "\\.parquet$", full.names = TRUE)

files <- files[files != file.path(top_feat_dir_path, "LOO_country_top_features.parquet")]

# Read and combine
merged_df <- files |>
purrr::set_names() |> # keeps file names attached
Expand Down Expand Up @@ -770,7 +775,8 @@ buildTopFeatsPqLOOYear <- function(
top_feat_dir_path
) {
files <- list.files(top_feat_dir_path, pattern = "\\.parquet$", full.names = TRUE)

files <- files[files != file.path(top_feat_dir_path, "LOO_year_top_features.parquet")]

# Read and combine
merged_df <- files |>
purrr::set_names() |> # keeps file names attached
Expand Down