Skip to content

Spatial omics analysis of human LUAD by Visium and PhenoCycler

License

Notifications You must be signed in to change notification settings

Pigeongeon/LUAD-Spatial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LUAD-Spatial

Multimodal spatial omics analysis of human LUAD by Visium and PhenoCycler

DOIT_LUAD3B.py

  • A Python script integrates spatial omics data by 10x Genomics Visium and Akoya Biosciences PhenoCycler.
    • Supposes Visium (not CytAssist) and PhenoCycler-Open (not Fusion) in the example of this repository.
  • Imvokes the following DOIT-xxxx scripts (1 to 8).
    • Tested with Python 3.12.
    • Requires packages such as numpy, pandas, cv2, tifffile, depending on environment.
    • Internally invokes R scripts.
      • Tested with R 4.3.2 and Seurat v4.4.0 (and will be compatible with v5).
  • Results are stored in "FFPE_LUAD_3_B" directory in the current working directory.
% path_to_the_src_directory/src/DOIT_LUAD3B.py

1. DOIT_GetDATA_LUAD3B.py

  • Downloads and expands the datafile (LUAD3B_dat.tgz) in "dat" directory in the current working directory.

2. DOIT_Visium_LUAD3B.py

  • Generates mask images of Visium tissue region using H&E stain images in the output of SpaceRanger ("dat/Visium_FFPE_LUAD_3_B/spatial").
  • Results are browsable from "FFPE_LUAD_3_B/FFPE_LUAD_3_B-Visium-MASK/FFPE_LUAD_3_B-Visium.html".
H&E stain image Fiducial marker removal Binarization Contour extraction Mask image

3. DOIT_PhenoCycler_LUAD3B.py

  • Generate mask images of PhenoCycler tissue region using fluorescence intensity in the QPTIFF data by CODEX Processor ("dat/PhenoCycler_LUAD_3_B/Experiment_LUAD_3_B.qptiff")
  • Results are browsable from "FFPE_LUAD_3_B/FFPE_LUAD_3_B-PhenoCycler-MASK/FFPE_LUAD_3_B-PhenoCycler.html".
Fluorescence image Grayscaling Binarization Contour extraction Mask image

4. DOIT_Normalize_LUAD3B.py

  • Normalizes Visium expression levels by SCTransform normalization (version 1) provided by Seurat.
    • Internally invokes an R script (exec_preprocess.r).
  • Results are browsable from "FFPE_LUAD_3_B/FFPE_LUAD_3_B-Visium-NORM/FFPE_LUAD_3_B-Visium-NORM.html".

5. DOIT_Align_LUAD3B.py

  • Aligns mask images of Visium (red) and PhenoCycler (blue) respectively obtained in step 2 and 3 above.
    • Mask images are scaled, translated, and rotated (affine transformations) to maximize their overlap.
    • Overlap is evaluated by their intersection over union (IoU), i.e., IoU = (Visium ∩ PhenoCycler) / (Visium ∪ PhenoCycler).
    • By exhaustive grid search in the neighborhood of the solution obtained above, IoU is optimized to generate the final result.
  • Results are browsable from "FFPE_LUAD_3_B/FFPE_LUAD_3_B-ALIGN/FFPE_LUAD_3_B-Visium-PhenoCycler-ALIGN.html".
Scaling Translation Rotation Optimization

FFPE_LUAD_3_B_transition_wh_200.mp4

6. DOIT_Eval_LUAD3B.py

  • Evalutes correlation between Visium gene expression level and PhenoCycler antibody fluorescence intensity.
    • In circular regions corresponding to Visium spots average of fluorescence intensities are calculated.
    • Spatial and quantitative correlations are evaluated.
  • Results are browsable from "FFPE_LUAD_3_B/FFPE_LUAD_3_B-EVAL/FFPE_LUAD_3_B-EVAL.html".

Example of comparison

  • MS4A1 gene expression by Visium and CD20 antibody fluorescence intensity by PhenoCycler.
Spatial correlation Quantitative correlation

7. DOIT_Clustering_LUAD3B.py

  • Carries out clustering of Visium spots by Seurat.
    • Internally invokes an R script (exec_clustering.r).
    • Carries out dimensionality reduction and extracts spatially variable features.
  • Results are browsable from "FFPE_LUAD_3_B/FFPE_LUAD_3_B-Visium-CLST/FFPE_LUAD_3_B-Visium-CLST.html".

8. DOIT_GetROI_LUAD3B.py

  • Extracts an aligned/integrated region of interest (ROI) image based on mutual coordinate mapping.
  • Results are browsable from "FFPE_LUAD_3_B/FFPE_LUAD_3_B-ROI/FFPE_LUAD_3_B-ROI.html".

Mutual coordinate mapping

PhenoCycler image coordinate
(Visium on PhenoCycler)
Visium image coordinate
(PhenoCycler on Visium)

Example of projection of a ROI in PhenoCycler image onto Visium image

A region in the PhenoCycler coordinate Projection onto the Visium coordinate

Example of an integrated ROI (1)

  • Cell (nuclear) positions estimated by QuPath/StarDist.
    • Colors show the estimated cell types.
    • Cell number of each type in the ROI is profiled.
    • Positions of Visium spots are indicated by circles.
  • Heatmap of fluorescence intensity by PhenoCycler (superimposed).
  • Heatmaps of fluorescence intensity of antibodies by PhenoCycler.
DAPI E-cadherin CD4 CD8 CD20 CD68
  • Heatmaps of expression level of features/genes by Visium.
H&E stain CDH1 CD4 CD8A MS4A1 CD68

Example of an integrated ROI (2)

  • Cell (nuclear) positions estimated by QuPath/StarDist.
    • Colors show the estimated cell types.
    • Cell number of each type in the ROI is profiled.
    • Positions of Visium spots are indicated by circles.
  • Heatmap of fluorescence intensity by PhenoCycler (superimposed).
  • Heatmaps of fluorescence intensity of antibodies by PhenoCycler.
DAPI E-cadherin CD4 CD8 CD20 CD68
  • Heatmaps of expression level of features/genes by Visium.
H&E stain CDH1 CD4 CD8A MS4A1 CD68

About

Spatial omics analysis of human LUAD by Visium and PhenoCycler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.0%
  • R 9.0%