| Title: | Datos transcriptómicos de lupus en mujeres mexicanas con lecciones de aprendizaje |
|---|---|
| Description: | Paquete de datos con lecciones de aprendizaje bilingües (español e inglés). Incluye los perfiles transcriptómicos (RNA-seq) de monocitos, células dendríticas derivadas de monocitos (moDC) y células dendríticas tolerogénicas (tolDC) de 33 mujeres mexicanas (10 controles sanas y 23 pacientes con lupus eritematoso sistémico; 99 muestras), sus metadatos clínicos y los resultados intermedios de cada análisis. Las lecciones reproducen paso a paso las figuras del artículo original, de la estadística descriptiva a la expresión diferencial, el enriquecimiento funcional y los modelos con interacción, y se acompañan de funciones auxiliares para heatmaps y la reducción de términos GO. Data package with bilingual learning lessons (Spanish and English) on the transcriptomics of lupus in Mexican women, designed for teaching and reproducible research. |
| Authors: | Evelia Coss [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-7087-2977>) |
| Maintainer: | Evelia Coss <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0.9000 |
| Built: | 2026-10-31 18:47:06 UTC |
| Source: | https://github.com/EveliaCoss/GeneExprLupusMx |
Biotype of each gene in filtered_txi, used to annotate differentially
expressed genes as protein-coding genes (PCG) or long non-coding RNAs (lncRNA).
biotype_summarybiotype_summary
A data frame with 21,699 rows and 3 columns:
Gene symbol.
Ensembl biotype (e.g., "protein_coding", "lncRNA").
Grouped biotype: PCG, lncRNA,
Pseudogene, small ncRNAs or TEC.
The script that generates it is data-raw/lesson4_annotations.R.
Ensembl gene annotation.
table(biotype_summary$Group_biotype)table(biotype_summary$Group_biotype)
Generates a heatmap using the ComplexHeatmap package with a single-color row annotation. Designed to stack several heatmaps (for example, one per cell type) with consistent formatting.
create_heatmap( mat, color, split, common_names = rownames(mat), use_raster_flag = FALSE )create_heatmap( mat, color, split, common_names = rownames(mat), use_raster_flag = FALSE )
mat |
A numeric matrix representing the heatmap values (e.g., Z-scores). |
color |
A character string specifying the annotation color
(e.g., |
split |
A factor, character vector or data frame used to split the
columns of the heatmap. |
common_names |
A character vector of row names, used to size the
annotation. By default, the row names of |
use_raster_flag |
Logical. If |
Requires the Bioconductor package ComplexHeatmap.
A Heatmap object from ComplexHeatmap, ready to be
combined or drawn.
if (requireNamespace("ComplexHeatmap", quietly = TRUE)) { # small simulated Z-score matrix: 50 genes x 20 samples # (with the lesson data: zscore_mat <- download_data("zscore_mat")) set.seed(1) mat <- t(scale(t(matrix(rnorm(50 * 20), nrow = 50)))) ht <- create_heatmap(mat, color = "black", split = NULL) ComplexHeatmap::draw(ht) }if (requireNamespace("ComplexHeatmap", quietly = TRUE)) { # small simulated Z-score matrix: 50 genes x 20 samples # (with the lesson data: zscore_mat <- download_data("zscore_mat")) set.seed(1) mat <- t(scale(t(matrix(rnorm(50 * 20), nrow = 50)))) ht <- create_heatmap(mat, color = "black", split = NULL) ComplexHeatmap::draw(ht) }
Curated list of genes associated with Gene Ontology terms related to dendritic cells, grouped by biological process. Used to explore canonical dendritic cell differentiation pathways (Figure 5B of the article).
dc_genesdc_genes
A data frame with 94 rows and 4 columns:
Gene symbol.
Biological process (e.g., "DC differentiation",
"Migration", "TAM signaling").
Group of Gene Ontology terms used to select the gene.
Gene Ontology term associated with the gene.
The script that generates it is data-raw/lesson5_data.R.
Gene Ontology annotations (https://geneontology.org).
table(dc_genes$process)table(dc_genes$process)
DESeqDataSet built in the lesson "De las cuentas de RNA-seq a la
exploración de datos" (intro_RNAseq_es), ready to be used
as the starting point of later lessons.
A DESeqDataSet with 13,596 genes and 99 samples. Its
colData is metadata_cleaned plus a Volunteer_ID column.
This object is not installed with the package because of its size: get
it with dds <- download_data("dds") (see download_data).
Steps: DESeqDataSetFromTximport() from filtered_txi and
metadata_cleaned with design ~ Cell_type + Group (reference
levels monocyte and Ctrl), removal of genes with fewer than 10
reads in at least 10 samples, and estimateSizeFactors().
Requires the DESeq2 package (Bioconductor) to be used.
The script that generates it is data-raw/lesson2_checkpoints.R.
Generated from filtered_txi and metadata_cleaned.
zscore_mat, filtered_txi,
metadata_cleaned
library(DESeq2) dds <- download_data("dds") dds design(dds)library(DESeq2) dds <- download_data("dds") dds design(dds)
DESeq2 results comparing in vitro differentiated dendritic cells (moDC or tolDC) against monocytes, within each group (healthy controls and SLE patients). Used in the lesson about monocyte differentiation (l5_DEGs_monocytes_diff_es; Figures 4 and 5 of the article).
de_celltype_resultsde_celltype_results
A named list with four data frames (Ctrl_moDC,
Ctrl_tolDC, SLE_moDC, SLE_tolDC), each with 21,718
rows (genes) and 7 columns: gene, baseMean,
log2FoldChange, lfcSE, stat, pvalue and
padj (see de_results).
Designs (all genes of filtered_txi, reference level monocyte):
Controls: ~ Cell_type.
SLE patients: ~ SLEDAI_category + Cell_type + Dose_category
(adjusted for disease activity and glucocorticoid dose).
Results were extracted with results(alpha = 0.05, name =
"Cell_type_<moDC|tolDC>_vs_monocyte") (Wald test, Benjamini-Hochberg adjustment).
With |log2FoldChange| >= 1 and padj < 0.05
(up / down): Ctrl moDC 2688 / 2947, Ctrl tolDC 2731 / 2849,
SLE moDC 2945 / 3652 and SLE tolDC 2804 / 3596. The article (DESeq2 on
R 4.0.2) reports the same numbers for moDC and differs by a few genes in
tolDC (2736 / 2851 and 2804 / 3592). The script that generates this object
is data-raw/lesson5_checkpoints.R.
Generated from filtered_txi and metadata_cleaned.
de_results (SLE vs Ctrl within each cell type).
names(de_celltype_results) head(de_celltype_results$Ctrl_moDC[order(de_celltype_results$Ctrl_moDC$padj), ])names(de_celltype_results) head(de_celltype_results$Ctrl_moDC[order(de_celltype_results$Ctrl_moDC$padj), ])
DESeq2 interaction results that test whether the change from monocytes to in vitro differentiated dendritic cells (moDC or tolDC) is different in SLE patients than in healthy controls. Used in the lesson about the between-group comparison of contrasts (l7_DEGs_between_groups_es; Figure 7A and 7B of the article).
de_interaction_resultsde_interaction_results
A named list with two data frames (moDC and tolDC),
each with 21,718 rows (genes) and 7 columns: gene, baseMean,
log2FoldChange, lfcSE, stat, pvalue and
padj (see de_results).
Design (all genes of filtered_txi, the 99 samples, reference levels
Ctrl and monocyte): ~ Group + Cell_type + Group:Cell_type.
Results were extracted with results(alpha = 0.05, name =
"GroupSLE.Cell_type<moDC|tolDC>") (Wald test, Benjamini-Hochberg adjustment).
The log2FoldChange is a difference of differences:
(dendritic cell vs monocyte in SLE) minus (dendritic cell vs monocyte in Ctrl).
With padj < 0.05 (up / down): moDC 1 / 28 and
tolDC 3 / 38. The script that generates this object is
data-raw/lesson7_checkpoints.R.
Generated from filtered_txi and metadata_cleaned.
de_celltype_results (dendritic cells vs monocytes
within each group), go_interaction_results.
names(de_interaction_results) head(de_interaction_results$tolDC[order(de_interaction_results$tolDC$padj), ])names(de_interaction_results) head(de_interaction_results$tolDC[order(de_interaction_results$tolDC$padj), ])
DESeq2 results of the comparison between SLE patients and healthy controls within each cell type, generated in the lesson "Genes diferencialmente expresados entre pacientes y controles" (l3_DEGs_es). Starting point of the functional enrichment lesson.
de_resultsde_results
A named list with three data frames (monocyte, moDC,
tolDC), each with 21,718 rows (genes) and 7 columns:
Gene symbol.
Mean normalized expression across samples.
Log2 fold change, SLE vs Ctrl.
Standard error of the log2 fold change.
Wald statistic.
Wald test p-value.
Benjamini-Hochberg adjusted p-value (NA for genes
removed by independent filtering).
For each cell type: DESeqDataSetFromTximport() with all genes of
filtered_txi, design ~ Group (reference Ctrl),
DESeq() and results(name = "Group_SLE_vs_Ctrl") (Wald test,
Benjamini-Hochberg adjustment).
With |log2FoldChange| >= 1 and padj < 0.05:
37 up / 0 down in monocytes, 4 up / 40 down in moDC and 4 up / 12 down in
tolDC (94 distinct genes). The script that generates it is
data-raw/lesson3_checkpoints.R.
Generated from filtered_txi and metadata_cleaned.
names(de_results) head(de_results$monocyte[order(de_results$monocyte$padj), ])names(de_results) head(de_results$monocyte[order(de_results$monocyte$padj), ])
The three largest objects (filtered_txi, dds and
zscore_mat) are not installed with the package, to keep it
small. They are stored as files of the GitHub release of the package, and
this function downloads them the first time they are used. Later calls read
the copy saved on your computer, so no internet connection is needed.
download_data(name = c("filtered_txi", "dds", "zscore_mat"), tag = "v0.1.0")download_data(name = c("filtered_txi", "dds", "zscore_mat"), tag = "v0.1.0")
name |
Name of the object: |
tag |
GitHub release that contains the files. The default is the release with the data used in the lessons. |
Files are saved in tools::R_user_dir("GeneExprLupusMx",
"cache"). Delete that folder to free space or to download them again.
The first download needs about 46 MB in total.
The requested object.
filtered_txi <- download_data("filtered_txi") dim(filtered_txi$counts)filtered_txi <- download_data("filtered_txi") dim(filtered_txi$counts)
Gene-level RNA-seq quantification of the 99 samples of the study (33 volunteers x 3 cell types: monocytes, moDCs and tolDCs). Transcripts were quantified with Salmon and summarized to genes with tximport. Genes are identified by their gene symbol; duplicated entries in gene biotypes were removed before creating this object.
A list with the structure returned by tximport::tximport():
Numeric matrix (21,718 genes x 99 samples) of gene abundances in transcripts per million (TPM).
Numeric matrix (21,718 genes x 99 samples) of estimated read counts. Values are not integers because Salmon estimates them.
Numeric matrix (21,718 genes x 99 samples) with the average effective transcript length of each gene in each sample; DESeq2 uses it as a normalization offset.
Character, "no": counts were not
derived from abundances.
This object is not installed with the package because of its size: get
it with filtered_txi <- download_data("filtered_txi") (see download_data).
Row names are gene symbols (e.g., "A1BG") and column names
are sample identifiers (e.g., "QR011_1"), in the same order as the
rows of metadata_cleaned. Use it with
DESeq2::DESeqDataSetFromTximport().
Hernández-Ledesma AL, Coss-Navarrete EL, et al. (2026), Front. Immunol. 17:1771959 (doi:10.3389/fimmu.2026.1771959); data and analysis code deposited in Zenodo (doi:10.5281/zenodo.17742206).
metadata_cleaned, biotype_summary
filtered_txi <- download_data("filtered_txi") names(filtered_txi) dim(filtered_txi$counts) filtered_txi$counts[1:4, 1:4]filtered_txi <- download_data("filtered_txi") names(filtered_txi) dim(filtered_txi$counts) filtered_txi$counts[1:4, 1:4]
Applies the variance stabilizing transformation (VST) to a DESeqDataSet,
removes genes with zero variance, converts each gene to Z-scores across
samples and orders the columns.
get_heatmap_mat(dds_object, sample_order = colnames(dds_object))get_heatmap_mat(dds_object, sample_order = colnames(dds_object))
dds_object |
A |
sample_order |
Character vector with the sample IDs in the order in
which the columns should appear. By default, the order of |
Requires the Bioconductor packages DESeq2 and SummarizedExperiment.
A numeric matrix of Z-scores (genes in rows, samples in columns).
if (requireNamespace("DESeq2", quietly = TRUE)) { # small simulated DESeqDataSet: 1,200 genes x 6 samples # (with the lesson data: dds <- download_data("dds")) set.seed(1) counts <- matrix(rnbinom(1200 * 6, mu = 100, size = 10), ncol = 6, dimnames = list(paste0("gene", 1:1200), paste0("S", 1:6))) col_data <- data.frame(Group = factor(rep(c("Ctrl", "SLE"), each = 3)), row.names = colnames(counts)) sim_dds <- DESeq2::DESeqDataSetFromMatrix(counts, col_data, design = ~ Group) sim_mat <- get_heatmap_mat(sim_dds) dim(sim_mat) }if (requireNamespace("DESeq2", quietly = TRUE)) { # small simulated DESeqDataSet: 1,200 genes x 6 samples # (with the lesson data: dds <- download_data("dds")) set.seed(1) counts <- matrix(rnbinom(1200 * 6, mu = 100, size = 10), ncol = 6, dimnames = list(paste0("gene", 1:1200), paste0("S", 1:6))) col_data <- data.frame(Group = factor(rep(c("Ctrl", "SLE"), each = 3)), row.names = colnames(counts)) sim_dds <- DESeq2::DESeqDataSetFromMatrix(counts, col_data, design = ~ Group) sim_mat <- get_heatmap_mat(sim_dds) dim(sim_mat) }
Functional enrichment of the differentially expressed genes (DEG) between
dendritic cells and monocytes (de_celltype_results), obtained
with gprofiler2 in the lesson about monocyte differentiation
(l5_DEGs_monocytes_diff_es).
go_celltype_resultsgo_celltype_results
A data frame with one row per significant term and the same 10
columns as go_results: query, source,
term_id, term_name, term_size, query_size,
intersection_size, p_value, parents and
intersection.
DEG were defined with |log2FoldChange| >= 1 and padj < 0.05
and queried as eight lists (<Ctrl|SLE>_<UP|DOWN>_<moDC|tolDC>), one at
a time, with gost(organism = "hsapiens", correction_method = "fdr",
user_threshold = 0.05, sources = c("GO:BP", "KEGG", "REAC"), evcodes = TRUE).
The archived g:Profiler version e113_eg59_p19 (2025) was
used; it is stored in attr(go_celltype_results, "gprofiler_version").
The script that generates it is data-raw/lesson5_checkpoints.R.
g:Profiler (https://biit.cs.ut.ee/gprofiler/).
de_celltype_results, go_results
table(go_celltype_results$query)table(go_celltype_results$query)
Functional enrichment of the genes whose change from monocytes to dendritic
cells differs between SLE patients and controls
(de_interaction_results), obtained with gprofiler2 in
l7_DEGs_between_groups_es.
go_interaction_resultsgo_interaction_results
A data frame with one row per significant term and the same 10
columns as go_results: query, source,
term_id, term_name, term_size, query_size,
intersection_size, p_value, parents and
intersection.
Genes with padj < 0.05 were split by the sign of
log2FoldChange and queried as four lists
(SLEvsCtrl_<UP|DOWN>_<moDC|tolDC>) with gost(organism =
"hsapiens", correction_method = "fdr", user_threshold = 0.05, sources =
c("GO:BP", "KEGG", "REAC"), evcodes = TRUE).
The archived g:Profiler version e113_eg59_p19 (2025) was
used; it is stored in attr(go_interaction_results, "gprofiler_version").
The script that generates it is data-raw/lesson7_checkpoints.R.
g:Profiler (https://biit.cs.ut.ee/gprofiler/).
de_interaction_results, go_celltype_results
table(go_interaction_results$query, go_interaction_results$source)table(go_interaction_results$query, go_interaction_results$source)
Functional enrichment of the differentially expressed genes (DEG) of each cell type, obtained with gprofiler2 in the lesson "Funciones biológicas de los genes diferencialmente expresados" (l4_GOterms_es).
go_resultsgo_results
A data frame with 943 rows (significant terms) and 10 columns:
Gene list (cell type and direction of change).
Database: GO:BP, GO:CC, GO:MF,
REAC, KEGG, WP, TF, MIRNA,
HP or CORUM.
Term identifier.
Term name.
Number of genes annotated to the term.
Number of genes of the list with annotation in the database.
Number of genes of the list annotated to the term.
Adjusted p-value (FDR) of the hypergeometric test.
Comma-separated parent terms in the database hierarchy.
Comma-separated genes of the list annotated to the term.
DEG were defined in de_results with
|log2FoldChange| >= 1 and padj < 0.05, and queried as five
lists (SLE_UP_monocyte, SLE_UP_moDC, SLE_DOWN_moDC,
SLE_UP_tolDC, SLE_DOWN_tolDC) with
gost(organism = "hsapiens", correction_method = "fdr",
user_threshold = 0.05, evcodes = TRUE).
g:Profiler updates its databases periodically. To reproduce the
article, the archived version e113_eg59_p19 (June 2025) was used;
it is stored in attr(go_results, "gprofiler_version"). The script
that generates it is data-raw/lesson4_checkpoints.R.
g:Profiler (https://biit.cs.ut.ee/gprofiler/).
table(go_results$query) table(go_results$source)table(go_results$query) table(go_results$source)
List of 423 interferon-stimulated genes, used to identify differentially expressed ISGs.
isg_genesisg_genes
A data frame with 423 rows and 1 column:
Gene symbol.
The script that generates it is data-raw/lesson4_annotations.R.
Yu et al. (2025), Table S3: "The list of interferon-stimulated genes" (doi:10.6084/m9.figshare.28353289).
head(isg_genes) "IFI27" %in% isg_genes$geneshead(isg_genes) "IFI27" %in% isg_genes$genes
Metadata of the 99 RNA-seq samples: 33 volunteers (10 healthy controls and
23 women with systemic lupus erythematosus, SLE), each contributing three
cell types: monocytes (monocyte), monocyte-derived dendritic cells
(moDC) and tolerogenic dendritic cells (tolDC). Clinical
variables are repeated in the three samples of each volunteer.
metadata_cleanedmetadata_cleaned
A data frame with 99 rows (samples) and 14 columns. All columns are factors.
Sample identifier: volunteer ID plus cell type suffix
(_0 = monocyte, _1 = moDC, _3 = tolDC; e.g.,
"QR011_1"). Also used as row names.
Ctrl (healthy control) or SLE (patient).
Glucocorticoid treatment: No or Si.
Glucocorticoid dose in mg (0, 2.5, 3,
5 or 8); 0 for controls and untreated patients.
Glucocorticoid treatment coded as 0 (no) or
1 (yes); equivalent to GC.
Age in years.
Cell type: monocyte, moDC or tolDC.
Age group: less30 (younger than 30 years) or
more30 (30 years or older).
Lupus nephritis: No or Si; NA in
controls.
Treatment other than glucocorticoids (e.g., antimalarials,
immunosuppressants): No or Si; NA in controls.
SLEDAI disease activity score (0 to 62); NA in
controls.
SLEDAI activity group: Without_activity,
Low, Moderate, High or Very_high;
NA in controls.
Yes/no indicator from the original clinical records
(No, Si or Sí); NA in controls.
Disease activity category: Zero (SLEDAI
score 0, and all controls), No_activity (score 1-3) or
Activity (score 4 or more).
Rows are in the same order as the columns of the count matrices of
filtered_txi.
Age, Dose and Sledai_score are stored as
factors; convert them with as.numeric(as.character(x)) before
doing calculations.
The volunteer identifier (e.g., "QR011") is the prefix of
sample_ID, sub("_.*", "", sample_ID); it links this table
with volunteer_info.
In SLEDAI_Md, the "yes" level appears as Si and
Sí; combine them before counting, for example with
sub("Sí", "Si", SLEDAI_Md).
Sledai_score, Sledai_group and
SLEDAI_category are groupings of disease activity used in the
exploratory analyses. To describe the volunteers as in Table 1 of the
article (age, treatments and active disease, SLEDAI 6 or more), use
volunteer_info, which has one row per volunteer, as in
the lessons.
Hernández-Ledesma AL, Coss-Navarrete EL, et al. (2026), Front. Immunol. 17:1771959 (doi:10.3389/fimmu.2026.1771959); data and analysis code deposited in Zenodo (doi:10.5281/zenodo.17742206).
head(metadata_cleaned) table(metadata_cleaned$Group, metadata_cleaned$Cell_type) # Age as a number summary(as.numeric(as.character(metadata_cleaned$Age)))head(metadata_cleaned) table(metadata_cleaned$Group, metadata_cleaned$Cell_type) # Age as a number summary(as.numeric(as.character(metadata_cleaned$Age)))
Curated list of genes reported in the literature as up- or down-regulated when monocytes differentiate in vitro into monocyte-derived dendritic cells (moDCs), grouped by biological process. Used to check the expected transcriptional changes (Figure 4C of the article).
moDC_genesmoDC_genes
A data frame with 90 rows and 7 columns:
Gene symbol.
Name used in the source publication (e.g., "IL-1beta").
Biological process (e.g., "Maturation", "Cytokines").
Pathway or description reported in the source.
Reported direction: Upregulated or Downregulated.
Link to the source publication.
Comparison in which the change was reported.
The script that generates it is data-raw/lesson5_data.R.
Text was converted to ASCII (Greek letters spelled out) and the spreadsheet
artifact "GBP 2.00" was corrected to "GBP2".
Eleven entries use aliases or old names (CD31, CD54,
IL8, IRF7A, ERF2, CD32, TNFR2,
IP3KB, HSP27, GRP78) or genes absent from the
data (CXCL8); they do not match the gene symbols of
filtered_txi and, as in the original analysis, are not shown.
See the link column.
table(moDC_genes$process)table(moDC_genes$process)
Load and analyze a single .RData file containing GO enrichment results
from either UP or DOWN regulated genes. Includes validation, semantic
similarity reduction, merging metadata, and plotting.
process_go(f, direction = c("UP", "DOWN"), outdir, figdir)process_go(f, direction = c("UP", "DOWN"), outdir, figdir)
f |
Character. Path to the |
direction |
Character. Either |
outdir |
Character. Directory to save |
figdir |
Character. Directory to save PNG plots. |
Requires the Bioconductor packages rrvgo and org.Hs.eg.db. Datasets with fewer than 40 unique GO terms are skipped.
Invisibly, NULL. Saves processed files and figures in
outdir and figdir.
reduce_go_terms for batch processing of multiple
enrichment files.
if (all(vapply(c("rrvgo", "org.Hs.eg.db", "dplyr", "ggplot2"), requireNamespace, logical(1), quietly = TRUE))) { # Enrichment table with the columns go_id, term and p.adjust go_bp <- go_celltype_results[go_celltype_results$query == "SLE_UP_moDC" & go_celltype_results$source == "GO:BP", ] go_bp <- head(go_bp[order(go_bp$p_value), ], 60) go_table <- data.frame(go_id = go_bp$term_id, term = go_bp$term_name, p.adjust = go_bp$p_value) go_dir <- file.path(tempdir(), "process_go_example") dir.create(go_dir, showWarnings = FALSE) f <- file.path(go_dir, "UP_GO_SLE_moDC.RData") save(go_table, file = f) process_go(f, direction = "UP", outdir = go_dir, figdir = go_dir) list.files(go_dir) }if (all(vapply(c("rrvgo", "org.Hs.eg.db", "dplyr", "ggplot2"), requireNamespace, logical(1), quietly = TRUE))) { # Enrichment table with the columns go_id, term and p.adjust go_bp <- go_celltype_results[go_celltype_results$query == "SLE_UP_moDC" & go_celltype_results$source == "GO:BP", ] go_bp <- head(go_bp[order(go_bp$p_value), ], 60) go_table <- data.frame(go_id = go_bp$term_id, term = go_bp$term_name, p.adjust = go_bp$p_value) go_dir <- file.path(tempdir(), "process_go_example") dir.create(go_dir, showWarnings = FALSE) f <- file.path(go_dir, "UP_GO_SLE_moDC.RData") save(go_table, file = f) process_go(f, direction = "UP", outdir = go_dir, figdir = go_dir) list.files(go_dir) }
Applies semantic similarity reduction to GO enrichment results from a batch
of .RData files (both UP and DOWN regulated genes). For each dataset,
it invokes process_go to reduce redundancy, merge metadata, and
generate visualizations.
reduce_go_terms(indir, outdir, figdir)reduce_go_terms(indir, outdir, figdir)
indir |
Character. Input directory containing GO enrichment
|
outdir |
Character. Output directory to save reduced GO term
|
figdir |
Character. Directory to save output plots (treemaps and bar plots). |
This wrapper function automates analysis across multiple files following the
naming pattern UP_GO_<name>.RData or DOWN_GO_<name>.RData,
typically produced by GO enrichment pipelines.
For each file, the function:
Loads the GO enrichment result.
Filters invalid, duplicated, or missing GO IDs.
Skips datasets with fewer than 40 unique GO terms.
Computes semantic similarity with rrvgo::calculateSimMatrix()
using the "Rel" method.
Reduces terms via rrvgo::reduceSimMatrix() with a similarity
threshold of 0.7.
Saves both the reduced term object and merged gene-GO mapping.
Generates treemap and bar plots showing parent GO categories.
Internal errors in similarity computation are caught with tryCatch()
to allow uninterrupted batch processing across datasets.
Requires the Bioconductor packages rrvgo and org.Hs.eg.db.
Invisibly, NULL. It generates and saves .RData and
.png files in the specified output directories.
process_go for analyzing individual files.
if (all(vapply(c("rrvgo", "org.Hs.eg.db", "dplyr", "ggplot2"), requireNamespace, logical(1), quietly = TRUE))) { indir <- file.path(tempdir(), "reduce_go_terms_example") dir.create(indir, showWarnings = FALSE) # One file per enrichment result, named UP_GO_<name>.RData or DOWN_GO_<name>.RData for (q in c("SLE_UP_moDC", "SLE_DOWN_moDC")) { go_bp <- go_celltype_results[go_celltype_results$query == q & go_celltype_results$source == "GO:BP", ] go_bp <- head(go_bp[order(go_bp$p_value), ], 60) go_table <- data.frame(go_id = go_bp$term_id, term = go_bp$term_name, p.adjust = go_bp$p_value) direction <- if (grepl("_UP_", q, fixed = TRUE)) "UP" else "DOWN" save(go_table, file = file.path(indir, paste0(direction, "_GO_moDC.RData"))) } reduce_go_terms(indir = indir, outdir = tempdir(), figdir = tempdir()) }if (all(vapply(c("rrvgo", "org.Hs.eg.db", "dplyr", "ggplot2"), requireNamespace, logical(1), quietly = TRUE))) { indir <- file.path(tempdir(), "reduce_go_terms_example") dir.create(indir, showWarnings = FALSE) # One file per enrichment result, named UP_GO_<name>.RData or DOWN_GO_<name>.RData for (q in c("SLE_UP_moDC", "SLE_DOWN_moDC")) { go_bp <- go_celltype_results[go_celltype_results$query == q & go_celltype_results$source == "GO:BP", ] go_bp <- head(go_bp[order(go_bp$p_value), ], 60) go_table <- data.frame(go_id = go_bp$term_id, term = go_bp$term_name, p.adjust = go_bp$p_value) direction <- if (grepl("_UP_", q, fixed = TRUE)) "UP" else "DOWN" save(go_table, file = file.path(indir, paste0(direction, "_GO_moDC.RData"))) } reduce_go_terms(indir = indir, outdir = tempdir(), figdir = tempdir()) }
Genes reported as associated with SLE in the literature, used to identify SLE-related genes among the differentially expressed genes.
sle_genessle_genes
A data frame with 219 rows (213 unique genes; some genes are reported by more than one study) and 4 columns:
Gene symbol.
Pathway or function associated with the gene
(NA if not reported).
Study that reports the association.
Link to the study.
Compiled from Shen et al. (2022), Deng and Tsao (2017),
Bing et al. (2016) and Ortiz-Fernandez et al. (2023). The script that
generates it is data-raw/lesson4_annotations.R.
See the Link column.
table(sle_genes$Reference) length(unique(sle_genes$Gene_name))table(sle_genes$Reference) length(unique(sle_genes$Gene_name))
Genes reported as activated (up-regulated) or repressed (down-regulated) in tolerogenic dendritic cells by Robertson et al. (2021). Used to evaluate whether the tolDCs of the study acquire the expected tolerogenic signature (Figure 6 of the article; l6_DEGs_tolDcs_es).
tolDC_genestolDC_genes
A data frame with 86 rows and 4 columns:
Gene symbol.
Category reported by Robertson et al.: direction
(Activated or Repressed) and set in which the gene was
found: tolDCs generated with IL-10 (IL10), with IL-10 plus
dexamethasone (IL10+DXM) or the consensus tolDC signature
(tolDC_signature). Genes found in several sets list all of them,
separated by commas.
Gene biotype (PCG or lncRNA).
Link to the source publication.
The script that generates it is data-raw/lesson6_annotations.R.
Robertson H, et al. (2021). Transcriptomic analysis identifies a tolerogenic dendritic cell signature. Front Immunol 12:733231. doi:10.3389/fimmu.2021.733231
table(tolDC_genes$tolDC_signature)table(tolDC_genes$tolDC_signature)
Clinical and recruitment information with one row per volunteer
(10 healthy controls and 23 women with systemic lupus erythematosus).
Each volunteer contributed three samples (monocyte, moDC and tolDC) to
metadata_cleaned; both tables are linked by Volunteer_ID, the
prefix of metadata_cleaned$sample_ID (e.g. "QR011_0" -> "QR011").
volunteer_infovolunteer_info
A data frame with 33 rows and 16 columns:
Volunteer identifier (e.g. "QR011").
Volunteer number, in order of recruitment.
Ctrl (healthy control) or SLE (patient).
Age in years.
Years since SLE diagnosis (NA in controls).
Age at SLE diagnosis (NA in controls).
SLEDAI disease activity: 1 = active (SLEDAI >= 6 points),
0 = no or low activity (0-5 points); NA in controls.
Lupus nephritis: No or Yes.
Receives glucocorticoids (TRUE/FALSE).
Glucocorticoid as recorded: PDN or PDS.
Glucocorticoid dose in mg (NA if not recorded).
Receives antimalarials.
Receives mycophenolate mofetil.
Receives azathioprine.
Receives methotrexate.
Month of recruitment and sample collection
(Date, first day of the month).
Treatment columns are NA for controls (not applicable).
The cleaning script is in data-raw/volunteer_info.R.
Hernández-Ledesma AL, Coss-Navarrete EL, et al. (2026), Front. Immunol. 17:1771959 (doi:10.3389/fimmu.2026.1771959); data and analysis code deposited in Zenodo (doi:10.5281/zenodo.17742206).
data(volunteer_info) head(volunteer_info) table(volunteer_info$Group, format(volunteer_info$Time_of_recruitment, "%Y-%m"))data(volunteer_info) head(volunteer_info) table(volunteer_info$Group, format(volunteer_info$Time_of_recruitment, "%Y-%m"))
Gene-wise z-scores of the variance-stabilized expression (VST) computed in the lesson "De las cuentas de RNA-seq a la exploración de datos" (intro_RNAseq_es). Useful for heatmaps and clustering.
A numeric matrix with 13,596 genes (rows) and 99 samples (columns).
This object is not installed with the package because of its size: get
it with zscore_mat <- download_data("zscore_mat") (see download_data).
Steps: vst(dds, blind = FALSE), removal of genes with zero variance,
and t(scale(t(...))) so that each gene has mean 0 and standard
deviation 1 across samples.
The script that generates it is data-raw/lesson2_checkpoints.R.
Generated from dds.
zscore_mat <- download_data("zscore_mat") dim(zscore_mat) zscore_mat[1:4, 1:4]zscore_mat <- download_data("zscore_mat") dim(zscore_mat) zscore_mat[1:4, 1:4]