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

Address a potential problem while creating a training dataset with dense array inputs #78

Open HelloWorldLTY opened 1 month ago

HelloWorldLTY commented 1 month ago

Hi, I notice that the current pre-processing step for creating the dataset assumes input data are formed as sparse data (adata.X is sparse matrix), so if the input data form as dense matrix, there will be an error:

image

Therefore, I modify the current codes which will be suitable for either sparse matrix or dense matrix as inputs.

Moreover, I also notice that gears will compute DEGs for the further work related to metrics, but if there is only one cell under such perturbation, an error will be thrown:

image

Therefore, I also recommend modifying the tutorial to warn such condition. Thanks.