Skip to content

Commit

Permalink
🔥 remove calls to deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sickler-alex committed Feb 2, 2023
1 parent 6fdb450 commit 560ef0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions analyses/methylation-summary/02-calculate-methly-quantiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -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("===============================================================")
Expand All @@ -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"){
Expand All @@ -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")
8 changes: 4 additions & 4 deletions analyses/methylation-summary/05-create-methyl-summary-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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") {
Expand All @@ -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,
Expand All @@ -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")

0 comments on commit 560ef0a

Please sign in to comment.