From 2a7be1aeadceb63ec79d217a42895e946b4d970a Mon Sep 17 00:00:00 2001 From: Cauley Date: Tue, 1 Aug 2023 17:14:17 -0400 Subject: [PATCH] Added GOI table printing for Filtering --- R/filtering.R | 5 +++-- vignettes/Integration_Test_CPTR_Colon.Rmd | 3 ++- vignettes/Integration_Test_Colon.Rmd | 1 + vignettes/Integration_Test_Kidney.Rmd | 1 + vignettes/Integration_Test_Mouse_Thymus.Rmd | 1 + vignettes/Integration_Test_NSCLC.Rmd | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/R/filtering.R b/R/filtering.R index 7d806bf..b3dce94 100644 --- a/R/filtering.R +++ b/R/filtering.R @@ -154,9 +154,10 @@ filtering <- function(object, loq.cutoff, loq.min, cut.segment, goi) { if(class(goi)[1] != "character"){ stop(paste0("Error: You have the wrong data class, must be character vector" )) } - goi.df <- data.frame(Gene = goi, + goi.table <- data.frame(Gene = goi, Number = fData(object)[goi, "DetectedSegments"], DetectionRate = percent(fData(object)[goi, "DetectionRate"])) + #goi.table <- capture.output(print(goi.df, row.name = FALSE)) ## 4.5.3 Gene Filtering # Plot detection rate: @@ -191,5 +192,5 @@ filtering <- function(object, loq.cutoff, loq.min, cut.segment, goi) { # retain only detected genes of interest goi <- goi[goi %in% rownames(object)] - return(list("stacked.bar.plot" = stacked.bar.plot, "tab" = tab, "sankey.plot" = sankey.plot, "genes.detected.plot" = genes.detected.plot, "object" = object)) + return(list("stacked.bar.plot" = stacked.bar.plot, "tab" = tab, "sankey.plot" = sankey.plot, "goi.table" = goi.table, "genes.detected.plot" = genes.detected.plot, "object" = object)) } diff --git a/vignettes/Integration_Test_CPTR_Colon.Rmd b/vignettes/Integration_Test_CPTR_Colon.Rmd index b998434..1cfc13a 100644 --- a/vignettes/Integration_Test_CPTR_Colon.Rmd +++ b/vignettes/Integration_Test_CPTR_Colon.Rmd @@ -71,7 +71,7 @@ This runs the DSPworkflow package to completion using the Human Colon Cancer Dat print(sdesign.list$sankey.plot) print("Created GeoMx Object\n\n") - pData(sdesign.list$object)[,c("slide name","class","segment")] + pData(sdesign.list$object)[,c("slide_name","class","segment")] ``` @@ -117,6 +117,7 @@ qc.output <- qcProc(object = sdesign.list$object, print(filtering.output$`tab`) print(filtering.output$`sankey.plot`) print(filtering.output$`genes.detected.plot`) + print(filtering.output$'goi.table', row.names = FALSE) create.rds <- FALSE if(create.rds) { diff --git a/vignettes/Integration_Test_Colon.Rmd b/vignettes/Integration_Test_Colon.Rmd index b6cab8a..b39d8fc 100644 --- a/vignettes/Integration_Test_Colon.Rmd +++ b/vignettes/Integration_Test_Colon.Rmd @@ -123,6 +123,7 @@ This runs the DSPworkflow package to completion using the Human Colon Dataset: print(filtering.output$`tab`) print(filtering.output$`sankey.plot`) print(filtering.output$`genes.detected.plot`) + print(filtering.output$'goi.table', row.names = FALSE) create.rds <- TRUE if(create.rds) { diff --git a/vignettes/Integration_Test_Kidney.Rmd b/vignettes/Integration_Test_Kidney.Rmd index 5f2006b..e0e092f 100644 --- a/vignettes/Integration_Test_Kidney.Rmd +++ b/vignettes/Integration_Test_Kidney.Rmd @@ -125,6 +125,7 @@ qc.output <- qcProc(object = sdesign.list$object, print(filtering.output$`tab`) print(filtering.output$`sankey.plot`) print(filtering.output$`genes.detected.plot`) + print(filtering.output$'goi.table', row.names = FALSE) create.rds <- TRUE if(create.rds) { diff --git a/vignettes/Integration_Test_Mouse_Thymus.Rmd b/vignettes/Integration_Test_Mouse_Thymus.Rmd index 7649192..83d062a 100644 --- a/vignettes/Integration_Test_Mouse_Thymus.Rmd +++ b/vignettes/Integration_Test_Mouse_Thymus.Rmd @@ -124,6 +124,7 @@ qc.output <- qcProc(object = sdesign.list$object, print(filtering.output$`tab`) print(filtering.output$`sankey.plot`) print(filtering.output$`genes.detected.plot`) + print(filtering.output$'goi.table', row.names = FALSE) create.rds <- TRUE if(create.rds) { diff --git a/vignettes/Integration_Test_NSCLC.Rmd b/vignettes/Integration_Test_NSCLC.Rmd index 7eed700..2294ba7 100644 --- a/vignettes/Integration_Test_NSCLC.Rmd +++ b/vignettes/Integration_Test_NSCLC.Rmd @@ -128,6 +128,7 @@ qc.output <- qcProc(object = sdesign.list$object, print(filtering.output$`tab`) print(filtering.output$`sankey.plot`) print(filtering.output$`genes.detected.plot`) + print(filtering.output$'goi.table', row.names = FALSE) create.rds <- TRUE if(create.rds) {