-
Notifications
You must be signed in to change notification settings - Fork 10
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
Likely stupid question -> kmer u64 to kmer [u8] #14
Comments
Took me quite some time and a lot of ChatGPG 'talks' to get there but this is the way to go:
Would print CGATATT likely not perfect, but it is working and I am glad. |
|
Hi @stela2502, Sorry for the slow reply here. The other potential approach would be to use the |
Thank you for this input. Even with the bitmer_to_bytes function I would have ended up with my problem to convert bits to sting. Do you know if the usage of an external &[u8;8] array would actually make a difference in the compiled version? Regarding the huge speed improvement between debug and release version of the program I assume the compiler is already cleaning out a lot of these problems. In addition I only actually need this function for error messages. Would it make sense to actually add this functionality to the kmers library? It does not actually use any kmer object. But possibly in the utilities? Just grab the code if you think it makes sense. Most of the intellectual work was done by ChatGPT anyhow... |
Hmm, @stela2502 what is the specific use case and type conversion(s) you would like? Regarding speed / usage: if you only need kmers of length <= 32 then Regarding error messages: Hope this helps! |
Hi @theJasonFan. The specific case was to check how my gene matching function actually matches sequences. As all the matching is performed on basically bits level it was REALLY hard for me to grasp what is going on. Being a bioinformatician I do not transcode u64 to DNA in my brain ;-). |
Would calling We do something like this in the tests where we compare kmer representations to a sequence of bytes: Line 195 in 15016e2
|
Hehehe, that is exactly what I had expected, but as I stated before (in my first post) I was unable to find the function. |
I have created u64 representations of a kmer like this:
Is there a function to reverse that? To get from this u64 a kmer representation back?
I am quite sure there is and I am absolutely sure I will not find it ;-)
Please help!
I tried this, but it fails with an utf8 error:
I am sure it can be done and it should be simple. But I am not getting it ;-)
The text was updated successfully, but these errors were encountered: