-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can i obtain my original data shape? #247
Comments
Hi @leeleavitt , thanks for using harmony! Please correct me if my understanding is wrong: I think you want to use harmony to do batch correction for the original data (count matrix or log normalized data) instead of PCs, i.e., 1) convert the original data (count matrix or log normalized data) to PCs, 2) use harmony to perform batch correction on PCs to get corrected PCs, 3) convert the corrected PCs back to original data format (count matrix or log normalized data). |
Yes exactly |
Hi @leeleavitt , first I think what you proposed is doable and valid in terms of the equation, but there are mainly two issues associated with this idea.
Of course, there is nothing to prevent you from using harmony this way and my suggestion would be to reduce the number of PCs as much as possible if you encounter computational problems. Depending on your purpose, it may not be too bad to approximate with the top N PCs |
I would like to use
Harmony
to normalize my data, but i need the original shape to use in other part of my analytical pipeline.Harmony
takes as input principal components (All applications I've seen using$k$ ranks of principal components. Since I need the original data structure, I would input all principal components, assuming my assumptions below are accurate.
Harmony
takes the topThe general approach I am considering, is creating my principal components using singular value decomposition (SVD).
Where$U$ and $V$ are orthogonal matrices, and $S$ is a diagonal matrix containing the singular values.
Assuming$U * S$ can be represented as all possible principal components $PC$ . Through $PC$ into $PC'$ .
Harmony
normalization, we transformHarmony normalizes all principal components
I then assume
I then reconstruct the original shape of my data, but now the data is normalized,
Is this valid?
The text was updated successfully, but these errors were encountered: