-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add moscot #16
base: dev
Are you sure you want to change the base?
Add moscot #16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently unsure to me what those parameters of the MappingProblem.prepare()
function do.
assert "centroid_x" in adata_sp.obs and "centroid_y" in adata_sp.obs, '"Observation level columns "centroid_x" and "centroid_y" are required for spatial anndata' | ||
|
||
# Use normalized layer and create spatial obsm | ||
adata_sc.X = adata_sc.layers["normalized"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normalized data or raw counts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated in Mapping Gene Expression Space tutorial from the Moscot documentation, we should use normalized data:
Usually, it’s the X attribute, which contains normalized counts...
|
||
# TODO: check parameters: sc_attr, xy_callback, x_callback, y_callback | ||
mp = mp.prepare( | ||
sc_attr={"attr": "obsm", "key": "X_pca"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use X_pca
, X_umap
or adata.X
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Mapping Gene Expression in Space tutorial gives us to options:
- directly using normalized counts by passing
sc_attr={"attr": "layers", "key": "normalized"}
- using the pre-computed PCA by passing
sc_attr={"attr": "obsm", "key": "X_pca"}
Usually, it’s the X attribute, which contains normalized counts, but a pre-computed PCA could also be used.
So we probably use the X attribute, but I run some tests using the pca as well to examine the differences in the results.
# TODO: check parameters: sc_attr, xy_callback, x_callback, y_callback | ||
mp = mp.prepare( | ||
sc_attr={"attr": "obsm", "key": "X_pca"}, | ||
xy_callback="local-pca", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what xy_callback
does and how it compares the x_callback
and y_callback
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Passing Callbacks in Prepare Example explain the use of those parameters:
The callback argument states which computation should be run on X to get the joint cost when preparing the problem. [...].
To create a joint PCA embedding between two sets of genes, we compute the PCA embedding for pairs of distributions by passing xy_callback="local-pca" to run on X.
Since it is also used in the Annotation Mapping Example, I would opt for using the local-pca
callback.
initial moscot module, right parameter configuration TBD