Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NCD distance raises KeyError when calculating the distance between a sequence and itself #4

Open
necrosovereign opened this issue Aug 22, 2022 · 0 comments

Comments

@necrosovereign
Copy link

Distance.pairwise_distance from alfpy.ncd raises KeyError when seq1idx == seq2idx.

Example:

import alfpy.ncd as ncd
from alfpy.utils import seqrecords

seq_records = seqrecords.SeqRecords(id_list=[0], seq_list=["ACGT"]
dist = ncd.Distance(seq_records)
print(dist.pairwise_distance(0, 0))

This raises:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "../alfpy/ncd.py", line 67, in pairwise_distance
    zxy = self._complexity[(seq1idx, seq2idx)]
KeyError: (0, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant