A complete, reproducible workflow for single-cell Proximity Network Analysis
Analyze PNA data from the nf-core/pixelator pipeline with quality control, clustering, annotation, and publication-ready visualizations.
- Quick Start
- First-Time R Setup
- Prepare Your Data
- Run the Analysis
- Make it yours
- Troubleshooting
- Maintainers
Choose the method that works best for you:
The simplest way to get started - no GitHub account or special tools needed.
- Click the green Code button above β Download ZIP
- Extract to a folder (e.g.,
Documents/my-analysis) - Continue to First-Time R Setup
π‘ Tip: Always open your project by double-clicking
proxiome_analysis_template.Rproj(found directly inside the extracted folder) - this sets up file paths automatically.
Advanced: Using git to clone this repository
A visual interface for managing repositories - no command line needed.
- Install GitHub Desktop
- File β Clone repository β paste:
https://github.com/PixelgenTechnologies/proxiome-analysis-template - Click Clone
git clone https://github.com/PixelgenTechnologies/proxiome-analysis-template.git
cd proxiome-analysis-template- Click Use this template at the top of this page (requires GitHub account)
- Create your new repository
- Download your repository via GitHub Desktop or
git clone
You need to download and install both programs:
| Software | Description | Download |
|---|---|---|
| R (4.1+) | The programming language | Download from CRAN |
| RStudio | The editor/interface for R | Download from Posit |
π New to R? Read the Getting Started with R guide first.
Some R packages require compilation. Install the appropriate tools for your operating system:
Windows
Also install Rtools. Choose the version matching your R installation (required for some packages).
macOS
Press Command + Spacebar to open Spotlight search, type "Terminal," and hit Enter to open the terminal.
Install Xcode command line tools by running this in the terminal:
xcode-select --install
β οΈ Note: This command will open a separate installation window. Follow the prompts in that window to complete the installation before continuing.
Linux
After installing R, install system libraries:
sudo apt install cmake libglpk-dev libhdf5-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libwebp-devOpen the R project file in RStudio by double-clicking proxiome_analysis_template.Rproj (located directly in the folder you downloaded/extracted). Then copy and paste the following lines into the console one at a time (some packages will prompt you for input during installation):
# Install pak
install.packages("pak")
# Install packages
pak::pak(c("tidyverse", "Seurat", "here", "Matrix", "ggraph", "pls", "ggplotify", "harmony", "ggbeeswarm", "RcppML", "ComplexHeatmap", "PixelgenTechnologies/pixelatorR"))
β οΈ Important: Run these commands line-by-line, not all at once. Some packages will ask you questions during installation (e.g., "Do you want to install from source?"). Wait for each installation to complete before running the next line.
Advanced: Docker (pre-built environment)
If you prefer not to install R packages locally, use the pre-built Docker image. It includes R, Quarto, pixelatorR, and all other PAT dependencies, with the template files at /workspace.
docker pull quay.io/pixelgen-technologies/proxiome-analysis-template:latest
docker run -it --rm -v "$(pwd)/data:/workspace/data" quay.io/pixelgen-technologies/proxiome-analysis-template:latestMount your data/ folder so your PXL files and metadata.csv are available inside the container. Then open RStudio locally against the mounted project, or run R interactively inside the container.
When you have everything installed, add your .pxl data files and a metadata.csv to the data/ folder as shown below.
proxiome-analysis-template/ β Your project folder (can be renamed to whatever you want)
βββ data/
β βββ metadata.csv β Your sample info
β βββ *.layout.pxl β Your PXL files
βββ modules/ β Analysis notebooks (run in order)
β βββ common_setup.R β Shared setup (sourced automatically)
β βββ 01_quality_control.qmd β Start here (load data + QC)
β βββ 02_clustering_annotation.qmd
β βββ 03_abundance.qmd
β βββ 04_proximity.qmd
β βββ 05_statistical_testing.qmd β Optional
βββ results/ β Created automatically when running the PAT
βββ proxiome_analysis_template.Rproj β Double-click to open the project in RStudio
βββ proxiome_analysis_template.qmd β Full re-render of all modules (optional)
The metadata.csv file describes your samples and links them to the corresponding PXL files.
| Column | Required | Description | Example |
|---|---|---|---|
sample_id |
β | Unique identifier | S1 |
sample_alias |
β | Descriptive name | S1_resting |
condition |
β | Experimental group | resting |
file_path |
β | PXL filename (not full path) | Sample1.layout.pxl |
| other | Any extra columns (donor, batch, etc.) |
- |
π‘ Extra columns are available as variables in the template for grouping or covariates.
Example file:
You can use the placeholder data/metadata.csv as a template. Just replace the example rows with your own sample information and filenames:
sample_id,sample_alias,condition,file_path
S1,S1_resting,resting,PNA064_Sample_1_S1.layout.pxl
S2,S2_PHA,PHA,PNA064_Sample_2_S2.layout.pxlπ Row order controls plot order. Both
,and;separators work. Everyfile_pathmust match a file indata/.
The analysis lives in numbered notebooks under modules/ β Quarto documents (QMD files) that combine text explanations with runnable R code. PNA tutorials provide additional background.
- QMD file: A document that mixes formatted text with executable R code. You run the code section by section.
- Code chunk: A gray block containing R code. Each chunk has a green βΆ (play) button in the top-right corner.
- Open
proxiome_analysis_template.Rproj - Open
modules/01_quality_control.qmdin RStudio - Run chunks top to bottom through module
01, then continue with02,03, and04 - Optional: Open
modules/05_statistical_testing.qmdonly if you need differential testing
π‘ Tip: Each module starts with a short intro. Search for Decision checkpoint to find values you need to edit.
After module 02 finishes, you can open 03, 04, or 05 in a new R session and run the first chunk β packages, palettes, and saved data load automatically.
| Checkpoint file | Created by | Used by |
|---|---|---|
pg_data_merged.rds |
module 01 (filtered cells) |
module 02 |
selected_markers.rds |
module 01 |
module 02 |
annotated_seurat_object.rds |
module 02 |
modules 03β05 |
markers_to_test.rds |
module 02 |
modules 04β05 |
All checkpoints are saved under results/checkpoint_data/.
To regenerate one HTML report of the entire workflow, install Quarto and render proxiome_analysis_template.qmd. For day-to-day analysis, use the individual modules instead.
| Module | What to do |
|---|---|
| 01 β sample table | Check metadata.csv paths and sample IDs match your data |
| 01 β QC thresholds | Set n_umi_min_threshold, n_umi_max_threshold, isotype_percent_threshold after reviewing QC plots; re-run section 1.3.5 onward |
| 01 β marker selection | Review selected_markers after running the selection code |
| 02 β manual annotation | Critical step! Edit cluster_cell_annotation to assign cell type names to clusters |
| 05 β reference condition (optional) | Set reference_condition to your control condition (default example: "resting") |
π‘ Tip: Comments above each section explain what you might want to change. Look for text like "adjust according to your data" or "change according to your dataset".
Results are saved to results/ in PDF and PNG formats:
results/
βββ checkpoint_data/ # Cross-module checkpoints (see table above)
βββ 01_quality_control/
βββ 02_clustering_annotation/
βββ 03_abundance/
βββ 04_proximity/
βββ 05_statistical_testing/
This template is a starting point, not a rulebook.
Adapt it to fit your science, your questions, and how you like to work.
- Remove sections that don't apply to your data
- Rewrite code until it makes sense to you
- Swap out methods, thresholds, or visualizations
- Add new analysis steps wherever you need them
If it works better for you, it's the right way.
Happy analyzing!
Package installation fails
Install compiler tools for your OS:
- Windows: Rtools
- macOS:
xcode-select --install - Linux:
sudo apt install cmake libglpk-dev libhdf5-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libwebp-dev
"Cannot find function" error
Run the Setup chunk in modules/01_quality_control.qmd first.
File not found
- Open the project via
proxiome_analysis_template.Rproj - Check that PXL files are in
data/ - Verify filenames in
metadata.csvmatch exactly
Checkpoint not found
Run the upstream module first to create the missing file in results/checkpoint_data/:
pg_data_merged.rds,selected_markers.rdsβ run module01annotated_seurat_object.rds,markers_to_test.rdsβ run module02to completion
object 'pg_data' not found
Run module 01 from the beginning in this R session, or run the first chunk of modules 03β05 to load from checkpoint.
Memory errors
- Close other applications
- Process fewer samples
- Use a machine with 16GB+ RAM
Need more help? Open an issue Β· pixelatorR issues
| Max Karlsson @maxkarlsson | max.karlsson@pixelgen.com Β· ORCID |
| Vincent van Hoef @vincent-van-hoef | vincent.vanhoef@pixelgen.com Β· ORCID |
License: GNU GPL v2
Made with β€οΈ by Pixelgen Technologies