-
Notifications
You must be signed in to change notification settings - Fork 83
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
[MISC] Refactor fm_index #1892
[MISC] Refactor fm_index #1892
Conversation
6f7409b
to
ace6907
Compare
Codecov Report
@@ Coverage Diff @@
## master #1892 +/- ##
=======================================
Coverage 97.76% 97.77%
=======================================
Files 258 258
Lines 9685 9687 +2
=======================================
+ Hits 9469 9471 +2
Misses 216 216
Continue to review full report at Codecov.
|
4fc615d
to
cd8abc5
Compare
auto genome = std::vector<"CGTAGGTCGATGC"_dna4, "CAAAA"_dna4>;
seqan3::bi_fm_index index{genome};
auto it = index.cursor(); // bidirectional cursor
it.extend_right("CGT"_dna4); // search CGT
seqan3::debug_stream << it.locate() << '\n'; // (0,0)
auto rev_it = it.to_rev_cursor();
seqan3::debug_stream << rev_it.locate() << '\n'; // (?,?) Possible Outputs:
Open Questions:
2020-06-15 Resolution:Ask some people, if they don't need it or see an immediate use-case, otherwise throw it from the API. Make it private in the mean-time and add a new issue. 2020-06-24 Resolution:
|
18f9539
to
cbb0faa
Compare
17a08aa
to
d2e2a8e
Compare
void construct(text_t && text) | ||
{ | ||
detail::fm_index_validator::validate<alphabet_t, text_layout_mode_>(text); | ||
|
||
fwd_fm = fm_index_type{text}; | ||
rev_fm = rev_fm_index_type{text}; | ||
} | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are spaces accidentally inserted 💅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, looks good now! The most recent commit added some unintended spaces, which can be fixed together with the 2nd review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly some questions
tmp_text.back() = delimiter; | ||
|
||
std::ranges::reverse(tmp_text); | ||
std::ranges::reverse(tmp_text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we reversing the text here in the if (!reverse)
branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reverse
is whether the original text was reversed (reverse_fm_index).
If it's a "normal" fm_index, you can just reverse the test; if the text comes from the reverse_fm_index
you have to do special stuff if there is only one item in the collection
} | ||
public: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
public: | |
} | |
public: |
@@ -274,51 +284,46 @@ class fm_index | |||
//!\cond | |||
requires (text_layout_mode_ == text_layout::collection) | |||
//!\endcond | |||
void construct(text_t && text) | |||
void construct(text_t && text, bool reverse = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this construct
has a boolean for reversing in the normal fm_index
when you have a whole class that can handle all the reversing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just handles the reversing of the text; the alternative would be to copy the complete code of the construct method to the reverse_fm_index and add the tiny if I need...
Resolves #1542