Skip to content

Latest commit

 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microglia Sorting — Analysis Code

Computational analysis code accompanying A roadmap for enriching rare cell populations from human post-mortem brain, demonstrated by 100% microglial purity.

Isidora Gocmanac ORCID iD, Hiranyamaya (Hiru) Dash ORCID iD, Maria Weinert ORCID iD, Alexi Nott ORCID iD, Elina Nagaeva ORCID iD, and Nathan Skene ORCID iD.

UK Dementia Research Institute, Imperial College London.

The single-nucleus RNA-seq analyses validate the purity of FANS-sorted nuclei from human post-mortem cortex and cerebellum across a series of antibody-panel configurations. The pipeline ingests gene-by-barcode count matrices, performs per-sample quality control, clustering and reference-based annotation, and produces the per-sample UMAP, feature and composition figures presented in the paper. Experimental detail — donors, antibodies, gating strategy, library preparation — is described in the Methods section of the paper; this README covers only what is needed to reproduce the computational results.

Preparing the data

The processed sequencing data are deposited on NCBI GEO under accession GSE333448 (gene-by-barcode count matrices).

The pipeline reads the per-sample filtered_feature_bc_matrix outputs (DRAGEN single-cell RNA / Cell Ranger format). To run end-to-end from GEO:

  1. Download the processed-matrix archive for GSE333448 and unpack each sample into its own folder under data/matrices/<cohort>/<sample>/filtered_feature_bc_matrix/ containing matrix.mtx.gz, barcodes.tsv.gz and features.tsv.gz. <cohort> is test (the panel-development sorts) or final (the five-population confirmatory sorts, occipital and parietal); <sample> is the SK* identifier as listed in Supplementary Table 3.
  2. Ensure data/matrices/<cohort>/sample_metadata.tsv is present (tracked in the repo). It maps each sample folder to its brain region and a display label; rows with NA labels are skipped on load.

Both data/ and output/ are git-ignored and are not included in this repository.

Running the analysis

The pipeline is R-based (Seurat + tidyverse) and runs from the repo root. Each cohort has its own numbered scripts; run them in order:

# Method development experiments (test group)
for f in scripts/test/0*.R; do Rscript "$f"; done

# Final, confirmatory experiments (final group)
for f in scripts/final/0*.R; do Rscript "$f"; done

Scripts write checkpoints to output/<cohort>/checkpoints/ between steps, so any individual stage can be re-run without repeating earlier ones. The step between 04a_export_mapmycells.R and 04b_import_mapmycells.R involves a manual round-trip through the Allen Institute MapMyCells web tool — export the H5AD file produced by 04a, upload it using the 10x Whole Human Brain taxonomy (CCN202210140), and place the returned annotation CSV in the location expected by 04b (see the path constant at the top of that script).

Running with Docker

A published image bundles R, the analysis scripts and the full software stack (including the Python/anndata environment that zellkonverter needs for the MapMyCells export), pinned to a fixed Bioconductor release for reproducibility. Data and outputs are kept outside the image.

docker pull ghcr.io/neurogenomics/microglia-sorting:latest
docker run -it \
  -e PASSWORD=bioc \
  -p 8787:8787 \
  ghcr.io/neurogenomics/microglia-sorting:latest

# Inside the container: download the GSE333448 matrices into the expected layout,
#   data/matrices/<cohort>/<sample>/filtered_feature_bc_matrix/{matrix,barcodes,features}...
# then run a cohort end-to-end:
for f in scripts/final/0*.R; do Rscript "$f"; done

To keep inputs and outputs on the host instead of inside the container, bind-mount them:

docker run -it \
  -v "$PWD/data:/microglia-sorting/data" \
  -v "$PWD/output:/microglia-sorting/output" \
  -e PASSWORD=bioc \
  -p 8787:8787 \
  ghcr.io/neurogenomics/microglia-sorting:latest

You can then access Rstudio at localhost:8787 in your browser (user: rstudio, password: bioc) and run the scripts interactively, or run them from the command line as above.

On RAM-tight machines, lower the per-sample clustering parallelism (step 05) with docker run -e MICROGLIA_WORKERS=2 ... (set to 1 to force serial execution). The MapMyCells round-trip between 04a and 04b is still a manual web step as described above.

Software requirements

Running with Docker (above) requires only Docker. To run the scripts directly you need:

  • R ≥ 4.6
  • Bioconductor = 3.23
  • Seurat ≥ 5.0
  • tidyverse, DoubletFinder (GitHub-only), and the Bioconductor packages SingleCellExperiment, S4Vectors and zellkonverter, plus their dependencies (see the library() calls in 01_load.R, 02_qc.R and 04a_export_mapmycells.R)

Citation

If you use this code, please cite:

Gocmanac I, Dash H, Weinert M, Nott A, Nagaeva E & Skene NG. A roadmap for enriching rare cell populations from human post-mortem brain, demonstrated by 100% microglial purity. (citation to be completed on publication)

License

MIT — see LICENSE.

About

Analysis code for Robust fluorescence-activated microglia enrichment from human post-mortem brain (Gocmanac, Dash, Nagaeva & Skene; UK Dementia Research Institute, Imperial College London).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Packages

Contributors

Languages