Hi! I trained a lot of scVI models with different parameters to asses their impact, however I realised at the end of the exercise that the original AnnData file was indexed in var through a simple numeric index (so the index wasn’t either gene identifiers nor gene symbols). It took quite a while to train all the models. Is it possible to modify, perhaps loading as a torch object, the models so that I can only change the gene labels used in the model (so that I can use them for cell type labelling with other datasets)?
If I load the model through torch:
model = torch.load(f"{model_path}/model.pt", map_location=torch.device("cpu"))
I can see these two dictionary elements with arrays containing my gene indices:
>> model['var_names']
array(['67', '83', '125', ..., '60058', '60060', '60159'], dtype=object)
>> model['attr_dict']['registry_']['field_registries']['X']['state_registry']['column_names']
array(['67', '83', '125', ..., '60058', '60060', '60159'], dtype=object)
They contain the same values, but they are different elements in memory (if I modify one, the other remains as it was). Would it suffice to replace the values in these arrays? Or is there something else in the torch model that would require being changed? Or is there a method from scvi that would allow me to replace these indices more cleanly without the need to fix this through torch and then re-serialise?
Thanks!