Skip to content
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

Check out input PDB files prior parameterizing #77

Closed
martimunicoy opened this issue Oct 27, 2020 · 2 comments · Fixed by #86 or #99
Closed

Check out input PDB files prior parameterizing #77

martimunicoy opened this issue Oct 27, 2020 · 2 comments · Fixed by #86 or #99
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@martimunicoy
Copy link
Owner

Description

For instance, offpele would fail if the input PDB that contains the ligand to parameterize has atoms with unconsistent residue names. The exception raised in this case is totally misleading.

Solution

Implement a safety check for PDB files in order to properly handle exceptions related with its format prior running the parameterization.

@martimunicoy martimunicoy added enhancement New feature or request good first issue Good for newcomers labels Oct 27, 2020
@martimunicoy
Copy link
Owner Author

martimunicoy commented Nov 3, 2020

Support

List of features to check in the input PDB:

  • All atom names need to be unique. Otherwise raise Exception('Ligand in input PDB has no unique atom names')
  • All residue ids must match. Otherwise raise Exception('A single ligand with immutable residue ids is expected')
  • All residue names must match. Otherwise raise Exception('A single ligand with immutable residue names is expected')
  • Check for at least one CONECT line. Otherwise output a warning: 'Input PDB has no information about the connectivity and this could result in an unexpected bond assignment')

@laumalo
Copy link
Collaborator

laumalo commented Nov 3, 2020

Implementation

The function _PDB_chekup(path) has been included in the class Molecule.
And it runs prior running the parametrization, here.

#Validate PDB
self._PDB_checkup(path)

Tests

PDBs that test the three posible errors and one warning: pdb_errors.zip

  • For the following PDB file in which the atom name C1 is repeated:
HETATM    1  C1  UNK     1       0.634  -0.083   0.007  1.00  0.00           C  
HETATM    2  C1  UNK     1      -0.671   0.098  -0.007  1.00  0.00           C  
HETATM    3  H1  UNK     1       1.354   0.739   0.049  1.00  0.00           H  
HETATM    4  H2  UNK     1       1.082  -1.071  -0.022  1.00  0.00           H  
HETATM    5  H3  UNK     1      -1.096   1.088   0.022  1.00  0.00           H  
HETATM    6  H4  UNK     1      -1.302  -0.770  -0.049  1.00  0.00           H  
CONECT    1    2    2    3    4
CONECT    2    5    6
END

It raises the exception:

Exception: Ligand in input PDB has no unique atom names
  • For the following PDB file in which the residue id for the atom H3 does not match:
HETATM    1  C1  UNK     1       0.634  -0.083   0.007  1.00  0.00           C  
HETATM    2  C2  UNK     1      -0.671   0.098  -0.007  1.00  0.00           C  
HETATM    3  H1  UNK     1       1.354   0.739   0.049  1.00  0.00           H  
HETATM    4  H2  UNK     1       1.082  -1.071  -0.022  1.00  0.00           H  
HETATM    5  H3  UNK     2      -1.096   1.088   0.022  1.00  0.00           H  
HETATM    6  H4  UNK     1      -1.302  -0.770  -0.049  1.00  0.00           H  
CONECT    1    2    2    3    4
CONECT    2    5    6
END

It raises the exception:

Exception: A single ligand with immutable residue ids is expected
  • For the following PDB file in which the residue name for the atom H1 does not match:
HETATM    1  C1  UNK     1       0.634  -0.083   0.007  1.00  0.00           C  
HETATM    2  C2  UNK     1      -0.671   0.098  -0.007  1.00  0.00           C  
HETATM    3  H1  UNN     1       1.354   0.739   0.049  1.00  0.00           H  
HETATM    4  H2  UNK     1       1.082  -1.071  -0.022  1.00  0.00           H  
HETATM    5  H3  UNK     1      -1.096   1.088   0.022  1.00  0.00           H  
HETATM    6  H4  UNK     1      -1.302  -0.770  -0.049  1.00  0.00           H  
CONECT    1    2    2    3    4
CONECT    2    5    6
END

It raises the exception:

Exception: A single ligand with immutable residue names is expected

Unit tests here.

@laumalo laumalo linked a pull request Nov 5, 2020 that will close this issue
5 tasks
@martimunicoy martimunicoy linked a pull request Dec 1, 2020 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants