reneshbedre / bioinfokit

Bioinformatics data analysis and visualization toolkit
MIT License
334 stars 77 forks source link

Bug when plotting marker labels referenced by tuple #4

Closed mkirchler closed 4 years ago

mkirchler commented 4 years ago

Hey, thanks for this nice library. I believe there's a small bug in the manhattan plot when passing the the marker IDs as a tuple; I think the line should rather be for i in markernames: https://github.com/reneshbedre/bioinfokit/blob/521530382e92bece3d8f23055dc024f29f35c630/bioinfokit/visuz.py#L279

And maybe it would also make sense to extend the previous line 278 to elif markernames is not None and isinstance(markernames, (tuple, list)): so that one can also pass lists instead of tuples.

Best, Matthias

reneshbedre commented 4 years ago

Hi Matthias,

Thank you for valuable comments. There was a bug in a function that was not checking the provided markernames with markers in marker id column (markeridcol). The only affected part is if you provide the markernames as a tuple. I have corrected this issue in v0.7.3 which is I just updated.

for i in df[markeridcol].unique(): should be there as it is necessary to check the provided marker names (markernames) are already in the input dataframe. You can see the updated code in v0.7.3.

Further, it was accepting the only tuple and not list in markernames. I took your suggestion and updated it in the code for isinstance(markernames, (tuple, list)).

Please try v0.7.3 and let me know if you still have problems.

Thank you again for your valuable suggestions.

mkirchler commented 4 years ago

Hey, yes, works great! Thanks for the fast reply.