-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use SIMD for AdapterTrimmer::searchAdapter #15
Conversation
@@ -19,7 +19,7 @@ class AdapterTrimmer{ | |||
static int trimBySequenceEnd(Read* r1, FilterResult* fr, string& adapter, double edMax = 0.3, int trimmingExtension = 10); | |||
static int trimByMultiSequences(Read* r1, FilterResult* fr, vector<string>& adapterList, double edMax = 0.3, int trimmingExtension = 10); | |||
static bool findMiddleAdapters(Read* r, string& startAdater, string& endAdapter, int& start, int& len, double edMax = 0.3, int trimmingExtension = 10); | |||
static int searchAdapter(string* read, string& adapter, double edMax = 0.3, int searchStart = 0, int searchLen = -1, bool asLeftAsPossible = false, bool asRightAsPossible = false); | |||
static int searchAdapter(string* read, const string& adapter, double edMax = 0.3, int searchStart = 0, int searchLen = -1, bool asLeftAsPossible = false, bool asRightAsPossible = 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.
make this const
so that it can accept an rvalue too.
// go from right, and return immediatedly if find a mismatch <= threshold | ||
for(int p = searchEnd - alen - 1 ; p >= searchStart ; p--) { | ||
for (int p = searchEnd - alen; p >= searchStart; p--) |
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.
Note that this line has changed.
Previously it was checking it was checking the last nucleotide in the rdata
variable.
1082e0e
to
faf839b
Compare
faf839b
to
8442204
Compare
6c4cb75
to
f18d8e2
Compare
Adding some tests for searchAdapter so when changes are made we know they are correct.
Profile shows that is one of the bottlenecks. It takes up ~20% of the time.
Benchmark shows this code is ~30% faster.