dynverse / dyno

Inferring, interpreting and visualising trajectories using a streamlined set of packages 🦕
https://dynverse.github.io/dyno
Other
163 stars 32 forks source link

Batch Effect #115

Open angarb opened 2 years ago

angarb commented 2 years ago

I'm new to dynverse and I had a question regarding running your analysis with a dataset that has batch effect.

I noticed that the initial input is counts and normalized counts. To correct for batch effect in our data, we used Harmony - which corrects the PCs (and not the counts). Therefore, I was curious if I can I use dynverse ... Have you encountered a similar situation?

daymegr commented 2 years ago

I was just about to make an issue when I saw yours @angarb. I am analyzing two samples with batch effects. I integrated them using Seurat and I calculated PCA on the integrated dataset, then I converted the object to SCE. I added the PCA dims to the dyno dataset by doing this: dyno_dataset <- wrap_expression(expression = t(as.matrix(logcounts(sce))), counts = t(as.matrix(counts(sce)))) dyno_dataset <- add_dimred(dyno_dataset, reducedDim(sce, "PCA"))

However, the infer_trajectories function (at least with paga_tree) is not taking into account the PCA comps I added, it is calculating it on its own. I verified this by running the method without adding any dim red beforehand, and I got the same exact results. Is there a way to calculate the trajectory based on my own dimensionality reduction coordinates?

Thanks!