Closed tcompa closed 7 months ago
Ah, we missed that one!
In the original table spec proposal, it said:
"instance_key", which is the key in
obs
that denotes which instance in "region" the row corresponds to
Thus, we were using obs because the proposal was using obs. Also, given that labels should be integers (which can be stored as strings fine), I guess saving them as floats can be suboptimal (though could be handled with casting to int with correct rounding).
In any case, having labels in obs seems to be a standard way to use AnnData. The reasoning being that this is not a measurement of the object, but something that describes which object is measured => should go in obs.
Thus, let's go with 1:
- Keep current implementation and update the specs, saying the labels (or whatever is defined as instance_key) go in the obs attribute. This is the one that takes least effort.
What we wrote in the table specs is that for tables of type
masking_roi_table
andfeature_table
the following condition is neededThis is a very natural way of storing the information that links to another table, but it does not correspond to the current fractal-tasks-core implementation, where the list of labels is stored within the
obs
attribute of the AnnData object - see for instance these snippet where we write/read the table:I'm not 100% sure of why we made this choice in the past, but my vague memory is that it was related to the fact that we wanted labels to be string and maybe it was hard to place them in the AnnData
X
attribute.What should we do? (cc @jluethi)
Two options:
instance_key
) go in theobs
attribute. This is the one that takes least effort.obs
attribute.