khramts / assocplots

MIT License
32 stars 14 forks source link

Renamed argument 'type' with 'plot_type' #2

Closed mvacher closed 6 years ago

mvacher commented 6 years ago

Using an argument named 'type' overwrites the Python's function type() causing a bug when the manhattan function is called using chrs_plot=None.

manhattan(p1, pos1, chr1, label1, p2, pos2, chr2, label2, type, chrs_plot, chrs_names, cut, colors, title, xlabel, ylabel, top1, top2, lines, lines_colors, zoom, scaling)
     60     if chrs_plot is None:
     61         chrs_list = np.unique(chr1)
---> 62         if type(chrs_list[0]) == str:
     63             chrs_list = sorted_nicely(chrs_list)
     64         else:

TypeError: 'str' object is not callable

This PR simply renames the type argument with plot_type to avoid this conflict. Type check in line 62 has also been replaced with builtin function isinstance().

khramts commented 6 years ago

Thank you for implementing this edit.