Closed YiweiNiu closed 6 months ago
Hi! Yes, I would still recommend enabling CHOIR's internal batch correction by setting parameter batch_correction_method
to "Harmony" and parameter batch_labels
to the name of the cell metadata column containing your batch info.
Since you're starting at the pruneTree
step, this won't change your provided dimensionality reductions at all, but will ensure that the random forest classifiers are not biased by potential remaining batch effects in your cell x feature matrix.
A bit of explanation— Relative batch composition will naturally vary a bit across clusters, particularly at the bottom of the clustering tree, where you have more clusters. For example, say we have a hypothetical case where CHOIR is comparing cluster A (composed of 75% cells from batch 1 and 25% cells from batch 2) to cluster B (composed of 25% cells from batch 1 and 75% cells from batch 2). In this case, the random forest classifiers may learn to some degree to associate the signature of batch 1 with cluster A, and batch 2 with cluster B. We don't want the decision to split/merge these clusters to be biased by the batch composition, because this may lead to overclustering. With CHOIR's batch correction enabled, cells from each batch are compared separately to determine whether the clusters should be merged, avoiding this potential bias.
Hi, thank you very much for your awesome explanation! I found that currently CHOIR only supports using Harmony to correct one covariate (it gives errors when using two covariates for batch_labels
). I was wondering if there's any workaround to include more than one covariate to correct?
CHOIR can only handle 1 batch variable, so I think the best solution is probably to create a new metadata column with the two batch covariates pasted together.
Got it, thanks!
Hi,
Thanks for developing this useful tool! I would like to start with pruneTree function, with Harmony corrected reduction and adjacency matrices provided. Specifically, I want to adapt the codes from https://github.com/corceslab/CHOIR/issues/6#issuecomment-1926119318, like this:
In this way, I was wondering if it's necessary to correct batches in this function, considering that the
cluster_tree
andsnn_matrix
are both based on Harmony corrected dimension reduction.Thanks!