[feat] Add gene expression and cell types over time - #132
Conversation
This change makes it easier for the perturbation to be set going forwards.
1. Cell type proportions return trajectory 2. Can properly measure trajectory => timepoints x cell types 3. Classifier renormalizes by default 4. We solve OT-CFM for renormalization
According to the cell type trajectory that's provided here.
We redid this so that later on it'll be easy to extend for the genes.
For the perturbation, we now plot the max and min expression over cells as well, to get a better understanding of the distribution.
This applies a global perturbation for data going from t to t + 1
| predicted_ann_data = sc.AnnData(predicted_x) | ||
| predicted_ann_data = log_normalize_to_counts( | ||
| undo_log_normalization(predicted_ann_data) | ||
| ) |
There was a problem hiding this comment.
what's the reason for this step? we would need to do this in all methods to remain consistent - were the count distributions completely off without it?
There was a problem hiding this comment.
Yeah so OT-CFM would explode the counts otherwise, so clipping it and then renormalizing it was the best way to get it done properly
There was a problem hiding this comment.
ok do we reckon we do it for all methods or on a case-by-case?
There was a problem hiding this comment.
I guess I can go through the others and see if it's a recurring issue - if so it's worth raising as a general problem or highlighting as just an OT-CFm thing
There was a problem hiding this comment.
Ouhh yeah good idea, actually I think something that would be good generally would be to move everything (generate_next_gex, etc.) to rely on a separate move_gex_t_t1 instead. Will raise this in an issue, and then we can force it to be an all methods thing.
aosakwe
left a comment
There was a problem hiding this comment.
LGTM - just see comment about the un-norm + log-norm step in the loop
Alongside with some OT-CFM fixes, we added the ability to measure gene expression and cell types over time.