moscot icon indicating copy to clipboard operation
moscot copied to clipboard

`TranslationProblem.prepare` method can't set `joint_attr={"attr":"X"}`

Open selmanozleyen opened this issue 10 months ago • 2 comments

When I try to run this

tp = tp.prepare(batch_key="batch", src_attr=src_attr, tgt_attr=tgt_attr, joint_attr={"attr": "X"})

TemporalProblem will give an error because of this line https://github.com/theislab/moscot/blob/3151da7b324672fab6757b8a84bcd1d0bcb9f027/src/moscot/problems/cross_modality/_translation.py#L167 with the message KeyError: 'x_key'

selmanozleyen avatar Apr 09 '24 12:04 selmanozleyen

Thanks @selmanozleyen , good catch. It happens because of this: https://github.com/theislab/moscot/blob/3151da7b324672fab6757b8a84bcd1d0bcb9f027/src/moscot/problems/_utils.py#L26

Now I am wondering whether this scenario is realistic, as the joint attribute in the case you describe would be the full gene space (no dim. reduction).

Still I think it's fair to implement it. The easiest way would be to do an if-else statement to get the shapes (i.e. where it fails atm). wdyt?

MUCDK avatar Apr 10 '24 07:04 MUCDK

Now I am wondering whether this scenario is realistic, as the joint attribute in the case you describe would be the full gene space (no dim. reduction).

@MUCDK yeah I can do it, just wanted to check with the use case, if I should implement it or throw an error etc.

selmanozleyen avatar Apr 17 '24 09:04 selmanozleyen