From 93636b15d9e5ec80f3e5fd7f172c71a5a077878f Mon Sep 17 00:00:00 2001 From: Stephanie Spielman Date: Thu, 7 Nov 2024 16:21:35 -0500 Subject: [PATCH] fix meta bug in 06 notebook --- .../notebook_template/06_cnv_infercnv_exploration.Rmd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/analyses/cell-type-wilms-tumor-06/notebook_template/06_cnv_infercnv_exploration.Rmd b/analyses/cell-type-wilms-tumor-06/notebook_template/06_cnv_infercnv_exploration.Rmd index bf97851a8..6584a3ab7 100644 --- a/analyses/cell-type-wilms-tumor-06/notebook_template/06_cnv_infercnv_exploration.Rmd +++ b/analyses/cell-type-wilms-tumor-06/notebook_template/06_cnv_infercnv_exploration.Rmd @@ -4,7 +4,7 @@ author: "Maud PLASCHKA" date: "`r Sys.Date()`" params: scpca_project_id: "SCPCP000006" - sample_id: "SCPCS000184" + sample_id: "SCPCS000179" seed: 12345 output: html_document: @@ -286,9 +286,10 @@ wrapper_explore_hmm <- function(infercnv_obj, cnv_threshold = 1) { theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1)) #### CNV score - meta <- infercnv_obj@meta.data |> - mutate(has_cnv_score = rowSums(meta[, grepl("has_cnv_chr", colnames(meta))])) |> - mutate(has_cnv_score = case_when( + meta <- infercnv_obj@meta.data + meta <- meta |> + dplyr::mutate(has_cnv_score = rowSums(meta[, grepl("has_cnv_chr", colnames(meta))])) |> + dplyr::mutate(has_cnv_score = dplyr::case_when( has_cnv_score > cnv_threshold ~ "CNV", has_cnv_score <= cnv_threshold ~ "no CNV" ))