Skip to content

Commit e3f700b

Browse files
committed
add: vignettes text
1 parent 6ea46be commit e3f700b

4 files changed

Lines changed: 241 additions & 11 deletions

File tree

‎DESCRIPTION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Suggests:
4848
devtools,
4949
RefManageR,
5050
sessioninfo
51-
biocViews: RNASeq, DifferentialExpression, GeneExpression,Sequencing, Software
51+
biocViews: RNASeq, DifferentialExpression, GeneExpression, Sequencing, Software
5252
Config/testthat/edition: 3
5353
VignetteBuilder: knitr
5454
URL: https://costasilvati.github.io/consexpressionR/

‎R/app.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ consexpressionR <- function() {
5757
),
5858
),
5959
shiny::p(shiny::helpText(
60-
"Note: This tool expect the same number of replics in each group of treatment."
60+
"Note: Use the same number of replic for each treatment."
6161
)),
6262
),
6363
shiny::fluidRow(

‎vignettes/consexpressionR.Rmd‎

Lines changed: 195 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Introduction to cosexpressionR"
2+
title: "Introduction to consexpressionR"
33
author:
44
- name: Juliana Costa-Silva
55
affiliation:
@@ -15,7 +15,7 @@ output:
1515
date: "`r doc_date()`"
1616
package: "`r pkg_ver('consexpressionR')`"
1717
vignette: >
18-
%\VignetteIndexEntry{Introduction to cosexpressionR}
18+
%\VignetteIndexEntry{Introduction to consexpressionR}
1919
%\VignetteEngine{knitr::rmarkdown}
2020
%\VignetteEncoding{UTF-8}
2121
---
@@ -30,10 +30,10 @@ knitr::opts_chunk$set(
3030

3131

3232
```{r vignetteSetup, echo=FALSE, message=FALSE, warning = FALSE}
33-
## Bib setup
3433
library("RefManageR")
3534
36-
## Write bibliography information
35+
bibArticles <- ReadBib("consexpressionR.bib")
36+
3737
bib <- c(
3838
R = citation(),
3939
BiocStyle = citation("BiocStyle")[1],
@@ -42,15 +42,61 @@ bib <- c(
4242
rmarkdown = citation("rmarkdown")[1],
4343
sessioninfo = citation("sessioninfo")[1],
4444
testthat = citation("testthat")[1],
45+
DESeq2 = citation("DESeq2")[1],
46+
edgeR = citation("edgeR")[1],
47+
limma = citation("limma")[1],
48+
EBSeq = citation("EBSeq")[1],
49+
NOISeq = citation("NOISeq")[1],
50+
baySeq = citation("baySeq")[1],
4551
consexpressionR = citation("consexpressionR")[1]
4652
)
53+
54+
bib <- merge(bib, bibArticles)
4755
```
4856

4957
# Basics
5058

59+
## Background
60+
61+
High-throughput RNA sequencing (RNA-seq) is the standard approach for
62+
quantifying gene expression and identifying genes that are differentially
63+
expressed (DE) between experimental conditions. A large number of methods
64+
have been proposed for this task -- including `r Biocpkg("DESeq2")`,
65+
`r Biocpkg("edgeR")`, `r Biocpkg("limma")`, `r Biocpkg("EBSeq")`,
66+
`r Biocpkg("NOISeq")`, `r Biocpkg("baySeq")`, and `r Biocpkg("KnowSeq")`
67+
-- each based on different statistical assumptions (e.g., negative binomial
68+
generalized linear models, empirical Bayes shrinkage, non-parametric
69+
testing). Because no single method is universally superior across all
70+
experimental designs and noise conditions, the choice of DE method can
71+
materially change the list of genes reported as differentially expressed.
72+
73+
`r Biocpkg("consexpressionR")` addresses this problem by running multiple
74+
independent DE methods on the same count matrix and reporting a
75+
**consensus** list: genes called as differentially expressed by a
76+
user-defined minimum number of methods. The rationale is that genes
77+
detected by several methodologically independent approaches are less
78+
likely to be false positives driven by the assumptions of any single
79+
method.
80+
81+
This consensus strategy was validated against qPCR-confirmed
82+
differentially expressed genes using public datasets (A: available in the Short
83+
Read Archive (SRA) can be accessed using the code SRA010153 and B: available in
84+
the Gene Expression Omnibus (GEO) repositorycan accessed using the code
85+
GSE95077). Results are previouslly reported in
86+
`r Citep(bib[["Costa-Silva2017"]])` and reviewed in
87+
`r Citep(bib[["costasilva2025consensus"]])`, showing improved precision compared
88+
to individual methods.
89+
5190
## Install `consexpressionR`
5291

53-
`R` is an open-source statistical environment which can be easily modified to enhance its functionality via packages. `r Biocpkg("consexpressionR")` is a `R` package available via the [Bioconductor](http://bioconductor.org) repository for packages. `R` can be installed on any operating system from [CRAN](https://cran.r-project.org/) after which you can install `r Biocpkg("consexpressionR")` by using the following commands in your `R` session:
92+
`R` is an open-source statistical environment which can be easily modified to
93+
enhance its functionality via packages. `r Biocpkg("consexpressionR")` is a `R`
94+
package available via the [Bioconductor](http://bioconductor.org) repository
95+
for packages. `R` can be installed on any operating system from
96+
[CRAN](https://cran.r-project.org/) after which you can install
97+
`r Biocpkg("consexpressionR")` by using the following commands in your `R`
98+
99+
session:
54100

55101
```{r "install", eval = FALSE}
56102
if (!requireNamespace("BiocManager", quietly = TRUE)) {
@@ -65,7 +111,26 @@ BiocManager::valid()
65111

66112
## Required knowledge
67113

68-
`r Biocpkg("consexpressionR")` is based on many other packages and in particular in those that have implemented the infrastructure needed for dealing with RNA-seq data (EDIT!). That is, packages like `r Biocpkg("SummarizedExperiment")` (EDIT!).
114+
`r Biocpkg("consexpressionR")` is built on top of several Bioconductor and
115+
CRAN packages that implement individual differential expression methods:
116+
`r Biocpkg("DESeq2")`, `r Biocpkg("edgeR")`, `r Biocpkg("limma")`,
117+
`r Biocpkg("EBSeq")`, `r Biocpkg("NOISeq")`, and `r Biocpkg("baySeq")` are
118+
required; `r Biocpkg("KnowSeq")` is optional (see
119+
[Optional dependencies](#optional-dependencies) below). Users are
120+
expected to be familiar with the basic structure of a gene-level raw
121+
count matrix (genes as rows, samples as columns) as produced by aligners
122+
such as STAR/HTSeq or pseudo-aligners such as Salmon/kallisto followed by
123+
`r Biocpkg("tximport")`.
124+
125+
126+
127+
<!--
128+
EDIT: confirm whether your package accepts a plain matrix only, or also
129+
a SummarizedExperiment / DESeqDataSet as input. If SummarizedExperiment
130+
is supported (or planned), mention it here and add it as an Import in
131+
DESCRIPTION -- Bioconductor reviewers will likely request this, since it
132+
is the standard container for count data across the project.
133+
-->
69134

70135
If you are asking yourself the question "Where do I start using Bioconductor?" you might be interested in [this blog post](http://lcolladotor.github.io/2014/10/16/startbioc/#.VkOKbq6rRuU).
71136

@@ -88,13 +153,128 @@ citation("consexpressionR")
88153
library("consexpressionR")
89154
```
90155

91-
Edit this as you see fit =)
156+
## Example dataset
157+
158+
Rather than shipping a static dataset inside the package, this vignette
159+
generates a small synthetic count matrix on the fly using a negative
160+
binomial model -- the same distributional assumption used by most
161+
RNA-seq DE methods. This keeps the package lightweight, keeps the
162+
vignette build fast on the Bioconductor build servers, and lets you
163+
freely change the simulation parameters (number of genes, samples, and
164+
effect size) to explore how the consensus behaves under different
165+
conditions.
166+
167+
```{r "simulate_data"}
168+
set.seed(42)
169+
170+
n_genes <- 200
171+
n_samples_per_group <- 4
172+
prop_de <- 0.10 # proportion of genes that are truly differentially expressed
173+
174+
n_de <- floor(n_genes * prop_de)
175+
176+
## Baseline mean expression per gene (negative binomial mean)
177+
baseline_mu <- rgamma(n_genes, shape = 2, scale = 200)
178+
179+
## Group 2 has a fold-change applied to the first n_de genes
180+
fold_change <- c(rep(4, n_de), rep(1, n_genes - n_de))
181+
mu_group1 <- baseline_mu
182+
mu_group2 <- baseline_mu * fold_change
183+
184+
counts_group1 <- sapply(seq_len(n_samples_per_group), function(i) {
185+
rnbinom(n_genes, mu = mu_group1, size = 4)
186+
})
187+
counts_group2 <- sapply(seq_len(n_samples_per_group), function(i) {
188+
rnbinom(n_genes, mu = mu_group2, size = 4)
189+
})
190+
191+
counts <- cbind(counts_group1, counts_group2)
192+
rownames(counts) <- paste0("gene", seq_len(n_genes))
193+
colnames(counts) <- c(
194+
paste0("control_", seq_len(n_samples_per_group)),
195+
paste0("treated_", seq_len(n_samples_per_group))
196+
)
197+
198+
sample_info <- c(
199+
rep("control", n_samples_per_group),
200+
rep("treated", n_samples_per_group)
201+
)
92202
93-
Here is an example of you can cite your package inside the vignette:
203+
head(counts)
204+
```
205+
206+
<!--
207+
EDIT: if you would like a fully reproducible "realistic" simulation
208+
instead of this minimal rnbinom() approach, consider using
209+
`r Biocpkg("compcodeR")` or the Polyester package, both of which simulate
210+
RNA-seq count matrices with known ground-truth DE genes and are commonly
211+
used in DE method benchmarking papers. That would also let you show, in
212+
this same vignette, a precision/recall comparison between the consensus
213+
and each individual method -- valuable supporting evidence for reviewers.
214+
-->
215+
216+
## Running individual methods
217+
218+
EDIT: Add 1-2 short examples here calling your individual wrapper
219+
functions directly (e.g., `runDESeq2()`, `runEdgeR()`, `runBaySeq()`),
220+
showing the structure of their output (a `data.frame` with a `DE_<method>`
221+
logical column, as discussed for `runBaySeq()`). For example:
222+
223+
```{r "run_single_method", eval = FALSE}
224+
de_deseq2 <- runDESeq2(counts, sampleInfo = sample_info)
225+
head(de_deseq2)
226+
```
227+
228+
## Running the consensus analysis
229+
230+
EDIT: This is the central example of the vignette and currently missing.
231+
Add the actual call to your main consensus function (its real name --
232+
possibly `consexpression()` or similar -- needs to replace the
233+
placeholder below), explaining the `nMethods` / vote-threshold parameter
234+
clearly, since that is the core contribution of the package:
235+
236+
```{r "run_consensus", eval = FALSE}
237+
result <- consexpression(
238+
data = counts,
239+
sampleInfo = sample_info,
240+
minMethods = 5 # gene must be called DE by at least 5 of 7 methods
241+
)
242+
243+
head(result)
244+
```
245+
246+
EDIT: Show and explain a sample of the *output* table here (which columns
247+
it has -- gene ID, number of methods that agreed, which methods agreed,
248+
consensus logFC, etc.), since that is what most users will want to
249+
parse programmatically afterward.
250+
251+
## Optional dependencies
252+
253+
`r Biocpkg("KnowSeq")` is listed under `Suggests` rather than `Imports`
254+
because of its heavier dependency footprint. If it is not installed,
255+
the corresponding method is skipped with a warning rather than causing
256+
an error, and the consensus is computed using the remaining methods.
257+
258+
```{r "knowseq_check", eval = FALSE}
259+
if (!requireNamespace("KnowSeq", quietly = TRUE)) {
260+
message("KnowSeq is not installed; it will be skipped in the consensus.")
261+
}
262+
```
94263

95-
* `r Biocpkg("consexpressionR")` `r Citep(bib[["consexpressionR"]])`
264+
EDIT: clarify here whether "5 out of 7" stays "5 out of 6" automatically
265+
when KnowSeq is unavailable, or whether the threshold is fixed regardless
266+
of how many methods actually ran. This is an important behavioral detail
267+
for users and reviewers will likely ask about it directly.
96268

269+
## Interpreting the results
97270

271+
EDIT: Add a short paragraph + (optionally) a plot here. A simple option
272+
that fits naturally into a Bioconductor vignette is an UpSet plot (via
273+
the `r CRANpkg("UpSetR")` package, already in your Suggests) showing the
274+
overlap of DE calls across the 7 methods for this example dataset. That
275+
gives readers an immediate visual sense of *why* consensus filtering
276+
matters, and doubles as a non-trivial example of using your package's
277+
multi-method output.
98278

99279
# Reproducibility
100280

@@ -107,6 +287,12 @@ The `r Biocpkg("consexpressionR")` package `r Citep(bib[["consexpressionR"]])` w
107287
* `r CRANpkg("rmarkdown")` `r Citep(bib[["rmarkdown"]])`
108288
* `r CRANpkg("sessioninfo")` `r Citep(bib[["sessioninfo"]])`
109289
* `r CRANpkg("testthat")` `r Citep(bib[["testthat"]])`
290+
* `r Biocpkg("DESeq2")` `r Citep(bib[["DESeq2"]])`
291+
* `r Biocpkg("edgeR")` `r Citep(bib[["edgeR"]])`
292+
* `r Biocpkg("limma")` `r Citep(bib[["limma"]])`
293+
* `r Biocpkg("EBSeq")` `r Citep(bib[["EBSeq"]])`
294+
* `r Biocpkg("NOISeq")` `r Citep(bib[["NOISeq"]])`
295+
* `r Biocpkg("baySeq")` `r Citep(bib[["baySeq"]])`
110296

111297
This package was developed using `r BiocStyle::Biocpkg("biocthis")`.
112298

‎vignettes/consexpressionR.bib‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@article{costasilva2025consensus,
2+
title = {consexpressionR: a consensus approach for differential expression analysis in bulk RNA-Seq},
3+
author = {Costa-Silva, Juliana and others},
4+
journal = {bioRxiv},
5+
year = {2025},
6+
doi = {10.48550/arXiv.2503.21546}
7+
}
8+
9+
@article{hardcastle2010bayseq,
10+
title = {baySeq: empirical Bayesian methods for identifying differential expression in sequence count data},
11+
author = {Hardcastle, Thomas J and Kelly, Krystyna A},
12+
journal = {BMC Bioinformatics},
13+
volume = {11},
14+
pages = {422},
15+
year = {2010},
16+
doi = {10.1186/1471-2105-11-422}
17+
}
18+
19+
@article{love2014deseq2,
20+
title = {Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2},
21+
author = {Love, Michael I and Huber, Wolfgang and Anders, Simon},
22+
journal = {Genome Biology},
23+
volume = {15},
24+
pages = {550},
25+
year = {2014},
26+
doi = {10.1186/s13059-014-0550-8}
27+
}
28+
29+
@article{Costa-Silva2017,
30+
abstract = {The correct identification of differentially expressed genes (DEGs) between specific conditions is a key in the understanding phenotypic variation. High-throughput transcriptome sequencing (RNA-Seq) has become the main option for these studies. Thus, the number of methods and softwares for differential expression analysis from RNA-Seq data also increased rapidly. However, there is no consensus about the most appropriate pipeline or protocol for identifying differentially expressed genes from RNA-Seq data. This work presents an extended review on the topic that includes the evaluation of six methods of mapping reads, including pseudo-alignment and quasi-mapping and nine methods of differential expression analysis from RNA-Seq data. The adopted methods were evaluated based on real RNA-Seq data, using qRT-PCR data as reference (gold-standard). As part of the results, we developed a software that performs all the analysis presented in this work, which is freely available at https://github.com/costasilvati/consexpression. The results indicated that mapping methods have minimal impact on the final DEGs analysis, considering that adopted data have an annotated reference genome. Regarding the adopted experimental model, the DEGs identification methods that have more consistent results were the limma +voom, NOIseq and DESeq2. Additionally, the consensus among five DEGs identification methods guarantees a list of DEGs with great accuracy, indicating that the combination of different methods can produce more suitable results. The consensus option is also included for use in the available software.},
31+
author = {Juliana Costa-Silva and Douglas Domingues and Fabricio Martins Lopes},
32+
doi = {10.1371/journal.pone.0190152},
33+
editor = {Zhi Wei},
34+
issn = {1932-6203},
35+
issue = {12},
36+
journal = {PLOS ONE},
37+
month = {12},
38+
pages = {e0190152},
39+
publisher = {Public Library of Science},
40+
title = {RNA-Seq differential expression analysis: An extended review and a software tool},
41+
volume = {12},
42+
url = {https://dx.plos.org/10.1371/journal.pone.0190152},
43+
year = {2017}
44+
}

0 commit comments

Comments
 (0)