gamcil / clinker

Gene cluster comparison figure generator
MIT License
507 stars 66 forks source link

Groups are not restored during session loading #51

Closed lukas-val closed 3 years ago

lukas-val commented 3 years ago

Hi! First of all, really enjoying using clinker! However, I've also encountered an issue with clinker json session loading -- upon loading seemingly everything but the groups described in session file are loaded.

The cause seems to lie within align.py, Globalalign.from_dict() class method where Group instances restoration is not implemented. The fix could be seemingly straightforward -- addition of something like this at the end of the method before return ga:

for group in d["groups"]:  
    gr = Group.from_dict(group)
    ga.groups.append(gr)

This also worked on some minimal examples that I had my hand on.

As such, I was wondering, were there any issues encountered with group instance restoration or is this something that just wasn't implemented yet?

gamcil commented 3 years ago

Ahh, I only recently moved the groups part to Python (previously, all grouping was performed dynamically inside clustermap.js) so I must have missed this. Would happily welcome a PR with your code

gamcil commented 3 years ago

Added with #52, thanks :)