Conversation
Contributor
|
Found an error |
Contributor
Author
|
The issue results due to I implemented a fix rejecting the reactions with multiple sites, it seems to work for now, not sure if it will have any unintended consequences. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a couple of major changes:
An ML model based on the sklearn ExtraTreesRegressor is used to compute the pKa of protonation sites. This model is trained using the pre-existing rules and rdkit Descriptors as input features. Because the model uses the rules which are site specific, it can therefore compute the pka for each protonatable site in the molecule. Seems to work pretty well so far, though we are limited by the training set. We can always retrain with a larger set or expand our rules.
Protonations are done combinatorially, with each possible combination of protonated and deprotonated sites considered. This increases the cost somewhat, with the total number of pKa computations being N*2^N, where N is the number of protonatable sites in the molecule. Testing with cysteine (N=3) resulted in molscrub being about 3-4 times slower. So not too bad. There might be some ways to speed this up (loading the model seems to take quite a bit of time), but that's a future problem.
For now this is optional, set with the
--pka_model etr1cli option, or thepka_model="etr1"when initializing the Scrub object. The default will still the rules-based method .The plan for now is to update this iteratively, with the model being improved as new edge cases are discovered and fed into the model.
The code used to train the model is also included in the
trainingfolder. It's pretty or generalizable, but for now it should be ok. we can always improve this as more models are considered.