Skip to content
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

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Conversation

LeonHafner
Copy link

initial moscot module, right parameter configuration TBD

Copy link
Author

@LeonHafner LeonHafner left a 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"]
Copy link
Author

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?

Copy link
Author

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"},
Copy link
Author

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?

Copy link
Author

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:

  1. directly using normalized counts by passing sc_attr={"attr": "layers", "key": "normalized"}
  2. 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",
Copy link
Author

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.

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant