diff --git a/tools/scp/utils.R b/tools/scp/utils.R index eb7744a1e..9c40bfed2 100644 --- a/tools/scp/utils.R +++ b/tools/scp/utils.R @@ -4,7 +4,6 @@ library(tidyr) library(tibble) # Export intermediate results - # Function to export a single assay with metadata export_assay_with_metadata <- function(qf, assay_name) { # Extract assay data, row metadata, and col metadata @@ -33,27 +32,21 @@ export_all_assays <- function(qf) { # Plot the QC boxplots create_boxplots <- function(scp, i, is_log2, name) { sce <- scp[[i]] - assay_data <- as.data.frame(assay(sce)) %>% rownames_to_column("FeatureID") - col_data <- as.data.frame(colData(scp)) %>% rownames_to_column("SampleID") - long_data <- assay_data %>% pivot_longer( - cols = -FeatureID, - names_to = "SampleID", - values_to = "Value" + cols = -FeatureID, + names_to = "SampleID", + values_to = "Value" ) - long_data <- long_data %>% left_join(col_data, by = "SampleID") - if (is_log2 == TRUE) { long_data$Value <- log2(long_data$Value) } - long_data %>% filter(Value != "NaN") %>% ggplot(aes(x = runCol, y = Value, fill = SampleType)) + @@ -63,7 +56,7 @@ create_boxplots <- function(scp, i, is_log2, name) { title = name, x = "Run", y = "Log2 intensity" - ) + + ) + theme(axis.text.x = element_text(angle = 45, hjust=1)) }