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

how to get mapping matrix from ST alignment task #776

Open
yuling999666 opened this issue Jan 5, 2025 · 4 comments
Open

how to get mapping matrix from ST alignment task #776

yuling999666 opened this issue Jan 5, 2025 · 4 comments

Comments

@yuling999666
Copy link

Hi @ilibarra , I would like to ask how to get mapping matrix for alignment? Do you compute it? I didn't find it in your code. Thanks.

@yuling999666
Copy link
Author

Hi @MUCDK , I have solved this issue: solutions = ap.solutions

Access the computed solutions

for cur_idx in range(1,len(slice_ids)):
index=str(slice_ids[cur_idx-1])+'_'+str(slice_ids[cur_idx])
map_path=osp.join('/home/data3/yuling/xenium_region2_5599/moscot/mHy', index+'_AlignmentPi.pkl')
with open(map_path, "wb") as f:
pkl.dump(solutions[tuple([str(cur_idx-1), str(cur_idx)])].transport_matrix, f)
But right now, I have another question. After I read about method for the paper, I think alignment method is a deterministic algorithm, no randomness will be generated during this course. Is that correct? Thank you!

@MUCDK
Copy link
Collaborator

MUCDK commented Jan 8, 2025

Hi @yuling999666 ,

This is correct!

And yes, the mapping is determinisstic.

@yuling999666
Copy link
Author

Hi @yuling999666 ,

This is correct!

And yes, the mapping is determinisstic.

Hi @MUCDK , thank you for your reply. Do you mean the whole process for alignment including getting aligned spatial coordinates is deterministic? Thanks.

@MUCDK
Copy link
Collaborator

MUCDK commented Jan 8, 2025

Yes, note that (F)GW (the underlying alg.) is not guaranteed to converge to the global minimum and the solution is not unique, but it's still deterministic. Do you observe non-deterministic behaviour or why are you asking?

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

2 participants