Skip to content

wdartora/CosMx_Giotto_Transcriptomics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Spatial Transcriptomics Pipeline Using Giotto

This pipeline is designed for the analysis of spatial transcriptomics data using the Giotto package in R. It processes CosMx subcellular transcriptomics data, performs data visualization, and conducts clustering and dimension reduction analyses. The pipeline includes various steps such as data loading, feature extraction, normalization, clustering, and visualization.

Setup

Install required packages:
Install and load the Giotto package along with any other dependencies like data.table, and ensure a working Python installation with required libraries.

Configure paths:

Set the working directory and provide paths for:


Data files (transcript coordinates, field of vision positions, etc.)
Output directory for saving results.
Python environment:
Optionally, specify the path to a Python executable within a conda environment.

Steps in the Pipeline

  1. Create Giotto CosMx Object
    Loads spatial transcriptomics data from the specified directory.
    Creates a Giotto object containing subcellular transcript data and field of views (FOVs).
  2. Data Exploration and Feature Extraction
    Loads and inspects subcellular detection information.
    Filters and separates features from negative probes.
    Visualizes the spatial distribution of features and probes.
  3. Create Giotto Objects for FOVs
    Processes each FOV, creating Giotto objects that include subcellular data, segmentation masks, and feature coordinates.
  4. Join FOVs
    Combines data from multiple FOVs into a single Giotto object, aligning them based on provided offsets.
  5. Visualize Cells and Features
    Generates various spatial and in situ plots of feature distributions across cells.
    Visualizes cell centroids and feature-specific expression.
  6. Aggregate Features and Normalize Data
    Aggregates subcellular features into cell-level data.
    Performs data filtering and normalization (log-normalization and Pearson residuals method).
  7. Dimension Reduction
    Detects highly variable genes and performs PCA and UMAP.
    Plots PCA and UMAP results to visualize feature distributions.
  8. Clustering
    Constructs a nearest-neighbor network and applies Leiden clustering.
    Visualizes clustering results spatially and across dimension-reduced space.
  9. Small Subset Visualization
    Extracts a small region of interest from the Giotto object based on spatial coordinates.
    Visualizes genes and clustering results within the subset.
    Custom Color Palettes
    The pipeline uses custom color palettes for plotting, defined at the beginning of the script (pal10, viv10, pal13). You can modify these to customize the appearance of the plots.

The pipeline produces a variety of outputs:


Plots for feature and cell distribution in spatial and dimension-reduced space.
Aggregated and normalized expression matrices.
Clustered cell populations, visualized through UMAP and spatial plots.
Saving Results
Plots and output files are automatically saved to the specified results_folder. You can adjust the save directory and other plot options using the instrs object, which controls the behavior of Giotto's plotting functions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages