snap-stanford / GEARS

GEARS is a geometric deep learning model that predicts outcomes of novel multi-gene perturbations
MIT License
189 stars 38 forks source link

Matching to Different Set of Controls #41

Closed GordianArnav closed 8 months ago

GordianArnav commented 9 months ago

Is there a way to match 'A+ctrl1' to 'ctrl1' cells and 'A+ctrl2'to 'ctrl2' in the same adata object?

yhr91 commented 8 months ago

This is possible but would require some changes to the dataloader

Specifically, in this section, for each sample perturbed cell the dataloader will randomly pick a control cell as the basal state Xwhich is appended to the vector of basal states Xs

https://github.com/snap-stanford/GEARS/blob/df09d7ae34e90f5ef25afa389daf7c5c589e710d/gears/pertdata.py#L578-L584

You would have to update this code to choose from different control populations based on the perturbed cell.

It sounds straightforward but the actual implementation may end up requiring additional changes. We've been experimenting with something similar internally. Let me know if you have any other questions.