Linear OT implementation for domain adaptation for aligning parallel unpaired scRNA/scATAC
- numpy
- scipy
Inputs are
xs
, a matrix of "source" RNA expression levels from scRNA-seqxt
, a matrix of "target" gene activities calcualated from ATAC-seq peak accessibility
Also, optionally:
ws
: vector of weights representing the size of each cluster/metacell from RNAwt
: same as above but for ATAC- rho: float in range [0,1] representing whether the final transformation should be closer to RNA distribution (0) or ATAC distribution (1). Default value is 1.
- reg: small float to make sure covariance matrices are invertible
xs
and xt
should be dense matrices representing expression of highly variable genes.
To get transformed aligned xs
and xt
, run the following:
from barycenter import LinearOT
model = LinearOT()
xs_transformed, xt_transformed = model.fit_transform(xs, xt)