Skip to content

Is Regressing Covariates in Both ScaleData and RunHarmony Redundant and Potentially Problematic? #262

@vertesy

Description

@vertesy

Hello,

Thank you for this cool method, I had very nice results with it!

When I'm analyzing scRNA-seq data using Seurat and Harmony, I'm regressing out covariates (e.g., library, sample type) at two steps:

  1. During Scaling:
# pseudocode
NormalizeData(obj) |> 
ScaleData(obj, vars.to.regress = c('library', 'sample_type')) |> 
PCA(obj) 
  1. During Batch Correction with Harmony:

library_sample_type = paste0('library', 'sample_type')

RunHarmony(obj, group.by.vars = c('library_sample_type')) -> result

This means I'm addressing the covariates twice—once in ScaleData and again in RunHarmony. My questions are:

  • Is this redundancy problematic?
    • Specifically, could correcting for covariates at both steps lead to overcorrection?
  • What are the potential consequences of regressing out covariates in both steps?
    • Could it affect downstream analyses like clustering or differential expression by reducing variability too much?
  • What would be the recommended best practice?
    • Should I regress out covariates only during RunHarmony or OK to use them in both?
    • E.g. marker heatmap plots are based on ScaleData, that is one reason to correct already at scaling (of course I could redo scaling and PCA after Harmony).

I'd appreciate any guidance on whether I should adjust my workflow to correct for covariates in just one of these steps to avoid problems that you can foresee.

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions