8000 make reindexing the default by timosachsenberg · Pull Request #5581 · OpenMS/OpenMS · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

make reindexing the default #5581

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

Merged
merged 10 commits into from
Oct 13, 2021
Merged

Conversation

timosachsenberg
Copy link
Contributor
@timosachsenberg timosachsenberg commented Oct 12, 2021

Description

For all workflows we call PeptideIndexer after a database search. This PR makes that default behavior by incorporating it into the search engine adapter.
pro:

  • we can remove one node from workflows
  • we can insert default needed for some search engines (less error prone)

Checklist:

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes. (Tick if no updates were necessary.)

How can I get additional information on failed tests during CI:

If your PR is failing you can check out

Note:

  • Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).

@jpfeuffer
Copy link
Contributor

Can this please go into SearchEngineBase?

@timosachsenberg timosachsenberg marked this pull request as ready for review October 12, 2021 17:24
@timosachsenberg
Copy link
Contributor Author

rebuild jenkins

Param param_pi = PeptideIndexing().getParameters();
// overwrite with search engine specific defaults
//param_pi.setValue(const std::string &key, const ParamValue &value) TODO: set search engine defaults
registerPeptideIndexingParameter_(param_pi);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like its a lot of boilerplate for every search adapter.
Could also go into SearchEngineBase, using some override methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really? I would have thought it is fine as it is one line of code if you don't need to do any adaptions.

registerPeptideIndexingParameter_(PeptideIndexing().getParameters());

// reindex ids
if (getStringOption_("reindex") == "true")
{
if (auto ret = reindex_(protein_identifications, peptide_identifications); ret != EXECUTION_OK) return ret;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also too much boilerplate for my taste.
reindex_ could check the flag's reindex state and handle the outer if, right?

The inner if is a bit more tricky due to the conditional return here.
I can only think of throwing an exception, say throw TOPPReturnException(ERROR_CODE), if indexing did not work (as a means to "return") and catching that exception here: https://github.com/OpenMS/OpenMS/blob/develop/src/openms/source/APPLICATIONS/TOPPBase.cpp#L451 and set result according to the value stored in the exception. That would actually make some other places in TOPP tools cleaner as well.
All this can go inside reindex_.
Maybe there is an even better way though...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally I also thought about moving more to SearchEngineBase e.g., making parameter mandatory for all search engines etc. but in the end you might also want to use e.g. SimpleSearchEngine base which does it automatically without this parameter. Other third-party search engines might give you peptides that can't be indexed for whatever reason.

So in the end you anyway need a reviewer that will point out that you need to add some extra lines if you implement a new adapter. Being it 5 or 2 + try/catch code doesn't make a difference to me (and probably doesn't in terms of lines of code).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I agree that with some extra work (adding new virtual members as customization points) it could be reduced. In light of time and resources, maybe later ;)

<UserParam type="string" name="CometAdapter:1:log" value=""/>
<UserParam type="int" name="CometAdapter:1:debug" value="0"/>
<UserParam type="int" name="CometAdapter:1:threads" value="1"/>
<UserParam type="string" name="CometAdapter:1:no_progress" value="false"/>
<UserParam type="string" name="CometAdapter:1:force" value="true"/>
<UserParam type="string" name="CometAdapter:1:test" value="true"/>
<UserParam type="string" name="CometAdapter:1:decoy_string" value=""/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probalby related to the way we store these user-values, but using only the name of the leaf, and not the full path seems dangerous.
Any insights @Waschi97 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, an issue regarding reproducibility.

Copy link
Contributor
@cbielow cbielow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice addition, removing the boilerplate would be nice!

@timosachsenberg
Copy link
Contributor Author

thanks for the comments. I will try to reduce the boilerplate code a bit more.

@timosachsenberg timosachsenberg merged commit 78da0c9 into develop Oct 13, 2021
@timosachsenberg timosachsenberg deleted the feature/max_indexing_default branch October 13, 2021 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: run PeptideIndexer as default in search engines
3 participants
0