Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 1.75 KB

README_process_data.md

File metadata and controls

61 lines (44 loc) · 1.75 KB

MultiGen

This repository contains a Python script for processing flow cytometry single-cell data from human hematopoietic stem and progenitor cells (HSPCs). The script loads .csv files, classifies cells based on marker expression thresholds, filters out biologically implausible lineage trees, and saves the cleaned, pooled dataset.

Features

  • Imports and formats experimental single-cell CSV data.
  • Uses user-defined gating thresholds to classify cells into types (e.g., HSC, MPP, CMP).
  • Detects and removes "impossible" family lineages based on generation sizes.
  • Aggregates and exports a cleaned pooled dataset.

File Structure

MultiGen_analysis/
├── csv/
│   └── Single_cell/
│       ├── [input CSV files]
│       └── Pooled_data.csv      # Output file
├── figures/                     # (optional) Output plots
├── pickled_data/                # (optional) Intermediate files
├── Gating_matrix.xlsx           # Gating thresholds

Requirements

  • Python 3.6+

  • Dependencies:

    • pandas
    • numpy
    • matplotlib
    • seaborn
    • scipy
    • openpyxl (for reading .xlsx)

Install with:

pip install -r requirements.txt

Usage

Run the script to process all .csv files in the csv/Single_cell/ directory:

python 0_process_data.py

The cleaned and annotated dataset will be saved as:

MultiGen_analysis/csv/Single_cell/Pooled_data.csv

Customization

  • Gating logic is defined in the cell_class_exp_time() function and driven by thresholds in Gating_matrix.xlsx.
  • Alternate classification schemes using fewer markers (e.g., CD34/CD38 only) are commented out and can be toggled as needed.
  • Modify the cond_rule() function if experimental condition names differ.