[WIP] PDB parser and writer use the "elements" topology attribute#2442
[WIP] PDB parser and writer use the "elements" topology attribute#2442
Conversation
|
The changes cause a difference in the behaviour of the writer which I do not know how to handle. The default for a missing element symbol is an empty string. When the element symbols are available to the writer, then the writer omits the missing one, leaving the field empty. This is different from the current behaviour that guesses all the element symbols. This difference is made visible by a test where the initial PDB input fills some, but not all, the element symbols, and the output PDB is expected to have the missing ones. My feeling is that guessing the missing symbols should be an active decision of the user, and I would be tempted to adapt the failing test. Though, I would like to hear what others would think about this. if a PDB file specifies some, but not all, element symbols, then the missing symbols default to an empty string. If you then write a new PDB file |
|
I think it makes most sense to either have the column or not. Can we guess elements ahead of time and only write if they are all defined? |
@jbarnoud I think this sounds very reasonable, especially because the guessers can have problems with some atom names found in the wild (see If the |
|
Hello, I am writing this message because I am experiencing similar issues. I am using MDAnalysis to separate protein-ligand pairs to, later, parametrize for MD where correct atom typing and valencies are essential. It essentially transforms some Bromides (Br) into boron (B) my code goes as follow:
An excerpt from this input file is shown below. The code returns for ./LIG.pdb |
|
@jbarnoud sorry to be digging up an old PR. It'd be really great to get this fixed (it's an ongoing issue for a few things I deal with downstream). Is this something you're still willing to work on? Otherwise, given the large changes to the PDB parser since this PR started, I'd be willing to create a superseding PR if that was ok with you? |
|
@IAlibay This is still on my radar and bumped up in my TODO recently, but I cannot guarantee a timeframe. Please go ahead if you think you can send some time on it soon. Ping me when you need your code reviewed. |
|
Closing this now that superseding PR #3001 has been merged. |
Fixes #2422 #2423
Changes made in this Pull Request:
elementstopology attribute if the appropriate column is filled in the input. The content ofelementsis the same asatomtypes.elementstopology attribute if available.PR Checklist