PoonLab / sierra-local

Retrieve HIVdb algorithm as XML and apply locally to HIV sequences
GNU General Public License v3.0
6 stars 4 forks source link

TypeError, when testing `score_single` function in ./sierralocal/score_alg.py #73

Closed SandeepThokala closed 1 year ago

SandeepThokala commented 1 year ago

The function is expecting an argument of type str for the sequence parameter. (Line: 25) https://github.com/PoonLab/sierra-local/blob/e060fb99a3457563be5a1b4c27084966f4582157/sierralocal/score_alg.py#L20-L26 But it is checking to see if position (which is of type int) is in the sequence (Line: 67) https://github.com/PoonLab/sierra-local/blob/e060fb99a3457563be5a1b4c27084966f4582157/sierralocal/score_alg.py#L62-L68

Error Message:

  File ".\sierra-local\sierralocal\score_alg.py", line 67, in score_single
    if position in seq_mutations:
TypeError: 'in <string>' requires string as left operand, not int
ArtPoon commented 1 year ago

Looks like the input has been changed from a string (sequence) to a list of dictionaries (residue and codon pairs, keyed by amino acid position) after the unit test was written. @SandeepThokala can you please investigate and update the test as needed?