Last updated: 2025-04-08
Checks: 7 0
Knit directory: DTU-code/analysis/
This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20240501) was run prior to running
the code in the R Markdown file. Setting a seed ensures that any results
that rely on randomness, e.g. subsampling or permutations, are
reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 59e7c06. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish or
wflow_git_commit). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: .gitignore
Ignored: .renvignore
Ignored: DTU-code.Rproj
Ignored: code/.RData
Ignored: code/mouse/data/slurm-16691239.out
Ignored: code/mouse/salmon-index/slurm-16693056.out
Ignored: code/mouse/salmon/slurm-16693640.out
Ignored: code/mouse/subread-index/.RData
Ignored: code/mouse/subread-index/buildindex.Rout
Ignored: code/mouse/subread-index/slurm-19350188.out
Ignored: code/mouse/subread/.nextflow.log
Ignored: code/mouse/subread/.nextflow/
Ignored: code/mouse/subread/log/
Ignored: code/mouse/subread/report.html
Ignored: code/mouse/subread/slurm-19356012.out
Ignored: code/mouse/subread/timeline.html
Ignored: code/mouse/subread/trace-20241127-50139746.txt
Ignored: code/pkg/.Rbuildignore
Ignored: code/pkg/.Rhistory
Ignored: code/pkg/.Rproj.user/
Ignored: code/pkg/src/.gitignore
Ignored: code/pkg/src/RcppExports.o
Ignored: code/pkg/src/pkg.so
Ignored: code/pkg/src/rcpparma_hello_world.o
Ignored: code/simulation-lenient/slurm-20927698_1.out
Ignored: code/simulation-lenient/slurm-20927698_10.out
Ignored: code/simulation-lenient/slurm-20927698_100.out
Ignored: code/simulation-lenient/slurm-20927698_101.out
Ignored: code/simulation-lenient/slurm-20927698_102.out
Ignored: code/simulation-lenient/slurm-20927698_103.out
Ignored: code/simulation-lenient/slurm-20927698_104.out
Ignored: code/simulation-lenient/slurm-20927698_105.out
Ignored: code/simulation-lenient/slurm-20927698_106.out
Ignored: code/simulation-lenient/slurm-20927698_107.out
Ignored: code/simulation-lenient/slurm-20927698_108.out
Ignored: code/simulation-lenient/slurm-20927698_109.out
Ignored: code/simulation-lenient/slurm-20927698_11.out
Ignored: code/simulation-lenient/slurm-20927698_110.out
Ignored: code/simulation-lenient/slurm-20927698_111.out
Ignored: code/simulation-lenient/slurm-20927698_112.out
Ignored: code/simulation-lenient/slurm-20927698_113.out
Ignored: code/simulation-lenient/slurm-20927698_114.out
Ignored: code/simulation-lenient/slurm-20927698_115.out
Ignored: code/simulation-lenient/slurm-20927698_116.out
Ignored: code/simulation-lenient/slurm-20927698_117.out
Ignored: code/simulation-lenient/slurm-20927698_118.out
Ignored: code/simulation-lenient/slurm-20927698_119.out
Ignored: code/simulation-lenient/slurm-20927698_12.out
Ignored: code/simulation-lenient/slurm-20927698_120.out
Ignored: code/simulation-lenient/slurm-20927698_13.out
Ignored: code/simulation-lenient/slurm-20927698_14.out
Ignored: code/simulation-lenient/slurm-20927698_15.out
Ignored: code/simulation-lenient/slurm-20927698_16.out
Ignored: code/simulation-lenient/slurm-20927698_17.out
Ignored: code/simulation-lenient/slurm-20927698_18.out
Ignored: code/simulation-lenient/slurm-20927698_19.out
Ignored: code/simulation-lenient/slurm-20927698_2.out
Ignored: code/simulation-lenient/slurm-20927698_20.out
Ignored: code/simulation-lenient/slurm-20927698_21.out
Ignored: code/simulation-lenient/slurm-20927698_22.out
Ignored: code/simulation-lenient/slurm-20927698_23.out
Ignored: code/simulation-lenient/slurm-20927698_24.out
Ignored: code/simulation-lenient/slurm-20927698_25.out
Ignored: code/simulation-lenient/slurm-20927698_26.out
Ignored: code/simulation-lenient/slurm-20927698_27.out
Ignored: code/simulation-lenient/slurm-20927698_28.out
Ignored: code/simulation-lenient/slurm-20927698_29.out
Ignored: code/simulation-lenient/slurm-20927698_3.out
Ignored: code/simulation-lenient/slurm-20927698_30.out
Ignored: code/simulation-lenient/slurm-20927698_31.out
Ignored: code/simulation-lenient/slurm-20927698_32.out
Ignored: code/simulation-lenient/slurm-20927698_33.out
Ignored: code/simulation-lenient/slurm-20927698_34.out
Ignored: code/simulation-lenient/slurm-20927698_35.out
Ignored: code/simulation-lenient/slurm-20927698_36.out
Ignored: code/simulation-lenient/slurm-20927698_37.out
Ignored: code/simulation-lenient/slurm-20927698_38.out
Ignored: code/simulation-lenient/slurm-20927698_39.out
Ignored: code/simulation-lenient/slurm-20927698_4.out
Ignored: code/simulation-lenient/slurm-20927698_40.out
Ignored: code/simulation-lenient/slurm-20927698_41.out
Ignored: code/simulation-lenient/slurm-20927698_42.out
Ignored: code/simulation-lenient/slurm-20927698_43.out
Ignored: code/simulation-lenient/slurm-20927698_44.out
Ignored: code/simulation-lenient/slurm-20927698_45.out
Ignored: code/simulation-lenient/slurm-20927698_46.out
Ignored: code/simulation-lenient/slurm-20927698_47.out
Ignored: code/simulation-lenient/slurm-20927698_48.out
Ignored: code/simulation-lenient/slurm-20927698_49.out
Ignored: code/simulation-lenient/slurm-20927698_5.out
Ignored: code/simulation-lenient/slurm-20927698_50.out
Ignored: code/simulation-lenient/slurm-20927698_51.out
Ignored: code/simulation-lenient/slurm-20927698_52.out
Ignored: code/simulation-lenient/slurm-20927698_53.out
Ignored: code/simulation-lenient/slurm-20927698_54.out
Ignored: code/simulation-lenient/slurm-20927698_55.out
Ignored: code/simulation-lenient/slurm-20927698_56.out
Ignored: code/simulation-lenient/slurm-20927698_57.out
Ignored: code/simulation-lenient/slurm-20927698_58.out
Ignored: code/simulation-lenient/slurm-20927698_59.out
Ignored: code/simulation-lenient/slurm-20927698_6.out
Ignored: code/simulation-lenient/slurm-20927698_60.out
Ignored: code/simulation-lenient/slurm-20927698_61.out
Ignored: code/simulation-lenient/slurm-20927698_62.out
Ignored: code/simulation-lenient/slurm-20927698_63.out
Ignored: code/simulation-lenient/slurm-20927698_64.out
Ignored: code/simulation-lenient/slurm-20927698_65.out
Ignored: code/simulation-lenient/slurm-20927698_66.out
Ignored: code/simulation-lenient/slurm-20927698_67.out
Ignored: code/simulation-lenient/slurm-20927698_68.out
Ignored: code/simulation-lenient/slurm-20927698_69.out
Ignored: code/simulation-lenient/slurm-20927698_7.out
Ignored: code/simulation-lenient/slurm-20927698_70.out
Ignored: code/simulation-lenient/slurm-20927698_71.out
Ignored: code/simulation-lenient/slurm-20927698_72.out
Ignored: code/simulation-lenient/slurm-20927698_73.out
Ignored: code/simulation-lenient/slurm-20927698_74.out
Ignored: code/simulation-lenient/slurm-20927698_75.out
Ignored: code/simulation-lenient/slurm-20927698_76.out
Ignored: code/simulation-lenient/slurm-20927698_77.out
Ignored: code/simulation-lenient/slurm-20927698_78.out
Ignored: code/simulation-lenient/slurm-20927698_79.out
Ignored: code/simulation-lenient/slurm-20927698_8.out
Ignored: code/simulation-lenient/slurm-20927698_80.out
Ignored: code/simulation-lenient/slurm-20927698_81.out
Ignored: code/simulation-lenient/slurm-20927698_82.out
Ignored: code/simulation-lenient/slurm-20927698_83.out
Ignored: code/simulation-lenient/slurm-20927698_84.out
Ignored: code/simulation-lenient/slurm-20927698_85.out
Ignored: code/simulation-lenient/slurm-20927698_86.out
Ignored: code/simulation-lenient/slurm-20927698_87.out
Ignored: code/simulation-lenient/slurm-20927698_88.out
Ignored: code/simulation-lenient/slurm-20927698_89.out
Ignored: code/simulation-lenient/slurm-20927698_9.out
Ignored: code/simulation-lenient/slurm-20927698_90.out
Ignored: code/simulation-lenient/slurm-20927698_91.out
Ignored: code/simulation-lenient/slurm-20927698_92.out
Ignored: code/simulation-lenient/slurm-20927698_93.out
Ignored: code/simulation-lenient/slurm-20927698_94.out
Ignored: code/simulation-lenient/slurm-20927698_95.out
Ignored: code/simulation-lenient/slurm-20927698_96.out
Ignored: code/simulation-lenient/slurm-20927698_97.out
Ignored: code/simulation-lenient/slurm-20927698_98.out
Ignored: code/simulation-lenient/slurm-20927698_99.out
Ignored: code/simulation-lenient/slurm-20927938.out
Ignored: code/simulation-lenient/summarize.Rout
Ignored: code/simulation-no-trend/
Ignored: code/simulation/.RData
Ignored: code/simulation/slurm-20927698_1.out
Ignored: code/simulation/slurm-20927698_10.out
Ignored: code/simulation/slurm-20927698_100.out
Ignored: code/simulation/slurm-20927698_101.out
Ignored: code/simulation/slurm-20927698_102.out
Ignored: code/simulation/slurm-20927698_103.out
Ignored: code/simulation/slurm-20927698_104.out
Ignored: code/simulation/slurm-20927698_105.out
Ignored: code/simulation/slurm-20927698_106.out
Ignored: code/simulation/slurm-20927698_107.out
Ignored: code/simulation/slurm-20927698_108.out
Ignored: code/simulation/slurm-20927698_109.out
Ignored: code/simulation/slurm-20927698_11.out
Ignored: code/simulation/slurm-20927698_110.out
Ignored: code/simulation/slurm-20927698_111.out
Ignored: code/simulation/slurm-20927698_112.out
Ignored: code/simulation/slurm-20927698_113.out
Ignored: code/simulation/slurm-20927698_114.out
Ignored: code/simulation/slurm-20927698_115.out
Ignored: code/simulation/slurm-20927698_116.out
Ignored: code/simulation/slurm-20927698_117.out
Ignored: code/simulation/slurm-20927698_118.out
Ignored: code/simulation/slurm-20927698_119.out
Ignored: code/simulation/slurm-20927698_12.out
Ignored: code/simulation/slurm-20927698_120.out
Ignored: code/simulation/slurm-20927698_13.out
Ignored: code/simulation/slurm-20927698_14.out
Ignored: code/simulation/slurm-20927698_15.out
Ignored: code/simulation/slurm-20927698_16.out
Ignored: code/simulation/slurm-20927698_17.out
Ignored: code/simulation/slurm-20927698_18.out
Ignored: code/simulation/slurm-20927698_19.out
Ignored: code/simulation/slurm-20927698_2.out
Ignored: code/simulation/slurm-20927698_20.out
Ignored: code/simulation/slurm-20927698_21.out
Ignored: code/simulation/slurm-20927698_22.out
Ignored: code/simulation/slurm-20927698_23.out
Ignored: code/simulation/slurm-20927698_24.out
Ignored: code/simulation/slurm-20927698_25.out
Ignored: code/simulation/slurm-20927698_26.out
Ignored: code/simulation/slurm-20927698_27.out
Ignored: code/simulation/slurm-20927698_28.out
Ignored: code/simulation/slurm-20927698_29.out
Ignored: code/simulation/slurm-20927698_3.out
Ignored: code/simulation/slurm-20927698_30.out
Ignored: code/simulation/slurm-20927698_31.out
Ignored: code/simulation/slurm-20927698_32.out
Ignored: code/simulation/slurm-20927698_33.out
Ignored: code/simulation/slurm-20927698_34.out
Ignored: code/simulation/slurm-20927698_35.out
Ignored: code/simulation/slurm-20927698_36.out
Ignored: code/simulation/slurm-20927698_37.out
Ignored: code/simulation/slurm-20927698_38.out
Ignored: code/simulation/slurm-20927698_39.out
Ignored: code/simulation/slurm-20927698_4.out
Ignored: code/simulation/slurm-20927698_40.out
Ignored: code/simulation/slurm-20927698_41.out
Ignored: code/simulation/slurm-20927698_42.out
Ignored: code/simulation/slurm-20927698_43.out
Ignored: code/simulation/slurm-20927698_44.out
Ignored: code/simulation/slurm-20927698_45.out
Ignored: code/simulation/slurm-20927698_46.out
Ignored: code/simulation/slurm-20927698_47.out
Ignored: code/simulation/slurm-20927698_48.out
Ignored: code/simulation/slurm-20927698_49.out
Ignored: code/simulation/slurm-20927698_5.out
Ignored: code/simulation/slurm-20927698_50.out
Ignored: code/simulation/slurm-20927698_51.out
Ignored: code/simulation/slurm-20927698_52.out
Ignored: code/simulation/slurm-20927698_53.out
Ignored: code/simulation/slurm-20927698_54.out
Ignored: code/simulation/slurm-20927698_55.out
Ignored: code/simulation/slurm-20927698_56.out
Ignored: code/simulation/slurm-20927698_57.out
Ignored: code/simulation/slurm-20927698_58.out
Ignored: code/simulation/slurm-20927698_59.out
Ignored: code/simulation/slurm-20927698_6.out
Ignored: code/simulation/slurm-20927698_60.out
Ignored: code/simulation/slurm-20927698_61.out
Ignored: code/simulation/slurm-20927698_62.out
Ignored: code/simulation/slurm-20927698_63.out
Ignored: code/simulation/slurm-20927698_64.out
Ignored: code/simulation/slurm-20927698_65.out
Ignored: code/simulation/slurm-20927698_66.out
Ignored: code/simulation/slurm-20927698_67.out
Ignored: code/simulation/slurm-20927698_68.out
Ignored: code/simulation/slurm-20927698_69.out
Ignored: code/simulation/slurm-20927698_7.out
Ignored: code/simulation/slurm-20927698_70.out
Ignored: code/simulation/slurm-20927698_71.out
Ignored: code/simulation/slurm-20927698_72.out
Ignored: code/simulation/slurm-20927698_73.out
Ignored: code/simulation/slurm-20927698_74.out
Ignored: code/simulation/slurm-20927698_75.out
Ignored: code/simulation/slurm-20927698_76.out
Ignored: code/simulation/slurm-20927698_77.out
Ignored: code/simulation/slurm-20927698_78.out
Ignored: code/simulation/slurm-20927698_79.out
Ignored: code/simulation/slurm-20927698_8.out
Ignored: code/simulation/slurm-20927698_80.out
Ignored: code/simulation/slurm-20927698_81.out
Ignored: code/simulation/slurm-20927698_82.out
Ignored: code/simulation/slurm-20927698_83.out
Ignored: code/simulation/slurm-20927698_84.out
Ignored: code/simulation/slurm-20927698_85.out
Ignored: code/simulation/slurm-20927698_86.out
Ignored: code/simulation/slurm-20927698_87.out
Ignored: code/simulation/slurm-20927698_88.out
Ignored: code/simulation/slurm-20927698_89.out
Ignored: code/simulation/slurm-20927698_9.out
Ignored: code/simulation/slurm-20927698_90.out
Ignored: code/simulation/slurm-20927698_91.out
Ignored: code/simulation/slurm-20927698_92.out
Ignored: code/simulation/slurm-20927698_93.out
Ignored: code/simulation/slurm-20927698_94.out
Ignored: code/simulation/slurm-20927698_95.out
Ignored: code/simulation/slurm-20927698_96.out
Ignored: code/simulation/slurm-20927698_97.out
Ignored: code/simulation/slurm-20927698_98.out
Ignored: code/simulation/slurm-20927698_99.out
Ignored: code/simulation/slurm-20927938.out
Ignored: code/simulation/summarize.Rout
Ignored: data/annotation/mm39/GRCm39.genome.fa.gz
Ignored: data/annotation/mm39/gencode.vM35.annotation.gtf.gz
Ignored: data/annotation/mm39/gencode.vM35.metadata.EntrezGene.gz
Ignored: data/annotation/mm39/gencode.vM35.transcripts.fa.gz
Ignored: data/mouse/fastq/
Ignored: ignore/
Ignored: output/mouse/
Ignored: output/simulation-lenient/
Ignored: output/simulation-no-trend/
Ignored: output/simulation/
Ignored: renv/
Unstaged changes:
Modified: misc/mouse.Rmd/Figure-CaseStudy.pdf
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/simulation-paper.Rmd) and
HTML (docs/simulation-paper.html) files. If you’ve
configured a remote Git repository (see ?wflow_git_remote),
click on the hyperlinks in the table below to view the files as they
were in that past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | 76ed87c | Pedro Baldoni | 2025-03-18 | Adding analysis reports |
knitr::opts_chunk$set(dev = "png",
dpi = 300,
dev.args = list(type = "cairo-png"),
root.dir = '.',
autodep = TRUE)
options(knitr.kable.NA = "-")
library(data.table)
library(magrittr)
library(ggplot2)
library(patchwork)
library(plyr)
library(kableExtra)
devtools::load_all('../code/pkg')
path.misc <- file.path('../misc/simulation-paper.Rmd')
dir.create(path.misc,recursive = TRUE,showWarnings = FALSE)
# Gene-level stats
path.fdr <-
list.files('../output/simulation/summary','fdr.gene.tsv.gz',recursive = TRUE,full.names = TRUE)
path.metrics <-
list.files('../output/simulation/summary','metrics.gene.tsv.gz',recursive = TRUE,full.names = TRUE)
path.quantile <-
list.files('../output/simulation/summary','quantile.gene.tsv.gz',recursive = TRUE,full.names = TRUE)
path.pvalue <-
list.files('../output/simulation/summary','pvalue.gene.tsv.gz',recursive = TRUE,full.names = TRUE)
path.roc <-
list.files('../output/simulation/summary','roc.gene.tsv.gz',recursive = TRUE,full.names = TRUE)
# Transcript-level stats
path.fdr.tx <-
list.files('../output/simulation/summary','fdr.transcript.tsv.gz',recursive = TRUE,full.names = TRUE)
path.metrics.tx <-
list.files('../output/simulation/summary','metrics.transcript.tsv.gz',recursive = TRUE,full.names = TRUE)
path.quantile.tx <-
list.files('../output/simulation/summary','quantile.transcript.tsv.gz',recursive = TRUE,full.names = TRUE)
path.pvalue.tx <-
list.files('../output/simulation/summary','pvalue.transcript.tsv.gz',recursive = TRUE,full.names = TRUE)
path.roc.tx <-
list.files('../output/simulation/summary','roc.transcript.tsv.gz',recursive = TRUE,full.names = TRUE)
# Time stats
path.time <-
list.files('../output/simulation/summary','^time.tsv.gz',recursive = TRUE,full.names = TRUE)
bs <- 8
cnames <- c('Genome','Length','FC','Reads','Scenario','LibsPerGroup','Quantifier','Method','Feature')
relabel <- function(x,feature = NULL){
y <- copy(x)
if(!is.null(feature)) y$Feature <- feature
y$LibsPerGroup %<>% factor(levels = paste0(c(3, 5, 10), 'libsPerGroup'),labels = paste0(c(3,5,10),' samples per group')) %<>% droplevels()
y$Length %<>% factor(levels = paste0('readlen-', seq(50, 150, 25)),labels = paste0(seq(50, 150, 25), 'bp')) %<>% droplevels()
y$Scenario %<>% factor(levels = c('balanced','unbalanced'),labels = c('Equal library sizes','Unequal library sizes'))
if (!is.null(x$Sample)) {
browser()
y$Sample %<>% factor(levels = c(paste0("groupA_rep",1:10,"_R1"),paste0("groupB_rep",1:10,"_R1")),labels = c(paste0("A",1:10),paste0("B",1:10))) %<>% droplevels()
}
return(y)
}
# Loading datasets
dt.fdr <- do.call(rbind,lapply(path.fdr,fread)) %>% relabel(feature = 'Gene')
dt.metrics <- do.call(rbind,lapply(path.metrics,fread)) %>% relabel(feature = 'Gene')
dt.quantile <- do.call(rbind,lapply(path.quantile,fread)) %>% relabel(feature = 'Gene')
dt.pvalue <- do.call(rbind,lapply(path.pvalue,fread)) %>% relabel(feature = 'Gene')
dt.roc <- do.call(rbind,lapply(path.roc,fread)) %>% relabel(feature = 'Gene')
dt.fdr.tx <- do.call(rbind,lapply(path.fdr.tx,fread)) %>% relabel(feature = 'Transcript')
dt.metrics.tx <- do.call(rbind,lapply(path.metrics.tx,fread)) %>% relabel(feature = 'Transcript')
dt.quantile.tx <- do.call(rbind,lapply(path.quantile.tx,fread)) %>% relabel(feature = 'Transcript')
dt.pvalue.tx <- do.call(rbind,lapply(path.pvalue.tx,fread)) %>% relabel(feature = 'Transcript')
dt.roc.tx <- do.call(rbind,lapply(path.roc.tx,fread)) %>% relabel(feature = 'Transcript')
dt.time <- do.call(rbind,lapply(path.time,fread)) %>% relabel()
meth <- c('edgeR-scaled-F',
'edgeR-scaled-Simes',
'limma-scaled-F',
'limma-scaled-Simes',
'DEXSeq-raw',
'satuRn-raw',
'DRIMSeq-raw')
meth.lab <- c('edgeR',
'edgeR-Simes',
'limma',
'limma-Simes',
'DEXSeq',
'satuRn',
'DRIMSeq')
dt.power <- rbind(dt.metrics[FC == 'fc2' & Method %in% meth,],
dt.metrics.tx[FC == 'fc2' & Method %in% meth,],
fill = TRUE)
dt.power$Method %<>% mapvalues(from = meth,to = meth.lab)
dt.power[, FDR := roundPretty(ifelse((FP+TP) == 0,0,100*FP/(FP+TP)),1)]
x.melt <- melt(dt.power,
id.vars = cnames,
measure.vars = c('TP','FP'),
variable.name = 'Type',
value.name = 'Value')
x.melt$Type <-
factor(x.melt$Type,
levels = c('FP','TP'),
labels = c('False','True'))
plot.power <- function(df.bar,df.txt,library,scenario,feature,legend = FALSE, base_size = bs,maxy = 4000,...){
tb.bar <- df.bar[LibsPerGroup == library & Scenario == scenario & Feature == feature,]
tb.txt <- df.txt[LibsPerGroup == library & Scenario == scenario & Feature == feature,][FDR != 'NA',]
gap <- 0.05*max(dt.power$TP + dt.power$FP)
ggplot(tb.bar,aes(x = Method,y = Value,fill = Type)) +
geom_col() +
geom_text(aes(x = Method,y = (TP + FP) + gap,label = FDR),
vjust = 0,data = tb.txt,size = base_size/.pt,inherit.aes = FALSE) +
scale_fill_manual(values = c('salmon','lightblue')) +
labs(x = NULL,...) +
coord_cartesian(ylim = c(0,maxy)) +
theme_bw(base_size = base_size,base_family = 'sans') +
theme(panel.grid = element_blank(),
axis.text.x = element_text(angle = 90,hjust = 1, vjust = 0.5),
axis.line = element_line(colour = 'black'),
axis.text = element_text(colour = 'black',size = base_size),
axis.title = element_text(colour = 'black',size = base_size)) +
if (legend == TRUE) theme(legend.background = element_rect(fill = alpha('white', 0)),
legend.text = element_text(size = base_size),
legend.position = c(0.85,0.85),
legend.direction = 'vertical',
legend.title = element_blank(),
legend.key.size = unit(0.75,"line")) else theme(legend.position = 'none')
}
fig.power.a <- plot.power(df.bar = x.melt,df.txt = dt.power,
library = '3 samples per group',
scenario = 'Unequal library sizes',
feature = 'Gene',
y = 'Genes with FDR < 0.05')
fig.power.b <- plot.power(df.bar = x.melt,df.txt = dt.power,
library = '5 samples per group',
scenario = 'Unequal library sizes',
feature = 'Gene',
y = 'Genes with FDR < 0.05')
fig.power.c <- plot.power(df.bar = x.melt,df.txt = dt.power,
library = '10 samples per group',
scenario = 'Unequal library sizes',
feature = 'Gene',
y = 'Genes with FDR < 0.05')
fig.power.tx.d <- plot.power(df.bar = x.melt,df.txt = dt.power,
library = '3 samples per group',
scenario = 'Unequal library sizes',
feature = 'Transcript',
y = 'Transcripts with FDR < 0.05',maxy = 9000)
fig.power.tx.e <- plot.power(df.bar = x.melt,df.txt = dt.power,
library = '5 samples per group',
scenario = 'Unequal library sizes',
feature = 'Transcript',
y = 'Transcripts with FDR < 0.05',maxy = 9000)
fig.power.tx.f <- plot.power(df.bar = x.melt,df.txt = dt.power,
library = '10 samples per group',
scenario = 'Unequal library sizes',
feature = 'Transcript',
y = 'Transcripts with FDR < 0.05',maxy = 9000)
fig.power <- wrap_plots(A = fig.power.a,
B = fig.power.b,
C = fig.power.c,
D = fig.power.tx.d,
E = fig.power.tx.e,
`F` = fig.power.tx.f,
design = c(area(1,1),area(1,2),area(1,3),
area(2,1),area(2,2),area(2,3))) +
plot_annotation(tag_levels = 'a')
fig.power

dt.fdr.plot <- rbind(dt.fdr[FC == 'fc2' & Method %in% meth,],
dt.fdr.tx[FC == 'fc2' & Method %in% meth,])
dt.fdr.plot$Method %<>% mapvalues(from = meth,to = meth.lab)
dt.fdr.plot$Method %<>% factor(levels = meth.lab[c(5,6,7,1,2,3,4)])
colmeth <- c('orange','darkorange','blue','darkblue','red','green3','black')
names(colmeth) <- meth.lab
colmeth <- colmeth[order(names(colmeth))]
plot.fdr <- function(df.line,scenario,library,legend = FALSE,base_size = bs,
color = colmeth,feature,ymax = NULL,xmax = NULL,x,y){
tb.bar <- df.line[Scenario == scenario & LibsPerGroup == library & Feature == feature,]
p <- ggplot(tb.bar,aes(x = N,y = FDR,color = Method)) +
geom_line(linewidth = 0.5) +
scale_color_manual(values = colmeth,
breaks = names(colmeth)) +
theme_bw(base_size = base_size,base_family = 'sans') +
theme(panel.grid = element_blank(),
axis.line = element_line(colour = 'black'),
axis.text = element_text(colour = 'black',size = base_size),
axis.title = element_text(colour = 'black',size = base_size)) +
if (legend == TRUE) theme(legend.background = element_rect(fill = alpha('white', 0)),
legend.direction = 'vertical',
legend.box = 'horizontal',
legend.position = "inside",
legend.position.inside = c(0.35,0.7),
legend.text = element_text(size = base_size),
legend.title = element_blank(),
legend.key.size = unit(0.75,"line")) else theme(legend.position = 'none')
if(feature == 'Gene') p <- p + coord_cartesian(ylim = c(0,ymax),xlim = c(0,xmax))
p + labs(x = x,y = y)
}
fig.fdr.a <- plot.fdr(df.line = dt.fdr.plot,
scenario = 'Unequal library sizes',
library = '3 samples per group',
feature = 'Gene',
ymax = 1000,
xmax = 2500,
y = 'False discoveries',
x = 'Genes chosen')
fig.fdr.b <- plot.fdr(df.line = dt.fdr.plot,
scenario = 'Unequal library sizes',
library = '5 samples per group',
feature = 'Gene',
ymax = 400,
xmax = 2500,
y = 'False discoveries',
x = 'Genes chosen')
fig.fdr.c <- plot.fdr(df.line = dt.fdr.plot,
scenario = 'Unequal library sizes',
library = '10 samples per group',
feature = 'Gene',
ymax = 200,
xmax = 2500,
y = 'False discoveries',
x = 'Genes chosen',
legend = TRUE)
fig.fdr.tx.un.d <- plot.fdr(df.line = dt.fdr.plot,
scenario = 'Unequal library sizes',
library = '3 samples per group',
feature = 'Transcript',
y = 'False discoveries',
x = 'Transcripts chosen')
fig.fdr.tx.un.e <- plot.fdr(df.line = dt.fdr.plot,
scenario = 'Unequal library sizes',
library = '5 samples per group',
feature = 'Transcript',
y = 'False discoveries',
x = 'Transcripts chosen')
fig.fdr.tx.un.f <- plot.fdr(df.line = dt.fdr.plot,
scenario = 'Unequal library sizes',
library = '10 samples per group',
feature = 'Transcript',
y = 'False discoveries',
x = 'Transcripts chosen')
fig.fdr <- wrap_plots(A = fig.fdr.a,
B = fig.fdr.b,
C = fig.fdr.c,
D = fig.fdr.tx.un.d,
E = fig.fdr.tx.un.e,
`F` = fig.fdr.tx.un.f,
design = c(area(1,1),area(1,2),area(1,3),
area(2,1),area(2,2),area(2,3))) +
plot_annotation(tag_levels = 'a')
fig.fdr

# Only edgeR, limma, and DRIMSeq output gene-level raw p-values
meth.null <- c("edgeR-scaled-F","edgeR-scaled-Simes","limma-scaled-F","limma-scaled-Simes","DRIMSeq-raw")
dt.p <-
rbind(dt.pvalue[FC == 'fc1' & Method %in% meth.null,],
dt.pvalue.tx[FC == 'fc1' & Method %in% meth,])
dt.p$Method %<>% mapvalues(from = meth,to = meth.lab)
dt.p$Method %<>% factor(levels = names(colmeth))
plot.phist <- function(df.line,scenario,library,feature,
base_size = bs,...){
tb.bar <- df.line[Scenario == scenario & LibsPerGroup == library & Feature == feature,]
plot <- ggplot(data = tb.bar,aes(x = PValue,y = Density.Avg)) +
facet_grid(cols = vars(Method)) +
geom_col(col = 'black',fill = 'grey',linewidth = 0) +
geom_hline(yintercept = 1,col = 'red',linetype = 'dashed') +
theme_bw(base_size = base_size,base_family = 'sans') +
scale_x_discrete(breaks = c("(0.00-0.05]","(0.50-0.55]","(0.95-1.00]"),
labels = c(0.00,0.50,1.00)) +
theme(strip.text.x = element_text(colour = 'black',size = base_size),
strip.background.x = element_blank(),
panel.grid = element_blank(),
axis.line = element_line(colour = 'black'),
axis.text = element_text(colour = 'black',size = base_size),
axis.title = element_text(colour = 'black',size = base_size)) +
labs(x = 'P-values',y = 'Density')
return(plot)
}
fig.phist <- plot.phist(df.line = dt.p,
scenario = 'Unequal library sizes',
library = '5 samples per group',
feature = 'Gene')
fig.tx.phist <- plot.phist(df.line = dt.p,
scenario = 'Unequal library sizes',
library = '5 samples per group',
feature = 'Transcript')
fig.phist.panel <- wrap_plots(A = fig.phist,
B = fig.tx.phist,
design = c(area(1,1),area(2,1))) +
plot_annotation(tag_levels = 'a')
fig.phist.panel

dt.time.plot <- dt.time[FC == 'fc2' & Method %in% meth,]
dt.time.plot$Method %<>% mapvalues(from = meth,to = meth.lab)
dt.time.plot$Method %<>% factor(levels = names(colmeth))
plot.time <- function(df.line,scenario,library,feature,
base_size = bs,y.max = 12.6,...){
tb.bar <- df.line[Scenario == scenario & LibsPerGroup == library,]
plot <- ggplot(data = tb.bar,aes(x = Method,y = Time)) +
geom_bar(stat = 'identity',position = position_dodge(),
fill = 'lightblue',color = NA) +
theme_bw(base_size = base_size,base_family = 'sans') +
scale_y_continuous(limits = c(0,y.max)) +
theme(panel.grid = element_blank(),
axis.text.x = element_text(angle = 90),
axis.text = element_text(colour = 'black',size = base_size),
axis.title = element_text(colour = 'black',size = base_size)) +
labs(y = 'Time (min)',x = NULL)
return(plot)
}
fig.time.a <- plot.time(df.line = dt.time.plot,
scenario = 'Unequal library sizes',
library = '3 samples per group')
fig.time.b <- plot.time(df.line = dt.time.plot,
scenario = 'Unequal library sizes',
library = '5 samples per group')
fig.time.c <- plot.time(df.line = dt.time.plot,
scenario = 'Unequal library sizes',
library = '10 samples per group')
fig.time <- wrap_plots(A = fig.time.a,
B = fig.time.b,
C = fig.time.c,
design = c(area(1,1),area(1,2),area(1,3))) +
plot_annotation(tag_levels = 'a')
fig.time

ggsave(plot = fig.power,filename = file.path(path.misc,'Figure-Power.pdf'),
device = 'pdf',width = 7.5,height = 5,units = 'in')
ggsave(plot = fig.fdr,filename = file.path(path.misc,'Figure-FDR.pdf'),
device = 'pdf',width = 7.5,height = 5,units = 'in')
ggsave(plot = fig.phist.panel,filename = file.path(path.misc,'Figure-Pval.pdf'),
device = 'pdf',width = 7.5,height = 5,units = 'in')
ggsave(plot = fig.time,filename = file.path(path.misc,'Figure-Time.pdf'),
device = 'pdf',width = 7.5,height = 2.5,units = 'in')
sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Red Hat Enterprise Linux 9.3 (Plow)
Matrix products: default
BLAS: /stornext/System/data/software/rhel/9/base/tools/R/4.4.1/lib64/R/lib/libRblas.so
LAPACK: /stornext/System/data/software/rhel/9/base/tools/R/4.4.1/lib64/R/lib/libRlapack.so; LAPACK version 3.12.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Australia/Melbourne
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] pkg_1.0 kableExtra_1.4.0 plyr_1.8.9 patchwork_1.3.0
[5] ggplot2_3.5.1 magrittr_2.0.3 data.table_1.17.0 workflowr_1.7.1
loaded via a namespace (and not attached):
[1] splines_4.4.1 later_1.4.1
[3] BiocIO_1.14.0 bitops_1.0-9
[5] filelock_1.0.3 R.oo_1.27.0
[7] tibble_3.2.1 XML_3.99-0.18
[9] lifecycle_1.0.4 httr2_1.1.0
[11] edgeR_4.5.9 rprojroot_2.0.4
[13] processx_3.8.6 lattice_0.22-6
[15] ensembldb_2.28.1 limma_3.63.9
[17] sass_0.4.9 rmarkdown_2.29
[19] jquerylib_0.1.4 yaml_2.3.10
[21] remotes_2.5.0 httpuv_1.6.15
[23] sessioninfo_1.2.3 pkgbuild_1.4.6
[25] pbapply_1.7-2 RColorBrewer_1.1-3
[27] DBI_1.2.3 abind_1.4-8
[29] pkgload_1.4.0 zlibbioc_1.50.0
[31] GenomicRanges_1.56.2 R.utils_2.13.0
[33] purrr_1.0.4 AnnotationFilter_1.28.0
[35] BiocGenerics_0.50.0 RCurl_1.98-1.16
[37] rappdirs_0.3.3 git2r_0.35.0
[39] GenomeInfoDbData_1.2.12 DEXSeq_1.50.0
[41] wasabi_1.0.1 IRanges_2.38.1
[43] S4Vectors_0.42.1 genefilter_1.86.0
[45] fishpond_2.10.0 annotate_1.82.0
[47] svglite_2.1.3 codetools_0.2-20
[49] DelayedArray_0.30.1 xml2_1.3.7
[51] tidyselect_1.2.1 locfdr_1.1-8
[53] UCSC.utils_1.0.0 farver_2.1.2
[55] satuRn_1.12.0 matrixStats_1.5.0
[57] stats4_4.4.1 BiocFileCache_2.12.0
[59] GenomicAlignments_1.40.0 jsonlite_1.9.1
[61] ellipsis_0.3.2 survival_3.6-4
[63] systemfonts_1.2.1 tools_4.4.1
[65] progress_1.2.3 ragg_1.3.3
[67] Rcpp_1.0.14 glue_1.8.0
[69] svMisc_1.4.3 SparseArray_1.4.8
[71] DESeq2_1.44.0 xfun_0.51
[73] MatrixGenerics_1.16.0 usethis_3.1.0
[75] GenomeInfoDb_1.40.1 dplyr_1.1.4
[77] withr_3.0.2 BiocManager_1.30.25
[79] fastmap_1.2.0 boot_1.3-30
[81] rhdf5filters_1.16.0 callr_3.7.6
[83] digest_0.6.37 R6_2.6.1
[85] mime_0.12 textshaping_1.0.0
[87] colorspace_2.1-1 gtools_3.9.5
[89] biomaRt_2.60.1 RSQLite_2.3.9
[91] R.methodsS3_1.8.2 generics_0.1.3
[93] renv_1.1.2 tximeta_1.22.1
[95] rtracklayer_1.64.0 prettyunits_1.2.0
[97] httr_1.4.7 htmlwidgets_1.6.4
[99] S4Arrays_1.4.1 whisker_0.4.1
[101] pkgconfig_2.0.3 gtable_0.3.6
[103] blob_1.2.4 hwriter_1.3.2.1
[105] SingleCellExperiment_1.26.0 XVector_0.44.0
[107] htmltools_0.5.8.1 geneplotter_1.82.0
[109] profvis_0.4.0 ProtGenerics_1.36.0
[111] sleuth_0.30.1 scales_1.3.0
[113] Biobase_2.64.0 Rsubread_2.18.0
[115] png_0.1-8 knitr_1.49
[117] rstudioapi_0.17.1 reshape2_1.4.4
[119] tzdb_0.4.0 rjson_0.2.23
[121] curl_6.2.1 cachem_1.1.0
[123] rhdf5_2.48.0 stringr_1.5.1
[125] BiocVersion_3.19.1 parallel_4.4.1
[127] miniUI_0.1.1.1 AnnotationDbi_1.66.0
[129] restfulr_0.0.15 desc_1.4.3
[131] pillar_1.10.1 grid_4.4.1
[133] vctrs_0.6.5 urlchecker_1.0.1
[135] promises_1.3.2 dbplyr_2.5.0
[137] xtable_1.8-4 tximport_1.32.0
[139] evaluate_1.0.3 readr_2.1.5
[141] GenomicFeatures_1.56.0 locfit_1.5-9.12
[143] cli_3.6.4 compiler_4.4.1
[145] Rsamtools_2.20.0 rlang_1.1.5
[147] crayon_1.5.3 labeling_0.4.3
[149] ps_1.9.0 getPass_0.2-4
[151] fs_1.6.5 stringi_1.8.4
[153] viridisLite_0.4.2 BiocParallel_1.38.0
[155] txdbmaker_1.0.1 munsell_0.5.1
[157] Biostrings_2.72.1 lazyeval_0.2.2
[159] devtools_2.4.5 Matrix_1.7-0
[161] hms_1.1.3 bit64_4.6.0-1
[163] Rhdf5lib_1.26.0 KEGGREST_1.44.1
[165] statmod_1.5.0 shiny_1.10.0
[167] DRIMSeq_1.32.0 SummarizedExperiment_1.34.0
[169] AnnotationHub_3.12.0 memoise_2.0.1
[171] thematic_0.1.6 bslib_0.9.0
[173] bit_4.6.0