amiralavi / scipr Goto Github PK
View Code? Open in Web Editor NEWSingle Cell Iterative Point set Registration (SCIPR) to align scRNA-seq data
Home Page: https://scipr.readthedocs.io
License: Other
Single Cell Iterative Point set Registration (SCIPR) to align scRNA-seq data
Home Page: https://scipr.readthedocs.io
License: Other
Add tensorboard writers. Tensorboard is included in one of our dependencies, pytorch, so it makes sense to interact with it through pytorch.
Add arguments to the SCIPR.fit function:
On SCIPR.fit, add tensorboard tags for:
Add support to feed an adata object into the fit and predict functions, something like:
def fit(self, adata, batch_key, source, target)
Where batch_key
is the name of the column in obsm
which contains the batch annotations, and source
and target
are the batch annotations of the source and target batches.
def transform(self, adata, batch_key, batch, inplace=False)
batch
is the batch annotation for the batch to transform. If inplace==True
then replace the cells (observations) in the adata.X which have the batch
annotation with the new transformed values. Otherwise, return the tuple (transformed numpy.ndarray, row indexer into adata of the transformed cells)
Describe what you were trying to get done.
I 'd like to adapt and use scipr with flow and mass cytomtery data sets.
Tell us what happened, what went wrong, and what you expected to happen.
Using simulated data, MNN matching, and an "affine" transform, the transformed object ends up being a single point repeated N times. If I use "rigid", I get points on a curve.
As input, I simulated a toy 2D data set containing 500 points in 4 clusters (data set "A" in the code below). Then I affine-transformed "A" and called that "B".
Paste the command(s) you ran and the output.
import scipr
from scipr.matching import Closest, Hungarian, Greedy, MNN
from scipr.transform import Affine, Rigid
closest = Closest()
MNN = MNN()
rigid = Rigid()
affine = Affine()
model = scipr.SCIPR(match_algo=MNN,
transform_algo=affine,
input_normalization='l2',
n_iter = 100)
model.fit(A, B)
aligned = model.transform(A)
I get back a single coordinate:
aligned[:5,]
array([[0.71251583, 0.68878496],
[0.71251583, 0.68878496],
[0.71251583, 0.68878496],
[0.71251583, 0.68878496],
[0.71251583, 0.68878496]])
Part of the issue is the matching. If I replace the "match_alg"o with one that just passes a predefined set of matching points, then I get back a transformed object that looks reasonably like the reference, but ONLY if the "transform_algo" is "rigid". For "affine" I get back a straight-line. Any ideas why?
THANK YOU.
Hamid
If there was a crash, please include the traceback here.
Add a boolean flag, "verbosity", set to 0 by default to have quite functions. If things work fine there should be nothing written to stdout. If user sets verbosity > 0, then emit some logging info.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.