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

How to eliminate hydrogen #243

Closed
yhgon opened this issue Feb 14, 2022 · 4 comments
Closed

How to eliminate hydrogen #243

yhgon opened this issue Feb 14, 2022 · 4 comments

Comments

@yhgon
Copy link

yhgon commented Feb 14, 2022

I add heterogen and water and output is expected as input.pdb and output.pdb
however, when I delete heterogen with fixer.removeHeterogens(False) option as below del_het.pdb
it still have Hydrogen atom. how to eliminate it?

input PDB

ATOM      1  N   MET A   1      -0.522   1.364   0.000  1.00  0.00           N  
ATOM      2  CA  MET A   1       0.000   0.000   0.000  1.00  0.00           C  
ATOM      3  C   MET A   1       1.520   0.000   0.000  1.00  0.00           C  
ATOM      4  O   MET A   1       2.145  -0.050   1.058  1.00  0.00           O  
ATOM      5  CB  MET A   1      -0.507  -0.774  -1.206  1.00  0.00           C  
ATOM      6  CG  MET A   1      -2.013  -0.981  -1.209  1.00  0.00           C  
ATOM      7  SD  MET A   1      -2.587  -1.914  -2.650  1.00  0.00           S  
ATOM      8  CE  MET A   1      -1.935  -3.537  -2.272  1.00  0.00           C  

output.pdb

REMARK   1 CREATED WITH OPENMM 7.7, 2022-02-14
ATOM      1  N   MET A   1      -0.522   1.364   0.000  1.00  0.00           N  
ATOM      2  H   MET A   1       0.266   2.221  -0.271  1.00  0.00           H  
ATOM      3  H2  MET A   1      -1.263   1.765  -0.863  1.00  0.00           H  
ATOM      4  H3  MET A   1      -1.329   1.485   0.881  1.00  0.00           H  
ATOM      5  CA  MET A   1       0.000   0.000   0.000  1.00  0.00           C  
ATOM      6  HA  MET A   1      -0.206  -0.581   1.024  1.00  0.00           H  
ATOM      7  C   MET A   1       1.520   0.000   0.000  1.00  0.00           C  
ATOM      8  O   MET A   1       2.145  -0.050   1.058  1.00  0.00           O  
ATOM      9  CB  MET A   1      -0.507  -0.774  -1.206  1.00  0.00           C  
ATOM     10  HB2 MET A   1      -0.582  -0.598  -2.388  1.00  0.00           H  
ATOM     11  HB3 MET A   1       0.076  -1.805  -1.068  1.00  0.00           H  
ATOM     12  CG  MET A   1      -2.013  -0.981  -1.209  1.00  0.00           C  
ATOM     13  HG2 MET A   1      -2.397  -1.366  -0.145  1.00  0.00           H  
ATOM     14  HG3 MET A   1      -3.032  -0.447  -1.541  1.00  0.00           H  
ATOM     15  SD  MET A   1      -2.587  -1.914  -2.650  1.00  0.00           S  
ATOM     16  CE  MET A   1      -1.935  -3.537  -2.272  1.00  0.00           C  
ATOM     17  HE1 MET A   1      -0.990  -3.536  -1.554  1.00  0.00           H  
ATOM     18  HE2 MET A   1      -2.900  -4.001  -1.744  1.00  0.00           H  
ATOM     19  HE3 MET A   1      -1.848  -3.810  -3.429  1.00  0.00           H  

del_het.pdb

REMARK   1 CREATED WITH OPENMM 7.7, 2022-02-14
ATOM      1  N   MET A   1      -0.522   1.364   0.000  1.00  0.00           N  
ATOM      2  H   MET A   1       0.266   2.221  -0.271  1.00  0.00           H  
ATOM      3  H2  MET A   1      -1.263   1.765  -0.863  1.00  0.00           H  
ATOM      4  H3  MET A   1      -1.329   1.485   0.881  1.00  0.00           H  
ATOM      5  CA  MET A   1       0.000   0.000   0.000  1.00  0.00           C  
ATOM      6  HA  MET A   1      -0.206  -0.581   1.024  1.00  0.00           H  
ATOM      7  C   MET A   1       1.520   0.000   0.000  1.00  0.00           C  
ATOM      8  O   MET A   1       2.145  -0.050   1.058  1.00  0.00           O  
ATOM      9  CB  MET A   1      -0.507  -0.774  -1.206  1.00  0.00           C  
ATOM     10  HB2 MET A   1      -0.582  -0.598  -2.388  1.00  0.00           H  
ATOM     11  HB3 MET A   1       0.076  -1.805  -1.068  1.00  0.00           H  
ATOM     12  CG  MET A   1      -2.013  -0.981  -1.209  1.00  0.00           C  
ATOM     13  HG2 MET A   1      -2.397  -1.366  -0.145  1.00  0.00           H  
ATOM     14  HG3 MET A   1      -3.032  -0.447  -1.541  1.00  0.00           H  
ATOM     15  SD  MET A   1      -2.587  -1.914  -2.650  1.00  0.00           S  
ATOM     16  CE  MET A   1      -1.935  -3.537  -2.272  1.00  0.00           C  
ATOM     17  HE1 MET A   1      -0.990  -3.536  -1.554  1.00  0.00           H  
ATOM     18  HE2 MET A   1      -2.900  -4.001  -1.744  1.00  0.00           H  
ATOM     19  HE3 MET A   1      -1.848  -3.810  -3.429  1.00  0.00           H  
@peastman
Copy link
Member

Heterogens and hydrogens are totally different things. Heterogens are residues other than standard amino acids and nucleotides. If you don't want to add hydrogens, don't call addMissingHydrogens().

@yhgon
Copy link
Author

yhgon commented Feb 15, 2022

These Hydrogens came from Add Hydrogen, Add Solvent process to prepare OpenMM simulation. I want to delete hydrogens after OpenMM simulation compare Rg with original PDB. So I make these simple step to reproduce my situation.

I want to know any option to eliminate these hydrogens in protein residues without any external tools.

@peastman
Copy link
Member

You can use Modeller.delete() to do that. See http://docs.openmm.org/latest/userguide/application/03_model_building_editing.html and http://docs.openmm.org/latest/api-python/generated/openmm.app.modeller.Modeller.html#openmm.app.modeller.Modeller.delete. Something like this:

hydrogens = [a for a in topology.atoms() if a.element == element.hydrogen]
modeller.delete(hydrogens)

@yhgon
Copy link
Author

yhgon commented Feb 18, 2022

thanks what I want. I hope PDFFixer would add this feature in additional function.

@yhgon yhgon closed this as completed Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants