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

output the raw cell transition data without aggregation #733

Closed
Xian123123123 opened this issue Jul 10, 2024 · 7 comments
Closed

output the raw cell transition data without aggregation #733

Xian123123123 opened this issue Jul 10, 2024 · 7 comments

Comments

@Xian123123123
Copy link

Hi, thank you for the amazing work!
How could one output the raw cell transition data without aggregation? For example, in 200_cell_transitions.ipynb, is it possible to output the entire source x target matrix? thanks.

@MUCDK
Copy link
Collaborator

MUCDK commented Jul 10, 2024

Hi @Xian123123123 ,

I guess that you just wanna have the transport matrix then?

You can access this via tp[t_0, t_1].solution.transport_matrix, see https://moscot.readthedocs.io/en/latest/genapi/moscot.backends.ott.OTTOutput.transport_matrix.html#moscot.backends.ott.OTTOutput.transport_matrix

@Xian123123123
Copy link
Author

Yes. Could you share an example code? Thanks.

@Xian123123123
Copy link
Author

Thank you @MUCDK , how can I generate the full transport matrix from 700_tutorial_perturbation_with_Sinkhorn.ipynb (i.e. between a drug and the control)?

@MUCDK
Copy link
Collaborator

MUCDK commented Jul 12, 2024

you can use e.g. sp['Dacinostat (LAQ824)', 'control'].solution.transport_matrix

@Xian123123123
Copy link
Author

thank you @MUCDK. with the full transport matrix, how does one decide which link is "real", i.e. how does one define a threshold?

@MUCDK
Copy link
Collaborator

MUCDK commented Jul 25, 2024

First, this depends on the entropy regularisation. The higher epsilon is, the higher the stochasticity . Hence, there is no single answer to this.

You could take the argmax for each row, or use the sparsification method to set a large number of the entries to 0: https://moscot.readthedocs.io/en/latest/genapi/moscot.base.output.BaseSolverOutput.sparsify.html#moscot.base.output.BaseSolverOutput.sparsify

@MUCDK
Copy link
Collaborator

MUCDK commented Oct 15, 2024

I'm closing this for now. Please reopen if necessary.

@MUCDK MUCDK closed this as completed Oct 15, 2024
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