BloodGen3Module
Workflows
Standard Workflow
library(BloodGen3Module)
library(ExperimentHub)
library(SummarizedExperiment)
# 1. Load expression data from ExperimentHub
dat <- ExperimentHub()
res <- query(dat, "GSE13015")
GSE13015 <- res[["EH5429"]]
# 2. Perform group comparison analysis using t-test
Group_df <- Groupcomparison(
GSE13015,
sample_info = NULL,
FC = 1.5,
pval = 0.1,
FDR = TRUE,
Group_column = "Group_test",
Test_group = "Sepsis",
Ref_group = "Control",
SummarizedExperiment = TRUE
)
# 3. Perform group comparison analysis using limma
Group_limma <- Groupcomparisonlimma(
GSE13015,
sample_info = NULL,
FC = 1.5,
pval = 0.1,
FDR = TRUE,
Group_column = "Group_test",
Test_group = "Sepsis",
Ref_group = "Control",
SummarizedExperiment = TRUE
)
# 4. Generate fingerprint grid plot
gridplot(
Group_df,
cutoff = 15,
Ref_group = "Control",
filename = tempfile()
)
# 5. Perform individual single sample analysis
Individual_df <- Individualcomparison(
GSE13015,
sample_info = NULL,
FC = 1.5,
DIFF = 10,
Group_column = "Group_test",
Ref_group = "Control",
SummarizedExperiment = TRUE
)
# 6. Generate individual fingerprint heatmap
fingerprintplot(
Individual_df,
sample_info = NULL,
cutoff = 15,
rowSplit = TRUE,
Group_column = "Group_test",
show_ref_group = FALSE,
Ref_group = "Control",
Aggregate = "A28",
filename = tempfile(),
height = NULL,
width = NULL
)
Input/Output Note: Inputs a SummarizedExperiment or expression matrix with sample annotations; outputs data frames of module-level percentages and generates PDF visualizations of fingerprint grids and heatmaps.
When to Use
- To perform blood transcriptional module repertoire analysis on gene expression data.
- To determine the percentage of constitutive genes for each module that are significantly increased or decreased between groups using
Groupcomparison() or Groupcomparisonlimma().
- To perform individual sample-level modular analysis in reference to a control group using
Individualcomparison().
- To visualize group comparison results as a fingerprint grid using
gridplot() or individual comparisons as a fingerprint heatmap using fingerprintplot().
When NOT to Use
- For general-purpose differential gene expression analysis without modular grouping (use
limma or DESeq2 directly).
- For single-cell RNA-seq data requiring cell-type specific clustering and marker identification (use
Seurat or scran instead).
Data Requirements
- A normalized, non-log2-transformed expression data matrix or a
SummarizedExperiment object (log2 transformation is performed automatically).
- A sample annotation table (if not using a
SummarizedExperiment with built-in colData) where the row names match the column names of the expression matrix.
Key Parameters
- FC (1.5): Fold change threshold for determining significant changes in gene expression.
- pval (0.1): P-value threshold for statistical significance.
- FDR (TRUE): Logical indicating whether to apply False Discovery Rate correction.
- Group_column ("Group_test"): Column name in sample metadata containing the group classifications.
- Test_group ("Sepsis"): Name of the group to be tested.
- Ref_group ("Control"): Name of the reference group.
- SummarizedExperiment (TRUE): Logical indicating if the input is a
SummarizedExperiment object.
- cutoff (15): Percentage threshold for module visualization in grid and fingerprint plots.
Best Practices
- Ensure the input expression matrix is not log2-transformed, as the package functions perform log2 transformation internally.
- Verify that the row names of the sample information table (
sample_info) match the column names of the expression matrix exactly.
- Use
Groupcomparisonlimma() instead of Groupcomparison() when dealing with complex experimental designs or when limma's empirical Bayes moderation is preferred.
Common Pitfalls
- Pitfall: Inputting pre-log-transformed data, leading to incorrect fold change calculations. Fix: Provide raw or normalized linear-scale counts/intensities.
- Pitfall: Mismatched sample names between expression matrix columns and annotation row names. Fix: Align the names using
colnames(data) <- rownames(sample_info) before running the analysis.
Alternatives
tmod for general gene set enrichment and module visualization.
GSVA for gene set variation analysis.
clusterProfiler for standard GO/KEGG functional enrichment.
Citations
- Rinchai D, et al. (2021). "BloodGen3Module: blood transcriptional module repertoire analysis and visualization using R." Bioinformatics. doi:10.1093/bioinformatics/btab121.
References
1---2name: bloodgen3module3description: BloodGen3Module4---56# BloodGen3Module78## Workflows910### Standard Workflow1112```r13library(BloodGen3Module)14library(ExperimentHub)15library(SummarizedExperiment)1617# 1. Load expression data from ExperimentHub18dat <- ExperimentHub()19res <- query(dat, "GSE13015")20GSE13015 <- res[["EH5429"]]2122# 2. Perform group comparison analysis using t-test23Group_df <- Groupcomparison(24 GSE13015,25 sample_info = NULL,26 FC = 1.5,27 pval = 0.1,28 FDR = TRUE,29 Group_column = "Group_test",30 Test_group = "Sepsis",31 Ref_group = "Control",32 SummarizedExperiment = TRUE33)3435# 3. Perform group comparison analysis using limma36Group_limma <- Groupcomparisonlimma(37 GSE13015,38 sample_info = NULL,39 FC = 1.5,40 pval = 0.1,41 FDR = TRUE,42 Group_column = "Group_test",43 Test_group = "Sepsis",44 Ref_group = "Control",45 SummarizedExperiment = TRUE46)4748# 4. Generate fingerprint grid plot49gridplot(50 Group_df,51 cutoff = 15,52 Ref_group = "Control",53 filename = tempfile()54)5556# 5. Perform individual single sample analysis57Individual_df <- Individualcomparison(58 GSE13015,59 sample_info = NULL,60 FC = 1.5,61 DIFF = 10,62 Group_column = "Group_test",63 Ref_group = "Control",64 SummarizedExperiment = TRUE65)6667# 6. Generate individual fingerprint heatmap68fingerprintplot(69 Individual_df,70 sample_info = NULL,71 cutoff = 15,72 rowSplit = TRUE,73 Group_column = "Group_test",74 show_ref_group = FALSE,75 Ref_group = "Control",76 Aggregate = "A28",77 filename = tempfile(),78 height = NULL,79 width = NULL80)81```82**Input/Output Note:** Inputs a `SummarizedExperiment` or expression matrix with sample annotations; outputs data frames of module-level percentages and generates PDF visualizations of fingerprint grids and heatmaps.8384## When to Use85- To perform blood transcriptional module repertoire analysis on gene expression data.86- To determine the percentage of constitutive genes for each module that are significantly increased or decreased between groups using `Groupcomparison()` or `Groupcomparisonlimma()`.87- To perform individual sample-level modular analysis in reference to a control group using `Individualcomparison()`.88- To visualize group comparison results as a fingerprint grid using `gridplot()` or individual comparisons as a fingerprint heatmap using `fingerprintplot()`.8990## When NOT to Use91- For general-purpose differential gene expression analysis without modular grouping (use `limma` or `DESeq2` directly).92- For single-cell RNA-seq data requiring cell-type specific clustering and marker identification (use `Seurat` or `scran` instead).9394## Data Requirements95- A normalized, non-log2-transformed expression data matrix or a `SummarizedExperiment` object (log2 transformation is performed automatically).96- A sample annotation table (if not using a `SummarizedExperiment` with built-in colData) where the row names match the column names of the expression matrix.9798## Key Parameters99- **FC** (1.5): Fold change threshold for determining significant changes in gene expression.100- **pval** (0.1): P-value threshold for statistical significance.101- **FDR** (TRUE): Logical indicating whether to apply False Discovery Rate correction.102- **Group_column** ("Group_test"): Column name in sample metadata containing the group classifications.103- **Test_group** ("Sepsis"): Name of the group to be tested.104- **Ref_group** ("Control"): Name of the reference group.105- **SummarizedExperiment** (TRUE): Logical indicating if the input is a `SummarizedExperiment` object.106- **cutoff** (15): Percentage threshold for module visualization in grid and fingerprint plots.107108## Best Practices109- Ensure the input expression matrix is **not** log2-transformed, as the package functions perform log2 transformation internally.110- Verify that the row names of the sample information table (`sample_info`) match the column names of the expression matrix exactly.111- Use `Groupcomparisonlimma()` instead of `Groupcomparison()` when dealing with complex experimental designs or when limma's empirical Bayes moderation is preferred.112113## Common Pitfalls114- *Pitfall*: Inputting pre-log-transformed data, leading to incorrect fold change calculations. *Fix*: Provide raw or normalized linear-scale counts/intensities.115- *Pitfall*: Mismatched sample names between expression matrix columns and annotation row names. *Fix*: Align the names using `colnames(data) <- rownames(sample_info)` before running the analysis.116117## Alternatives118- `tmod` for general gene set enrichment and module visualization.119- `GSVA` for gene set variation analysis.120- `clusterProfiler` for standard GO/KEGG functional enrichment.121122## Citations123- Rinchai D, et al. (2021). "BloodGen3Module: blood transcriptional module repertoire analysis and visualization using R." *Bioinformatics*. doi:10.1093/bioinformatics/btab121.124125## References126- Homepage: https://bioconductor.org/packages/bloodgen3module127- Vignette: https://bioconductor.org/packages/release/bioc/vignettes/bloodgen3module/inst/doc/BloodGen3Module.html