GuillaumeHolley / BloomFilterTrie

An alignment-free, reference-free and incremental data structure for colored de Bruijn graph with application to pan-genome indexing.
MIT License
43 stars 6 forks source link

How to retrieve color from BFT_kmer #6

Closed Colelyman closed 6 years ago

Colelyman commented 6 years ago

I am currently using your program as an efficient Colored de Bruijn Graph implementation and I am stuck trying to discover which colors (or species, taxa, etc.) are associated with a BFT_kmer. I presume that this information is encoded in the resultPresence part of the BFT_kmer, but it is unclear to me how to retrieve the color from the resultPresence.

I have been through the documentation, but haven't found anything yet. If I have missed something, please let me know.

By the way, great job with this program. I am very grateful that I can use BloomFilterTrie in my program.

Thanks, Cole

Colelyman commented 6 years ago

I think that I just found it! One can find the colors associated with a BFT_kmer using BFT_annotation, correct?

GuillaumeHolley commented 6 years ago

Hi Cole,

Glad to know you are using the BFT :) As you have guessed in your second post, once you get a BFT_kmer, you can extract a BFT_annotation from it. And once you have the BFT_annotation, you can use get_list_id_genomes(BFT_annotation*, BFT*) to extract the list of colors associated with your BFT_kmer. If the corresponding k-mer has n colors associated, the method will return an array A of n+1 unsigned 32 bits integers with A[0] = n and A[1..n] = colors. In general, have a look at the Annotation functions section of the doc for more info on how to extract a BFT_annotation from a BFT_kmer and what you can do with it.

If you have any questions or meet any issue on your way, just let me know ;) Also, let me know if this answers your question such that I can close the issue.

Have a good day!

Best, Guillaume

Colelyman commented 6 years ago

This is perfect, thank you for your prompt response!

Have a good day as well, Cole