Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^doc$
^Meta$
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ po/*~

# RStudio Connect folder
rsconnect/
inst/doc
/doc/
/Meta/
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ Imports:
tidyverse,
purrr
Suggests:
knitr,
rmarkdown,
testthat (>= 3.0.0)
Config/testthat/edition: 3
LazyData: true

VignetteBuilder: knitr
2 changes: 2 additions & 0 deletions vignettes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.html
*.R
69 changes: 69 additions & 0 deletions vignettes/examples.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: "examples"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{examples}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

## Overview
This vignette demonstrates how to use the PathwayEmbed package to compute and visualize pathway activation using single-cell transcriptomic data. We use the example dataset fake_test_object included with the package.

## Load Package and Example Data
```{r setup}
library(PathwayEmbed)
# Load the example Seurat object included in the package
data(fake_test_object)
```

## Compute Pathway Activation
```{r}
# Calculate pathway activation using MDS
# Default batch.size is set to 1000
mds_results <- ComputeCellData(
fake_test_object,
pathway = "Wnt",
distance.method = "manhattan"
)
```

## Prepare Data for Plotting
```{r}
# Format MDS results and metadata for plotting
plot_data <- PreparePlotData(
fake_test_object,
mds_results,
group = "genotype"
)
```

## Visualize Pathway Activation
```{r}
# Visualize 2D MDS embedding colored by genotype
PlotPathway(
to.plot = plot_data,
pathway = "Wnt",
group = "genotype",
color = c("#ae282c", "#2066a8")
)
```

## Calculate Group-wise Activation Percentage (Optional)
```{r}
# Calculate % of cells per group with high pathway activation
CalculatePercentage(
to.plot = plot_data,
group_var = "genotype"
)
```

---