Open bpkwee opened 3 months ago
Hello, I'm also trying to apply Spectra to my data at the moment and was having the same question and wondering how to derive the importance scores. @bpkwee did you already find a solution for this.
@CorinnaLo no, unfortunately not yet...
@russellkune for using Spectra which seems to be a very cool method it would be very helpful for me if you and/or one of the other developers could maybe provide some insights on how to calculate the factor importance and information scores based on the model output. Thanks a lot!
Thanks for the amazing package!
I successfully managed to run spectra on a few datasets and I was eager to calculate the importance and information scores for the factors that spectra found. However, while reading the utils functions it was not immediately clear how to use these functions to calculate the scores for each factor:
holdout_loss()
function? For this function I am unsure whatcell_type
andlabels
arguments should contain. The lines below suggest that there should be a loop over each unique cell_type, wherelabels
is an array of the the cell_type annotations for each cell. Am I correct that this loop missing from the current code? https://github.com/dpeerlab/spectra/blob/474a3c708a1fe7336f9368839c8e7058ace12f9d/src/Spectra/Spectra_util.py#L371 https://github.com/dpeerlab/spectra/blob/474a3c708a1fe7336f9368839c8e7058ace12f9d/src/Spectra/Spectra_util.py#L382labels
parameter is missing as mentioned in the #todo https://github.com/dpeerlab/spectra/blob/474a3c708a1fe7336f9368839c8e7058ace12f9d/src/Spectra/Spectra_util.py#L428 Islabels
the supposed to contain the same array of cell_type annotations as inholdout_loss()
?In https://github.com/dpeerlab/spectra/issues/24#issuecomment-1600431648 it is mentioned that an example would be added to the tutorial, but I have not found it there. Ideally I would like to make a figure similar to "Extended Data Fig. 6a".
Any help would be greatly appreciated.