Skip to content

Commit

Permalink
fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
KristinaGomoryova committed Jan 6, 2025
1 parent 76251f8 commit 77605d1
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions tools/scp/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)) +
Expand All @@ -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))
}

Expand Down

0 comments on commit 77605d1

Please sign in to comment.