seekrcentral / seekr2

Simulation-Enabled Estimation of Kinetic Rates - Version 2
MIT License
27 stars 6 forks source link

Non-Uniform Discretization #15

Closed xfang216 closed 2 years ago

xfang216 commented 2 years ago

Dear SEEKR2 team,

Recently I ran into an issue when using SEEKR2 to simulate Ca binding to a EF-hand protein with 0.5 A increment between anchors. After running the simulations of each anchor, I got this error message when trying to analyze the results: "seekr2.modules.common_analyze.MissingStatisticsError: Anchor(s) [0, 2, 5] are missing sufficient statistics. Consider running simulations of anchor(s) [0, 2] for longer time scales or readjust anchor locations to make transitions more frequent."

I thought this was because of lack of smooth transition as suggested by the message. So I used small increments (0.25 A) in distance for the problematic anchors 2 (i.e. I added two anchors between anchor 0 and 3). I then concatenated these new simulations with the original ones and modified the model.xml for analysis. However, this gave the error "seekr2.modules.common_analyze.MissingStatisticsError: Anchor(s) [0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] are missing sufficient statistics.". Is this because I have different distance spaces between anchors? If so, is there ia way to run non-uniform discretization for cases like this?

Thanks!

Xuan

lvotapka commented 2 years ago

Hello,

First off, the model.xml is generated automatically and is not intended to be modified by hand. You should probably never modify model.xml directly, and I think the problems you saw after modifying the anchor increments came from an incorrectly constructed model.xml file.

I think we should add a warning comment in the model.xml file to keep people from modifying it. @astokely is there any way to add a comment to a serialized XML file in Abserdes?

Hopefully you saved the old model.xml file, @xfang216 , or better yet, the entire filetree for that system. The correct way to make this modification to anchor locations (or add or delete anchors) is to change the anchor settings in the input XML file and rerun prepare.py. If you run without the "-f" argument, then it will warn you that some anchors would be overwritten by adjusting anchor locations. Since you need to rerun those anchors anyways, you should be able to safely use the "-f" argument to prepare.py.

Alternatively, you could run for longer in the under-sampled anchors, although its usually a better strategy to add more anchors, as you attempted to do, in regions of the CV that are difficult to sample.

xfang216 commented 2 years ago

Hi Lane,

Thanks for the prompt response! I will try that out.

astokely commented 2 years ago

@lvotapka We could simply add a serialize and deserialize method to the Model class that raise warnings when called and then they could call abserde's serialization/deserialization method via super.

lvotapka commented 2 years ago

@astokely Would it be possible to either pass a string to serialize() that would become a comment in the XML, or perhaps, as you said, have an attribute in the class that inherits Serializer? We probably want to call it a "comment" or a "header" instead of a "warning"

astokely commented 2 years ago

Yes @lvotapka I just added an optional "xml_header" parameter to abserdes.serialize and uploaded the new version to pypi.

lvotapka commented 2 years ago

Perfect, thanks @astokely.

lvotapka commented 2 years ago

Just pushed a commit that adds a warning message to model.xml.

414d3ac8f4e493497d865a28f00eb8fe610c36c1

lvotapka commented 2 years ago

Any updates on the success of this approach, @xfang216?

xfang216 commented 2 years ago

Hi @lvotapka, yes, it's working now. Thanks!

lvotapka commented 2 years ago

Glad to hear it!