harmony icon indicating copy to clipboard operation
harmony copied to clipboard

Can i obtain my original data shape?

Open leeleavitt opened this issue 11 months ago • 3 comments

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 ($PC$), and outputs corrected principal components ($PC'$).

All applications I've seen using Harmony takes the top $k$ ranks of principal components. Since I need the original data structure, I would input all principal components, assuming my assumptions below are accurate.

The general approach I am considering, is creating my principal components using singular value decomposition (SVD).

$$A = U S V^T$$

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 Harmony normalization, we transform $PC$ into $PC'$.

Harmony normalizes all principal components

$PC \rightarrow Harmony \rightarrow PC'$

I then assume

$PC'$ $\equiv$ $U' S'$ $\equiv$ $(U S)'$

I then reconstruct the original shape of my data, but now the data is normalized,

$(U S)' V^T = A'$

Is this valid?

leeleavitt avatar Mar 06 '24 23:03 leeleavitt