-
Notifications
You must be signed in to change notification settings - Fork 27
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
Question regarding queryAbundance(node) function. #19
Comments
Hi Dilip! yep, thanks for reporting it (and seen your email); will reply shortly |
Thank you. (I apologies for bothering you with multiple mails ) |
hi Dilip! If you really need high precision abundances: right now the abundance is fixed at 8-bit precision but I could point to you what to change in the code to have it at a higher precision (it's basically a matter of changing a uint8 to a uint16 somewhere). In addition, I added a unit test ( |
Thank you for the fix rayan.
Up to 70 the value returned is exact. Then there is some error. |
Hey Guys, Thanks a lot once again |
Regarding adapting the code to higher precision: actually since discretization is in place and cannot be disabled, it is a bit harder to change the code to have precise high abundances.
to only do
If it doesn't work, let us know. |
Hello, I too got this problem and tried to solve as described. I created a fork (https://github.com/leoisl/gatb-core) since I did some other changes, but I did not manage to make it work (querying the node's abundance with
The first abundances were queried using Upon inspecting the values of
However, I don't think I can progress much from here... Do you have some ideas on how to correctly fill Thanks! |
Hi Leandro, Sorry for letting this question linger for so long. '149' is actually exactly the discretized abundance code for a real abundance of 999: 999=701+152+4010+2420+19, as per #19 (comment), and summing the terms in bold, 70+15+40+24=149. So the values in |
Hello all,
I am using GATB library for my work. I have a naive question which I have not been able to find an answer for. While using one of the functions to find the abundance of a node (queryAbundance(node)) in the initial dataset, I always get the abundance as 255 for any kmer having abundance greater than 255. Upon looking at the gatb-core source code I found the following template in Graph.cpp:
template<typename Node, typename Edge, typename GraphDataVariant>
struct queryAbundance_visitor : public boost::static_visitor {
Node& node;
queryAbundance_visitor (Node& node) : node(node){}
template<size_t span> int operator() (const GraphData& data) const
{
unsigned long hashIndex = getNodeIndex(data, node);
if(hashIndex == ULLONG_MAX) return 0; // node was not found in the mphf
unsigned char value = (*(data._abundance)).at(hashIndex);
return value;
}
};
The template is returning an unsigned char value which has a range of 0 to 255. This might be a reason why the value is always 255. But even if I change it to "unsigned int", I still get the same result. Inspired from the snippet given in GATB library (deBruijn26.cpp), I am using the query abundance function as follows:
std::string s = model.toString (itKmer->value()); //itkmer->value is the kmer of length 21 from a read
const char* sq = s.c_str();
Node node = graph.buildNode(sq);
auto abund = graph.queryAbundance(node);
Am I making a mistake here in my above code?
regards
Dilip
The text was updated successfully, but these errors were encountered: