-
Notifications
You must be signed in to change notification settings - Fork 19
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
"forcefield" property #147
Comments
Hi @SofiaBariami, I agree that is kind of a dual Sire/BioimSpace question but I've transferred this issue over here since the issue (for now) is likely specific to the creation of merged molecules in BioSimSpace. The molecule._sire_object.property("forcefield")
MM ForceField{ amber::ff,
combining_rules = arithmetic,
1-4 scaling = 0.833333, 0.5,
nonbonded = coulomb, lj,
bond = harmonic, angle = harmonic,
dihedral = cosine } You can see how this property is set in the new AmberPrm parser here, and similarly for the GroTop parser here. It looks like this property is not used or set in the old amber.cpp parser that you refer to. In BioSimSpace, we currently only support merges between two molecules that have compatible AMBER-style forcefields. The MMDetail object provides a convenient way of checking for compatibility and could be extended to support additional forcefield types in future. The following code snippet shows how the # Get the user name for the "forcefield" property.
ff0 = inv_property_map0.get("forcefield", "forcefield")
ff1 = inv_property_map1.get("forcefield", "forcefield")
# Force field information is missing.
if not molecule0.hasProperty(ff0):
raise _IncompatibleError("Cannot determine 'forcefield' of 'molecule0'!")
if not molecule1.hasProperty(ff1):
raise _IncompatibleError("Cannot determine 'forcefield' of 'molecule1'!")
# The force fields are incompatible.
if not molecule0.property(ff0).isCompatibleWith(molecule1.property(ff1)):
raise _IncompatibleError("Cannot merge molecules with incompatible force fields!") I hope this makes sense. I'm happy to discuss more if you need a clearer explanation. If you think that you might need to extend the |
Hi Lester, thank you very much. This is very helpful. I am indeed trying to use BioSimSpace to work with molecules that are parameterised with another forcefield, and since the forcefield property was not set, python was complaining. Maybe extending the
@jmichel80 what do you think? Should we extend |
hi @SofiaBariami
Can you post the code you use to load a pair of QUBE molecules to be merged and sample input files (two small ligands in vacuum) ?
Post also code for the AMBER ff use case.
I think this happens because you are not using the same amber parser that @lohedges wrote for BioSimSpace. We haven't ported this to somd
as it requires some additional code changes but we may have to consider this. It could also help solve the performance issues
you have seen when loading large molecules parameterised with QUBE
BW
Julien
…--------------------------------------------------------------
Dr. Julien Michel,
Senior Lecturer
Room 263, School of Chemistry
University of Edinburgh
David Brewster road
Edinburgh, EH9 3FJ
United Kingdom
phone: +44 (0)131 650 4797
http://www.julienmichel.net/
-------------------------------------------------------------
On Mon, Mar 9, 2020 at 10:07 PM Sofia Bariami <[email protected]<mailto:[email protected]>> wrote:
Hi Lester, thank you very much. This is very helpful. I am indeed trying to use BioSimSpace to work with molecules that are parameterised with another forcefield, and since the forcefield property was not set, python was complaining. Maybe extending the MMDetail class is the best way to proceed with this, especially if we are planning to use QuBe in the future as well. I have managed to overcome some of the errors in hacky ways. For example I substituted ff.electrostatic14ScaleFactor() and ff.vdw14ScaleFactor() of the _merge function<https://github.com/michellab/BioSimSpace/blob/devel/python/BioSimSpace/_SireWrappers/_molecule.py#L1942> with the actual values of the scale factors, but this practice is not the best, since the code is complaining in other steps of the process as well. For example when I am calling _toPertFile() I am getting an Exception 'SireBase::missing_property' because of the same thing:
--> 709 if not self._sire_object.property("forcefield0").isAmberStyle():
710 raise _IncompatibleError("Can only write perturbation files for AMBER style force fields.")
@jmichel80<https://github.com/jmichel80> what do you think? Should we extend MMDetail, or it is indeed too much of a detail, so find another way to overcome the issue?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#147?email_source=notifications&email_token=ACZN3ZD5LISH3DDECI4CLLDRGVSAZA5CNFSM4LEQDBXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOJHX2I#issuecomment-596802537>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACZN3ZEGX7Y5UAZ3C6KC7LDRGVSAZANCNFSM4LEQDBXA>.
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
|
Much as I'd like to take credit for it, the updated AMBER parser is all @chryswoods work :-) |
you can find the files and the script here: https://github.com/SofiaBariami/qube_project/tree/master/merge_molecules @jmichel80 when you say to post code for the Amber ff case, do you mean to refer to the BSS code that we use? If so, we are using the following main functions: |
Hi Sofia,
Can you post a detailed description on github of the issue. Show what code from BioSimSpace you tried to use, what error messages you got. What modifications you think are needed to the various BioSimSpace functions. From quickly glancing at the code I get the impression you have copied/pasted several functions from BioSimSpace and then modified the code to make it work with your inputs.
It would be better to identify what needs to be changed to your input molecules to make them compatible with the existing BioSimSpace code, and to make minimal modifications to BioSimSpace.
When I meant show the Amber ff use case, I meant to describe in the github issue exactly how you call various functions in BioSimSpace to produce a set of somd input files from a set of input prm7/rst7 files. This so we understand better what is it that makes the qube input incompatible whereas the amber input files work.
…--------------------------------------------------------------
Dr. Julien Michel,
Senior Lecturer
Room 263, School of Chemistry
University of Edinburgh
David Brewster road
Edinburgh, EH9 3FJ
United Kingdom
phone: +44 (0)131 650 4797
http://www.julienmichel.net/
-------------------------------------------------------------
On Tue, Mar 10, 2020 at 10:09 AM Sofia Bariami <[email protected]<mailto:[email protected]>> wrote:
you can find the files and the script here: https://github.com/SofiaBariami/qube_project/tree/master/merge_molecules
@jmichel80<https://github.com/jmichel80> when you say to post code for the Amber ff case, do you mean to refer to the BSS code that we use? If so, we are using the following main functions:
* matchAtoms()<https://github.com/michellab/BioSimSpace/blob/devel/python/BioSimSpace/Align/_align.py#L66>
* _merge()<https://github.com/michellab/BioSimSpace/blob/62a3d98ab91b4c93bbddcc4a406ee676fc33f9ff/python/BioSimSpace/_SireWrappers/_molecule.py#L1942>
* _toPertFile()<https://github.com/michellab/BioSimSpace/blob/62a3d98ab91b4c93bbddcc4a406ee676fc33f9ff/python/BioSimSpace/_SireWrappers/_molecule.py#L710>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#147?email_source=notifications&email_token=ACZN3ZFDEX6FMZZSBBHKS7LRGYGT3A5CNFSM4LEQDBXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOKZC6A#issuecomment-597004664>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACZN3ZA4LWXLZMOS6VHGWNLRGYGT3ANCNFSM4LEQDBXA>.
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
|
Thanks for the clarifications Julien.
However, the molecule loaded from xml/pdb, does not have this property at all, that results to an |
I'm not completely sure how you are currently constructing a Sire/BioSimSpace system parameterised with the QuBe forcefield, but this is what I think would be the ideal solution... Hopefully you are using the Sire PDB parser, then adding properties to the System object with the information that you parse from the XML file. (Although, perhaps you are doing this the other way around.) This is how the Sire parsers are intended to work: one parser constructs the initial system (using the molecular topology), then other parsers can add additional information to the existing System. You can read more details about this in the BioSimSpace paper here. Ideally there would be a new Sire parser called Obviously all of the above is quite involved and requires a lot of knowledge of Sire. |
Hi @SofiaBariami, I noticed that you recently pushed to the Cheers. |
hi Lester, yes, can you delete the |
Hello, I am not sure whether I should post this question here or at the BioSimSpace repository, but I am trying to understand how we can set the "forcefield" property that is required when we want to merge two molecules. The standard process to set properties is to create an editable molecule and atoms and then set all the properties separately, as we can see in amber.cpp, but I can't find anything on forcefield.
At the BSS code, we can see at _molecule.py that this property is required and it should also have a specific Amber format.
Does anyone have any thoughts about that?
Thanks a lot!
The text was updated successfully, but these errors were encountered: