dpeerlab / spectra

Supervised Pathway DEConvolution of InTerpretable Gene ProgRAms
MIT License
134 stars 17 forks source link

unbound local variable is_global #33

Open joshdempster opened 8 months ago

joshdempster commented 8 months ago

Trying to call est_spectra with a gene_set_dict of the form {"global": dict of gene sets} and use_cell_types=False leads to an unbound local variable error for is_global after training. Looking through the code, this happens because in this case, check_gene_set_dictionary expects a single-layered dict for gene_set_dict. This behavior isn't in the doc string. A couple suggestions:

Tobiaspk commented 8 months ago

Hi, thanks for raising this issue and your suggestions. PR #35 contains a new check that gene_set_dict is not empty. Agreed, ideally the format of gene_set_dict is consistent. This should also be updated in the next release.