Skip to content

Modifying a substitution matrix by column raises an error #79

Description

@davidnewman02

From the documentation it should be possible to modify a substitution matrix like a numpy array:

import parasail
# copy a built-in matrix, then modify like a numpy array
matrix = parasail.blosum62.copy()
matrix[2,4] = 200
matrix[3,:] = 100

However row/column-wise assignment fails with the following error:

>>> matrix[3,:] = 100
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "venv/lib/python3.12/site-packages/parasail/bindings_v2.py", line 504, in __setitem__
    for c in range(key[1].start, key[1].stop, key[1].step or 1):
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object cannot be interpreted as an integer

parasail version == 1.3.4
python version == 3.12.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions