jbkinney / logomaker

Software for the visualization of sequence-function relationships
MIT License
179 stars 34 forks source link

alignment_to_matrix "counts" takes an np.array not a list #25

Open leandrosz opened 2 years ago

leandrosz commented 2 years ago

Hi! I noticed that when building a matrix from alignment and providing the "counts" parameter with a list of non-zero-integers I get an error:

Traceback (most recent call last): [...] File "/.../logomaker/src/error_handling.py", line 102, in wrapped_func result = func(*args, **kwargs) File "/---/logomaker/src/matrix.py", line 583, in alignment_to_matrix tmp_mat = (char_array == c).astype(float) * counts[:, np.newaxis] TypeError: list indices must be integers or slices, not tuple

When checking the source code I noticed this could be because I was providing a list and not an numpy.array object, and by doing changing that it all worked. I'm just letting you know because in the help it says input should be "None or list of numbers".

Thanks for the awesome work!

[EDIT] I'm using logomaker 0.8 in Python 3.8

atareen commented 2 years ago

Hello Leandro,

Thanks! I'll update the code and fix this in a new logomaker release.

Ammar