snap-stanford / GEARS

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

Inference of a new gene #13

Closed ShahrzadH closed 1 year ago

ShahrzadH commented 1 year ago

I am have installed gears and trained and saved the model. I ma trying ti use it for inference, as it was suggeste din README.using this example:

predict

gears_model.predict([['FOX1A', 'AHR'], ['FEV']]) gears_model.GI_predict([['FOX1A', 'AHR'], ['FEV', 'AHR']]) I am getting this error: ValueError: The gene is not in the perturbation graph. Please select from GEARS.gene_list! After checking the GEARS.gene_list i noticed that FOX1A is not but the other two are in the list. In the paper, it is mentioned that even if a gene is not in training we should still get prediction of that gene. So could you please let me know what I am missing?

yhr91 commented 1 year ago

Thanks for your question. You are correct that it is not required for a gene to be present in the training set for its perturbation effect to be predicted by GEARS but it must be present in the gene perturbation graph (Gene Ontology graph).

If the gene you are interested in is not present in the default GO graph, then you can create a custom graph by passing in the gene list you are interested in as the gene_set_path argument to the dataloader (pertdata).

https://github.com/snap-stanford/GEARS/blob/78f2debca98ff6054c5996abbe38650d9effec98/gears/pertdata.py#L21

yhr91 commented 1 year ago

Sorry, I also realized that this was related to an error in the README because of a recent change in how the model indexes perturbations, and I've corrected this now