I am playing around with the GATB library, and I have run into some problems, hopefully simple to overcome with guidance. I was reading through some other questions, specifically the question at: A: GATB de Bruijn graph
In the comments it says you can use Graph::buildNode to return a Node instance from a kmer as an ASCII string (broken link). I looked through the examples and see some examples of this, but when I am trying to use it in the following code, I get compile errors:
template <typename Graph_type, typename Node, typename Edge, size_t span>
void mytool::myfunction(Sequence& seq, Graph_type& graph, IBank *outputBank){
int kSize = graph.getKmerSize();
std::string sequence = seq.toString();
Node left = graph.buildNode((char *)sequence.c_str(),0);
Node right = graph.buildNode((char *)sequence.c_str(),sequence.length()-kSize);
...///even if all else is commented out, I get error for the assignment of Node left and Node right
}
When compiling, I get the errors similar to this (for both the left and right node assignments, and the LargeInt<x> iterates 1 to 4 in the errors):
error: conversion from ‘gatb::core::debruijn::impl::Node_t<gatb::core::tools::math::LargeInt<4> >’ to non-scalar type ‘gatb::core::debruijn::impl::NodeGU’ requested
Node left = graph.buildNode((char *)sequence.c_str(),0);
Even when I change the code to have just a const char* with no offset as the constructor for buildNode I run into the same problem.
Do you have any advice for me to fix my problem? (Hopefully it is something I just don't understand) Thanks!
That will get rid of the errors yes...But then it isn't the right type for subsequent calls. Essentially I want to take an existing contig and extend it using the graph, something like this:
I can get what I want if I do some really inefficient things, but I really want to avoid this:
Hi, sorry I didn't get notified by the responses in this thread. In the future, please reach me at rayan.chikhi@univ-lille.fr if this happens!
1) Are you using the Graph or GraphUnitigs class? (seems that it is GraphUnitigs)
2) If you're using GraphUnitigs, the function you're looking for is debugBuildNode() actually, not buildNode, as it produces a NodeGU (special node type for GraphUnitigs)
Yes I am using the GraphUnitigs, thank you for the help. I will re-implement and open another question/email if I have more problems. Thank you!