Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retinal Aging Project

R and Python analysis code for a comparative retinal aging project integrating single-cell, single-nucleus, spatial transcriptomic, and cross-species aging datasets.

The repository is intended to share the analysis code and project structure used for retinal aging, cell-cell communication, spatial proximity, aging-clock, and region-aware cell-state analyses. Large raw and intermediate data objects are not included.

Project Overview

flowchart LR
  A["Single-cell and single-nucleus retina data"] --> C["Cell annotation and aging-state analysis"]
  B["Xenium spatial transcriptomics"] --> D["Spatial proximity and region-aware analysis"]
  C --> E["Cross-species aging comparisons"]
  D --> E
  E --> F["Cell-cell communication and signaling programs"]
  F --> G["Publication figures and candidate aging mechanisms"]
Loading

Repository Contents

notebooks/
  LRloop_analysis.Rmd          # Cross-species ligand-receptor analysis notebook
  Figure5_v1_20250521.Rmd      # Figure 5-focused communication notebook
  Spatial_analysis.Rmd         # Xenium aging retina spatial proximity notebook
  Spatial_osk_v3.Rmd           # OSK/Xenium spatial and niche notebook
  Proximity.Rmd                # Cell-proximity notebook
scripts/
  r/                            # Smaller R scripts extracted by notebook section
  python/                       # Cleaned Python proximity-analysis utilities
tools/
  extract_notebook_chunks.py    # Rebuilds scripts/r/ from notebooks/
data/
  README.md                    # Expected local data layout
Figures/
  README.md                    # Notes for selected public figure previews
  preview/                     # Small GitHub-friendly preview images

Main Analyses

  • Cross-species retinal aging comparisons across mouse, human, and zebrafish.
  • Ligand-receptor and LRLoop-based cell-cell communication analysis.
  • RPE-focused and major-cell-type signaling analysis.
  • Xenium spatial transcriptomics preprocessing and cell-type annotation.
  • Spatial proximity, age-acceleration, and permutation-based neighborhood analysis.
  • Region-specific expression and spatially localized aging-state analysis.
  • OSK/Xenium niche analysis and aging-clock interpretation.

Figure Previews

Selected low-resolution figure previews are included to make the repository easier to scan on GitHub. Full-resolution figures and generated plotting outputs remain excluded from version control.

Preview Analysis
Figure 5 preview Cross-species ligand-receptor signaling in retinal aging
Figure 7 preview Spatial transcriptomics and region-aware aging analysis
Figure 8 preview OSK/Xenium spatial analysis and aging-clock interpretation

Code Organization

The original R Markdown notebooks are kept in notebooks/ to preserve the full analysis narrative. For easier review and reuse, R code chunks from those notebooks were split into smaller section-level scripts:

  • scripts/r/<notebook>/NN_section_name.R

A cleaned Python proximity-analysis module is available at scripts/python/proximity_effect.py.

The extracted R scripts are generated with:

python3 tools/extract_notebook_chunks.py

Edit the notebooks first when changing the full analysis narrative, then rerun the extractor to refresh the smaller R scripts.

Data Availability

This is a code-first public repository. The analysis notebooks expect local Seurat, RData, h5ad, metadata, and intermediate result files generated in the original analysis environment. These large data objects are intentionally not committed to GitHub.

See data/README.md for the expected local data layout and file types.

Software Requirements

The project uses both R and Python.

Core R packages include:

  • Seurat
  • tidyverse
  • Matrix
  • ggplot2
  • reshape2
  • readxl
  • writexl
  • pheatmap
  • ggrepel
  • ggforce
  • ggvenn
  • viridis
  • RColorBrewer
  • LRLoop

Python sections use tools such as:

  • scanpy
  • pandas
  • numpy
  • scipy
  • spatial-aging-clock or related local proximity-analysis utilities

Running The Code

The notebooks were developed as analysis notebooks rather than turnkey package workflows. To rerun them:

  1. Place required raw and intermediate files according to data/README.md.
  2. Update local path variables near the top of each notebook or chunk.
  3. Install the R and Python dependencies listed above.
  4. Render notebooks from the repository root, run the smaller R scripts under scripts/r/ section by section, or reuse the Python utilities under scripts/python/.

Example:

rmarkdown::render("notebooks/LRloop_analysis.Rmd")
rmarkdown::render("notebooks/Spatial_analysis.Rmd")

Notes For Reviewers

  • This repository prioritizes transparent analysis code over raw-data hosting.
  • Local and intermediate-data paths in the notebooks document the original analysis workflow and should be updated before reuse.
  • Generated .rds, .RData, .h5ad, .xlsx, .csv, and figure outputs are excluded by default unless a small public example is intentionally added.

Author

Yang Jin, PhD

GitHub: https://github.com/jinyangye119

About

R/Python code for comparative retinal aging single-cell and spatial transcriptomics analysis

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages