You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.Rmd
+48-50Lines changed: 48 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,13 @@ knitr::opts_chunk$set(
26
26
27
27
<!-- badges: end -->
28
28
29
-
**markeR**provides a suite of methods for using gene sets to quantify and evaluate the extent to which a given gene signature marks a specific phenotype from gene expression data. The package implements various scoring, enrichment and classification approaches, along with tools to compute performance metrics and visualize results.
29
+
**`markeR`**is an R package that provides a modular and extensible framework for the systematic evaluation of gene sets as phenotypic markers using transcriptomic data. The package is designed to support both quantitative analyses and visual exploration of gene set behaviour across experimental and clinical phenotypes.
30
30
31
-
> **To cite markeR please use:**
31
+
> **To cite `markeR` please use:**
32
32
>
33
33
> Martins-Silva R, Kaizeler A, Barbosa-Morais N (2025). _markeR: an R Toolkit for Evaluating Gene Sets as Phenotypic Markers_. Gulbenkian Institute for Molecular Medicine, Faculdade de Medicina, Universidade de Lisboa, Lisbon, Portugal. R package version 0.99.4, https://github.com/DiseaseTranscriptomicsLab/markeR.
34
34
35
-
The folder `inst/Paper/` is in the **paper** branch and contains all scripts and materials used in the original markeR paper to reproduce analyses and figures. You can browse it [here](https://github.com/DiseaseTranscriptomicsLab/markeR/tree/paper/inst/Paper).
35
+
The folder `inst/Paper/` is in the **paper** branch and contains all scripts and materials used in the original `markeR` paper to reproduce analyses and figures. You can browse it [here](https://github.com/DiseaseTranscriptomicsLab/markeR/tree/paper/inst/Paper).
36
36
37
37
38
38

@@ -69,7 +69,7 @@ library(markeR)
69
69
```
70
70
71
71
72
-
Or install the latest development release of markeR from [GitHub](https://github.com/) with:
72
+
Or install the latest development release of `markeR` from [GitHub](https://github.com/) with:
73
73
74
74
```r
75
75
# install.packages("devtools")
@@ -91,8 +91,6 @@ This package is officially supported on `R > 4.5.0`. ⚠️ Older versions of `R
91
91
92
92
## Common Workflow
93
93
94
-
`markeR` provides a modular pipeline to quantify transcriptomic signatures and assess their association with phenotypic or clinical variables. The typical workflow includes the following steps:
95
-
96
94
### 1. Input Requirements
97
95
98
96
Depending on the analysis mode, inputs vary slightly.
@@ -129,7 +127,10 @@ gene_sets
129
127
```
130
128
131
129
***Expression Data Frame**:
132
-
A filtered and normalised gene expression data frame (genes × samples). Row names must be gene identifiers, and column names must match the sample IDs in the metadata.
130
+
A filtered and normalised, non log-transformed, gene expression matrix (genes × samples). Row names must be gene identifiers; column names must match sample IDs in the metadata.
131
+
132
+
**Warning:** If you are using microarray data or outputs from common RNA-seq pipelines (*e.g.*, edgeR), note that the expression values may already be log2-normalised. The input to `markeR` must necessarily be **non-log-transformed**. If your data are log2-transformed, you can revert them by applying `2^data`.
A data frame with annotations for each sample, with the sample ID in the first column. The row names must match the column names of the expression matrix.
149
+
A data frame with samples as rows and annotations as columns. The first column should contain sample IDs matching the expression matrix column names.
149
150
150
151
```{r example-metadata, echo=FALSE}
151
152
# Simulate sample metadata
@@ -162,82 +163,79 @@ metadata
162
163
163
164
### 2. Select Mode of Analysis
164
165
165
-
***Discovery Mode**:
166
-
Explore how a single, well-characterised gene set relates to a specific variable of interest. Suitable for hypothesis generation.
166
+
`markeR` provides two modes of operation:
167
167
168
-
***Benchmarking Mode**:
169
-
Evaluate one or more gene sets against multiple metadata variables using a standardised scoring and effect size framework. This mode provides comprehensive visualisations and comparisons across methods.
168
+
***Benchmarking**:
169
+
evaluates gene sets' performance in marking a metadata variable, *i.e.*, a phenotype, returning comparative visualisations across scoring and enrichment methods.
170
+
171
+
***Discovery**:
172
+
examines the relationship between a gene set and one or more variables of interest, suitable for exploratory or hypothesis-generating analyses.
170
173
171
174
### 3. Choose a Quantification Approach
172
175
173
-
`markeR` supports two complementary strategies for quantifying the association between gene sets and phenotypes:
176
+
Two complementary strategies are implemented for quantifying associations between gene sets and phenotypes:
174
177
175
178
#### 3.1 Score-Based Approach
176
179
177
-
This strategy generates a **single numeric score per sample**, reflecting the activity of a gene set. It enables flexible downstream analyses, including comparisons across phenotypic groups.
178
-
179
-
Three scoring methods are available:
180
180
181
-
***Log2-median**: Calculates the median log2 expression of the genes in the set. Sensitive to absolute shifts in expression.
181
+
A score summarising the collective expression of a gene set therein is assigned **to each sample**. Scores can be visualised using built-in functions, or used directly in downstream analyses (*e.g.*, comparisons between phenotypic groups of samples, correlations with numerical phenotypes).
182
182
183
-
***Ranking**: Ranks all genes within each sample and averages the ranks of gene set members. Captures relative ordering rather than magnitude.
183
+
Available methods:
184
184
185
-
***ssGSEA**: Computes a single-sample gene set enrichment score using the ssGSEA algorithm. Reflects the coordinated up- or down-regulation of the set in each sample.
185
+
***Log2-median**: mean of the across-sample normalised log2 median-centred expression levels of the genes in the set; for bidirectional gene sets, the sample score is the partial score for the subset of putatively upregulated genes minus that of the downregulated subset.
186
186
187
-
These methods vary in assumptions and sensitivity. Robust gene sets are expected to perform consistently across all three.
187
+
***Ranking**: mean expression rank of gene set members in each sample; for bidirectional gene sets, the sample score is the partial score for the subset of putatively upregulated genes minus that of the downregulated subset, and normalised by the number of genes in the set.
188
188
189
-
#### 3.2 Enrichment-Based Approach
189
+
***ssGSEA**: single-sample gene set enrichment score using ssGSEA; for bidirectional gene sets, the sample score is the partial score for the subset of putatively upregulated genes minus that of the downregulated subset.
190
190
191
-
This approach uses a classical **gene set enrichment analysis (GSEA)** framework to evaluate whether the gene set is significantly overrepresented at the top or bottom of a ranked list of genes (e.g., ranked by fold change or correlation with phenotype).
191
+
Gene sets that are robust phenotypic markers are expected to yield consistently high scores across methods.
192
192
193
-
***GSEA**: Computes a Normalised Enrichment Score (NES) for each contrast or variable of interest, adjusting for gene set size and multiple testing.
193
+
#### 3.2 Enrichment-Based Approach
194
194
195
-
Use this approach when interested in collective behaviour of gene sets in relation to ranked differential signals.
195
+
Enrichment-based methods implement **Gene Set Enrichment Analysis (GSEA)**. Genes are ranked according to differential expression statistics, and a Normalised Enrichment Score (NES) per variable of interest is computed, accompanied by a p-value adjusted for multiple hypothesis testing.
196
196
197
197
### 4. Visualisation and Evaluation
198
198
199
-
In **Benchmarking Mode**, `markeR` offers a range of visual summaries:
199
+
In **Benchmarking Mode**, `markeR` offers a range of visual summaries:
200
+
201
+
* Violin plots of score distributions by categorical phenotype;
202
+
* Scatter plots of association between scores and numerical phenotypes;
203
+
* Volcano plots and heatmaps of scores or differential gene set expression based on effect sizes (Cohen’s *d* or *f*);
204
+
* ROC curves and respective AUC values of gene sets' phenotypic classification performance;
205
+
* Violin plots of effect size distributions (Cohen’s *d*) for pairwise group differences in scores, for original and simulated gene sets;
206
+
* Plots summarising NES alongside adjusted p-values (*e.g.*, lollipop plots);
In **Discovery Mode**, the output focuses on a single gene set:
210
211
211
-
* Score distributions by phenotype
212
-
*Pairwise contrasts (Cohen’s *d*) and overall effect sizes (Cohen’s *f*)
213
-
*Enrichment score summaries (NES) with adjusted p-values (e.g., lollipop plots)
212
+
* Score distributions stratified by variable;
213
+
*Effect sizes for pairwise and multiple-group differences (Cohen's *d* and *f*, respectively);
214
+
*Cross-variable summaries of NES and adjusted p-values (*e.g.*, lollipop plots).
214
215
215
-
Benchmarking mode offers the most comprehensive set of features and allows users to seamlessly move from discovery to benchmarking mode once a variable of interest has been identified and further testing is required. The main difference from Discovery mode is that Benchmarking is designed to evaluate multiple gene sets simultaneously, whereas Discovery mode focuses on quantifying a single, robust gene set.
216
+
The Benchmarking Mode offers the most comprehensive set of features. Users are allowed to seamlessly move from Discovery to Benchmarking once a variable of interest has been identified and further testing is required. Benchmarking is designed to evaluate multiple gene sets simultaneously, whereas Discovery focuses on the performance of a single gene set.
216
217
217
218
### 5. Individual Gene Exploration
218
219
219
-
To better understand the contribution of individual genes within a gene set and identify whether specific genes drive the overall signal, `markeR`offers a suite of gene-level exploratory analyses, including:
220
+
To better understand the contribution of individual genes within a gene set, and identify whether specific genes drive the set's collective signal, `markeR`provides `VisualiseIndividualGenes.` Available options include:
220
221
221
-
* Expression heatmaps of genes across samples and groups
222
-
* Violin plots showing expression distributions of individual genes
223
-
*Correlation heatmaps to reveal co-expression patterns among genes in the set
224
-
* ROC curves and AUC values for individual genes to evaluate their discriminatory power
225
-
* Effect size calculations (Cohen’s *d*) per gene to quantify differential expression
226
-
* Principal Component Analysis (PCA) on gene set genes to assess variance explained and sample clustering
222
+
* Expression heatmaps of genes across samples or groups of samples;
223
+
* Violin plots showing cross-sample expression distributions of individual genes;
224
+
*Heatmaps of pairwise cross-sample expression correlation between genes in the set;
225
+
* ROC curves and AUC values to evaluate single genes' performance as phenotypic markers;
226
+
* Effect size estimation (Cohen’s *d*) of expression differences between groups of samples;
227
+
* Principal Component Analysis (PCA) of expression of genes in the set, to evaluate which genes dominate collective variance and how samples separate according to the gene set's expression.
227
228
228
229
### 6. Compare with Reference Gene Sets
229
230
230
-
`markeR`allows comparison of user-defined gene sets to reference sets (e.g., from MSigDB) using:
231
+
`markeR`also supports comparison of user-defined gene sets against reference collections (e.g., MSigDB). Two complementary similarity metrics are implemented:
231
232
232
233
***Jaccard Index**:
233
-
Measures gene overlap relative to union size.
234
+
the ratio of the number of genes in common over the total number of genes in the two sets.
234
235
235
-
***Log Odds Ratio (logOR)**:
236
-
Computes enrichment using a user-defined gene universe and Fisher’s exact test.
237
-
238
-
Filters can be applied based on similarity thresholds (e.g., minimum Jaccard, OR, or p-value).
239
-
236
+
***Log Odds Ratio (logOR)** from Fisher’s exact test of association between gene sets, given a specified gene universe.
240
237
238
+
Filters can be applied based on similarity thresholds (e.g., minimum Jaccard, OR, or Fisher's test p-value).
0 commit comments