You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package started out representing K-mer counts in vectors of length $N^K$ where $N$ is the alphabet size. In v0.9 I redesigned it to use arrays of size $(N, N, \dots N, N)$ instead, which allowed for some nice abstractions in regards to indexing. These K-dimensional arrays can still natively be linearly indexed in Julia, and they can efficiently be flattened to vectors with vec(ka.values). So, in a sense, it's still "vectorized" -- it's just reshaped, but perhaps KmerArrays.jl would be more descriptive.
The text was updated successfully, but these errors were encountered:
I am very in favor of this renaming. This is working pretty awesome. I just wanted to add some user-side perspectives about the use:
Currently count_kmers(seq, k) returns the K-dimensional array, so I think it is more intuitive to have this function named kmerarray(seq, k) and then use the actual count_kmers for returning the desired value of the index:
functioncountkmer(kmerseq::SeqOrView{A}, seq::SeqOrView{A}) where {A} # I prefer omitting the underscore, but that is really idiosyncratic
ka =kmerarray(seq, length(kmerseq))
return ka[kmerseq]
end
This can also be extended to have a set/vector of kmers sub-sequences, or maybe the multiple dispatch will simply allow countkmer.(subseqs::Vector{SeqOrView}, seq::SeqOrView)
Or, I don't know what do you think about overloading the Base.count with that interface...
This package started out representing K-mer counts in vectors of length$N^K$ where $N$ is the alphabet size. In v0.9 I redesigned it to use arrays of size $(N, N, \dots N, N)$ instead, which allowed for some nice abstractions in regards to indexing. These K-dimensional arrays can still natively be linearly indexed in Julia, and they can efficiently be flattened to vectors with
vec(ka.values)
. So, in a sense, it's still "vectorized" -- it's just reshaped, but perhaps KmerArrays.jl would be more descriptive.The text was updated successfully, but these errors were encountered: