-
Notifications
You must be signed in to change notification settings - Fork 82
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
FM index cursor (de-)serialization #2044
Comments
Hey Tobias, I opened #2048 to offer serialisation for the cursors, you can check the code out if you want to try it. Here are the docs about serialisation: https://docs.seqan.de/seqan/3-master-user/howto_use_cereal.html Your example could look like this: index_t index;
// build index
seqan3::fm_index_cursor<index_t> cursor(index);
cursor.extend_right('G'_dna5);
// Create archive storing to some temporary file
std::ofstream os(tmp_file.get_path(), std::ios::binary);
cereal::BinaryOutputArchive archive(os);
archive(cursor); Later: index_t index;
// build index
seqan3::fm_index_cursor<index_t> cursor(index);
// Read from file
std::ifstream is(tmp_file.get_path(), std::ios::binary);
cereal::BinaryInputArchive archive(is);
archive(cursor); // cursor now in same state as after calling `cursor.extend_right('G'_dna5);` |
Hey Enrico, |
Sorry for the delay, was pretty busy with other stuff the last few days. |
Platform
Question
I have a question regarding the new FM index implementation when trying to upgrade from SeqAn2 to SeqAn3.
When using the SeqAn FM index data structure but running my own algorithm on it, it was previously possible to obtain the node position of the underlying suffix tree and use it later to access the same node. This is for example necessary when writing interim states of the algorithm to disk and read it later to continue the index search.
In SeqAn2, I used the following way to achieve this:
When I tried to use the SeqAn3 FM index for the same thing, I recognized that in principle this should be possible using the
seqan3::fm_index_cursor
containing the node that is used for searching the index. Like this (minimal example):My question: As far as I can observe, there is no way to access the private members
node
,parent_lb
,parent_rb
andsigma
ofseqan3::fm_index_cursor<index_t>
for storing the cursor location. At the same time, it also seems not to be possible to create a cursor at a given position that was calculated before, e.g. by providing a constructor to create a cursor from the members mentioned above. Thus, is there currently any way to serialize / obtain the underlying values of FM index cursor positions and create a new cursor later using these values? Or any other way to perform one part of the search, store the current state and continue the search later with a new cursor instance?The text was updated successfully, but these errors were encountered: