cellrank
cellrank copied to clipboard
BaseModel.prepare() unexpected behaviour
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.
Hi @nrclaudio , thanks a lot for pointing this out, will fix to match the docs!
Hi @michalk8, can we close this?