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

Adjacent Pairwise Alignment #789

Open
DruncBread opened this issue Jan 24, 2025 · 6 comments
Open

Adjacent Pairwise Alignment #789

DruncBread opened this issue Jan 24, 2025 · 6 comments
Assignees

Comments

@DruncBread
Copy link

Hi,

I wonder if there is any way I could perform adjacent pairwise alignment with moscot
Like slice1 aligned to slice0, slice2 aligned to slice1, slice3 aligned to slice2.....

It would be great if you could explain this to me! Thank you!

Best regards.

@MUCDK
Copy link
Collaborator

MUCDK commented Jan 24, 2025

Hi,

This should work with the "sequential" policy.

Check out this example https://moscot.readthedocs.io/en/latest/notebooks/examples/problems/400_subset_policy.html and lmk if you have further questions.

@MUCDK
Copy link
Collaborator

MUCDK commented Jan 24, 2025

@ArinaDanilina let's add a sequential and Starpolicy example to https://moscot.readthedocs.io/en/latest/notebooks/examples/problems/400_subset_policy.html for the AlignmentProblem as we currently only show examples in the temporal domain there

@DruncBread
Copy link
Author

Thank you very much for your guidance!
I check out the "sequential" policy and it should work for me.
But I want to be sure if this means that slice1 will be aligned to slice0:
(0, 1): BirthDeathProblem[stage='prepared', shape=(20, 20)]

@DruncBread
Copy link
Author

Hi,

later when I tried to transform the coordinate
ap.align(reference=sample_ids[0], mode="warp", spatial_key="spatial", key_added="spatial_warp_sequential")
Does that mean all the slices' coordinates will be aligned to slice0 (sample_ids[0]) ?

Is there any way to transform the coordinate sequentially?

@MUCDK
Copy link
Collaborator

MUCDK commented Jan 30, 2025

Hi,

This is correct, with ap.align(reference=sample_ids[0], mode="warp", spatial_key="spatial", key_added="spatial_warp_sequential") you will align the coordinates of slice 1 to slice 0.

Can you please specify what you mean by transform the coordinate sequentially? I assume you have multiple slices (>2). In case you wanna map 1->2, 2->3, 3->4, etc. , you have two options:

  • either instantiate three different AlignmentProblems, and instantiate those only with the relevant slides, and thus do pairwise alignments.
  • or have only one AlignmentProblem with all slides and the sequential policy, then align aligns all other slides to the reference, e.g. 1->4, 2->4, 3->4, but 1->4 will not be aligned by using one transport map only (because you only computed transport maps sequentially, but it will be transformed by "chaining" mulitple transport maps).

Is this clear?
Pinging @giovp, do you have anything to add?

@DruncBread
Copy link
Author

Thank you very much, MUCDK! It was really helpful!

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

No branches or pull requests

3 participants