exaloop / exaloop/seq

Extension of Kmer class to return numeric indices for each nucleotide

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
59
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Extension of Kmer class to return numeric indices for each nucleotide:

```python
@extend
class Kmer:
def nucleotide_indices(self) -> List[int]:
"""
Get nucleotide indices for each nucleotide position in the Kmer.

The nucleotide index for a nucleotide corresponds with the position in "ACGT".
"""
nuc_idx = List[int](k)
x = self.x
i = k - 1
while i >= 0:
nuc_idx.append(int(x & UInt[2*k](3)))
x >>= UInt[2*k](2)
i -= 1
nuc_idx.reverse()
return nuc_idx
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.