cellrank icon indicating copy to clipboard operation
cellrank copied to clipboard

BaseModel.prepare() unexpected behaviour

Open nrclaudio opened this issue 5 months ago • 2 comments

According to the documentation of BaseModel.prepare() if there's no Lineage specified, the weights will be set to 1. In such case Line 366

probs = Lineage.from_adata(self.adata, backward=backward)

throws a KeyError: "Unable to find lineage data in adata.obsm['lineages_fwd']:

Therefore Line 432 is never reached :

if lineage is not None:
    weight_threshold, val = weight_threshold
    w = _densify_squeeze(probs.X, self._dtype)
    w[w < weight_threshold] = val
else: 
    w = np.ones(len(x), dtype=self._dtype) ##432

I know having no lineage computed is non-standard functionality within your pipeline, but I thought it might be worth bringing it up.

nrclaudio avatar Jan 19 '24 17:01 nrclaudio