muscat: Multi-sample multi-group scRNA-seq analysis Tools

repository·main·Indexed 42 days ago

https://github.com/helenalc/muscat

An R package available via Bioconductor for Differential State (DS) analyses in scRNA-seq data across multiple samples, groups, and subpopulations. It provides tools for aggregation-based DS analysis using pseudobulks via aggregateData() and pbDS(), mixed model analysis via mmDS(), and tests for differential detection using pbDD().

Tokens
729
Snippets
4
Records
5
Agent score
4%

What's inside muscat

  1. Prepare SingleCellExperiment metadata for muscat

    main

    The muscat workflows require a SingleCellExperiment object (sce) with specific columns in its cell metadata (colData). You must ensure the following identifiers are present:

    1. sample_id: Unique identifiers for each sample (e.g., PeterPan1, Nautilus7).
    2. group_id: Experimental condition for each sample (e.g., reference/stimulated, healthy/diseased).
    3. cluster_id: Subpopulation or cluster assignments (e.g., B cells, dendritic cells).
  2. Run aggregation-based Differential State (DS) analysis

    main

    Aggregation-based methods involve two steps: first computing pseudobulks by summing counts, then running the differential state analysis on those pseudobulks.

    1. Compute pseudobulks: Use aggregateData() to sum counts by cluster_id and sample_id.
    2. Run DS analysis: Use pbDS() on the resulting pseudobulk object using a specified method (e.g., "edgeR").
    # compute pseudobulks (sum of counts)
    pb <- aggregateData(sce, 
        assay = "counts", fun = "sum",
        by = c("cluster_id", "sample_id"))
        
    # run pseudobulk (aggregation-based) DS analysis
    ds_pb <- pbDS(pb, method = "edgeR")
  3. Install muscat via Bioconductor

    main

    To install muscat, use BiocManager from R. This package is available through the Bioconductor repository.

    if (!requireNamespace("BiocManager", quietly = TRUE))
        install.packages("BiocManager")
    BiocManager::install("muscat")
  4. Test for differential detection

    main

    To test for differential detection (as proposed by Gilis et al., 2025), use the "num.detected" function during aggregation and then apply the differential detection testing methods.

    1. Aggregate binarized counts: Use aggregateData() with fun = "num.detected".
    2. Test for differential detection: Use either pbDD(pb) or pbDS(pb, method = "DD") on the aggregated object.
    # sum binarized counts
    pb <- aggregateData(sce, 
        assay = "counts", 
        fun = "num.detected", # !!!
        by = c("cluster_id", "sample_id"))
    
    # test for differential detection
    dd <- pbDD(pb) # or..
    dd <- pbDS(pb, method = "DD")
  5. Run mixed model Differential State (DS) analysis

    main

    Mixed models can be run directly on cell-level measurements without manual pseudobulk aggregation. Use mmDS() and specify a method such as "dream".

    # Mixed models run directly on cell-level measurements
    ds_mm <- mmDS(sce, method = "dream")