# Run [bcbioRnaseq::downloads()] to download `setup.R`
source("setup.R")

# bcbioRnaDataSet. Uncomment with correct values.
# bcb <- load_run(
#    upload_dir = file.path("data", "final"),
#    interesting_groups = c("genotype", "treatment"))
save_data(bcb, dir = data_dir)

Overview

> metadata_table(bcb)
Sample metadata
group
ctrl
ctrl
ko
ko

> raw_counts <- counts(bcb, normalized = FALSE)
> normalized_counts <- counts(bcb, normalized = TRUE)
> tpm <- tpm(bcb)
> save_data(raw_counts, normalized_counts, tpm, dir = data_dir)
> write_counts(raw_counts, normalized_counts, tpm, dir = counts_dir)
## Error in dir.create(dir, recursive = TRUE, showWarnings = FALSE): object 'counts_dir' not found

Fit modeling

Several quality metrics were first assessed to explore the fit of the model, before differential expression analysis was performed. We observe that the modeling fit is good.

The plots below show the standard deviation of normalized counts (normalized_counts) using log2(), rlog(), and variance stabilizing (vst()) transformations by rank(mean). The transformations greatly reduce the standard deviation, with rlog() stabilizing the variance best across the mean.

> plot_mean_sd(bcb)

Dispersion

The following plot shows the dispersion by mean of normalized counts. We expect the dispersion to decrease as the mean of normalized counts increases.

> plot_dispersion(bcb)

Read metrics

Total reads

> plot_total_reads(bcb)