Skip to content

Commit

Permalink
Fixup 2D kmer spectra construction
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben J. Ward committed Jul 4, 2020
1 parent 2b22af6 commit becd400
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/KmerFrequencySpectra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,27 @@ function KmerFrequencySpectra{2}(xfreqs::Vector{MerCount{M}}, yfreqs::Vector{Mer
fi = xfreqs[i]
fj = yfreqs[j]
if mer(fi) === mer(fj)
sdat[freq(fi) + one(UInt8), freq(fj) + one(UInt8)] += 1
sdat[freq(fi) + one(UInt16), freq(fj) + one(UInt16)] += 1
i += 1
j += 1
elseif mer(fi) < mer(fj)
sdat[freq(fi) + one(UInt8), one(UInt8)] += 1
sdat[freq(fi) + one(UInt16), one(UInt16)] += 1
i += 1
elseif mer(fj) < mer(fi)
sdat[one(UInt8), freq(fj) + one(UInt8)] += 1
sdat[one(UInt16), freq(fj) + one(UInt16)] += 1
j += 1
end
end

while i < i_end
fi = xfreqs[i]
sdat[freq(fi) + one(UInt8), one(UInt8)] += 1
sdat[freq(fi) + one(UInt16), one(UInt16)] += 1
i += 1
end

while j < j_end
fj = yfreqs[j]
sdat[one(UInt8), freq(fj) + one(UInt8)] += 1
sdat[one(UInt16), freq(fj) + one(UInt16)] += 1
j += 1
end

Expand Down

0 comments on commit becd400

Please sign in to comment.