From 560ef0af863a721583b156fe5dd5006aa7638dbc Mon Sep 17 00:00:00 2001 From: Alex Sickler Date: Thu, 2 Feb 2023 10:04:44 -0500 Subject: [PATCH] :fire: remove calls to deprecated functions --- .../02-calculate-methly-quantiles.R | 10 +++++----- .../05-create-methyl-summary-table.R | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/analyses/methylation-summary/02-calculate-methly-quantiles.R b/analyses/methylation-summary/02-calculate-methly-quantiles.R index 83933322a3..b1916add2c 100755 --- a/analyses/methylation-summary/02-calculate-methly-quantiles.R +++ b/analyses/methylation-summary/02-calculate-methly-quantiles.R @@ -62,7 +62,7 @@ histologies <- data.table::fread(histologies, sep = "\t", # Get methyl values and only keep samples in independent sample list methyl_matrix_df <- readr::read_rds(methyl_matrix) %>% - dplyr::select(tidyselect::any_of(c("Probe_ID", independent_samples))) + dplyr::select(c("Probe_ID", independent_samples)) # Calculating probe-level methyl values quantiles for all pre-processed samples message("===============================================================") @@ -83,8 +83,8 @@ for (dataset in unique(histologies$cohort)) { dplyr::pull(Kids_First_Biospecimen_ID) quantiles <- methyl_matrix_df %>% tibble::column_to_rownames(var = "Probe_ID") %>% - dplyr::select(any_of(sample_ids)) %>% - dplyr::filter(if_any(everything(), ~ !is.na(.))) %>% + dplyr::select(sample_ids) %>% + na.omit() %>% apply(1, quantile, na.rm = TRUE) %>% t() %>% tibble::as_tibble(rownames = "Probe_ID") if (methyl_values == "beta"){ @@ -111,13 +111,13 @@ if (methyl_values == "beta"){ methyl_quantiles %>% data.table::setDT() %>% data.table::fwrite(file.path(results_dir, "methyl-probe-beta-quantiles.tsv.gz"), - sep="\t", compress = "auto") + sep="\t") } else { message("Writing probe-level methyl values quantiles to methyl-probe-m-quantiles.tsv file...\n") methyl_quantiles %>% data.table::setDT() %>% data.table::fwrite(file.path(results_dir, "methyl-probe-m-quantiles.tsv.gz"), - sep="\t", compress = "auto") + sep="\t") } message("Analysis Done..\n") diff --git a/analyses/methylation-summary/05-create-methyl-summary-table.R b/analyses/methylation-summary/05-create-methyl-summary-table.R index 2add128564..232bd6fddd 100755 --- a/analyses/methylation-summary/05-create-methyl-summary-table.R +++ b/analyses/methylation-summary/05-create-methyl-summary-table.R @@ -152,7 +152,7 @@ if (exp_values == "gene") { methy_summary_table %>% data.table::setDT() %>% data.table::fwrite(file.path(results_dir, "gene-methyl-beta-values-summary.tsv.gz"), - sep="\t", compress = "auto") + sep="\t") } else { methy_summary_table <- methy_summary_table %>% dplyr::select(Gene_symbol, targetFromSourceId, Dataset, Disease, @@ -163,7 +163,7 @@ if (exp_values == "gene") { methy_summary_table %>% data.table::setDT() %>% data.table::fwrite(file.path(results_dir, "gene-methyl-m-values-summary.tsv.gz"), - sep="\t", compress = "auto") + sep="\t") } } else { if (methyl_values == "beta") { @@ -177,7 +177,7 @@ if (exp_values == "gene") { methy_summary_table %>% data.table::setDT() %>% data.table::fwrite(file.path(results_dir, "isoform-methyl-beta-values-summary.tsv.gz"), - sep="\t", compress = "auto") + sep="\t") } else { methy_summary_table <- methy_summary_table %>% dplyr::select(Gene_symbol, targetFromSourceId, transcript_id, Dataset, @@ -189,7 +189,7 @@ if (exp_values == "gene") { methy_summary_table %>% data.table::setDT() %>% data.table::fwrite(file.path(results_dir, "isoform-methyl-m-values-summary.tsv.gz"), - sep="\t", compress = "auto") + sep="\t") } } message("Analysis Done..\n") \ No newline at end of file