SignalSift

Inferring Transcription Factor Activity from Single-Cell RNA-Seq Data

Analysis of Transcription Factor Activity in PBMC Dataset

Summary

This project details the computational analysis of a single-cell PBMC dataset to infer transcription factor (TF) activity regulating cellular identity. Navigating around persistent bioinformatics library compatibility issues, the project pivoted to a successful manual AUCell-like implementation using Python and Scanpy. The resulting workflow processes raw single-cell data, applies a curated TF-target knowledge base (DoRothEA), and generates insightful UMAP visualizations of differential TF activity across cell clusters.

Initial Project Plan

The primary goal was to preprocess a public human peripheral blood mononuclear cell (PBMC) dataset and infer the activity of key transcription factors (TFs) regulating cellular identity using an AUCell-like approach, followed by visualization. The planned workflow included:

  • Setup: Install necessary bioinformatics libraries.
  • Data Preparation: Load and preprocess raw single-cell data.
  • Load Knowledge Base: Import regulatory databases (e.g., DoRothEA) mapping TFs to target genes.
  • Network Building: Construct gene regulatory networks (regulons).
  • Activity Calculation: Score regulon activity in each cell (AUCell).
  • Integration: Merge AUCell scores into the main AnnData object.
  • Visualization: Generate plots to visualize regulon activity.
  • Completion: Finalize the analysis.

Execution and Troubleshooting

Initial data preparation was smooth, but challenges with bioinformatics libraries necessitated a pivot to a manual AUCell-like implementation.

Phase 1: Data Loading and Preprocessing

All standard preprocessing steps were executed using the scanpy library on the pbmc3k dataset.

  • Setup and Loading: Installed libraries and loaded the dataset into an AnnData object.
  • Quality Control (QC): Calculated, visualized, and filtered data based on QC metrics to remove low-quality cells and genes.
  • Normalization and Feature Selection: Normalized data, applied log-transform, and identified highly variable genes.
  • Dimensionality Reduction and Clustering: Scaled data, performed PCA, computed a neighborhood graph, ran UMAP, and applied Leiden clustering.

Key Outputs:

  • QC Violin Plots: figures/violinqc_violin_plots.png
  • Highly Variable Genes Plot: figures/filter_genes_dispersionhighly_variable_genes.png
  • PCA Variance Ratio Plot: figures/pca_variance_ratiopca_variance_ratio.png
  • UMAP of Leiden Clusters: figures/umap_leiden_clusters.png

Phase 2: Overcoming Library Challenges

Significant roadblocks were encountered during the core analysis phase.

  • Challenges with decoupler: Persistent AttributeError and ModuleNotFoundError issues indicated installation or compatibility problems, unresolved despite reinstallation.
  • Challenges with pySCENIC: Attempts to use pySCENIC failed due to inaccessible scenicplus package and ModuleNotFoundError issues with core functions for AUCell score calculation.

Phase 3: Successful Manual Implementation

A manual AUCell-like scoring method was implemented to overcome library issues.

  • Loading the Knowledge Base: Loaded and formatted DoRothEA TF-target gene relationships using omnipath and pandas, creating a clean regulons dictionary.
  • Custom Scoring Script: Developed a Python script to calculate AUCell-like scores based on gene expression ranks and the regulons dictionary, stored in adata.obsm['aucell_estimate'].
  • Final Visualization: Visualized the inferred activity of TF E2F8 on a UMAP plot, showing differential activity across clusters.
    • Output: figures/umap_E2F8_activity.png

Conclusion and Summary of Phases

Despite challenges with decoupler and pySCENIC, the project achieved its core goal through a manual AUCell-like implementation, successfully inferring and visualizing TF activity.

  • Phase 1: Data Acquisition and Preprocessing: Complete. Successfully acquired, cleaned, normalized, and clustered the single-cell data.
  • Phase 2: Core Analysis and Inference: Complete (with adaptation). Substituted the failed VIPER method (via decoupler) with a custom AUCell-like scoring method.
  • Phase 3: Validation and Visualization: Partially Complete. Visualized TF activity as planned, but further statistical validation or model export was not pursued, as the primary goal was achieved.

© Balaji Ramanathan