<blockquote>
  <p>This answer is no longer on topic. The question is about what is the best machine learning algorithm to use to analyse atomic coordinates from an MD trajectory in order to infer a novel properties.</p>
</blockquote>

<p>&nbsp;</p>

<blockquote>
  <p>Also, it should be preface for any confused reader that unfortunately "feature" is a technical term in both genetics and statistics. For the former <a href="https://en.wikipedia.org/wiki/General_feature_format" rel="nofollow noreferrer">a feature</a> is a region of DNA, RNA or protein that has a given property, such as open reading frame or PFAM domain. While in the latter <a href="https://en.wikipedia.org/wiki/Feature_(machine_learning)" rel="nofollow noreferrer">a feature</a> is a preferably independent property that forms part of a feature vector for different types of machine learning.</p>
</blockquote>

<h2>Heavy atoms are common</h2>

<p>Assuming the pH difference only results in protonations, the protons differ between the two conditions, but not the heavy atoms. These will retain all the side chain information.</p>

<h2>Merit of backbone only</h2>

<p><em>(Section no longer relevant due to OP edit)</em></p>

<p>The common metric used to compare two structures is root mean square deviation (RMSD) of the alpha carbons to assess how much does the backbone differ and with analysis of MD simulations it is used to assess whether one is more dynamic than the other (e.g. this <a href="https://bioinformatics.stackexchange.com/questions/11036/how-to-interpret-the-gromacs-md-simulation-rmsd-graph/11045">Bioinformatics SE question</a>). The reason why the RMSD is done with the alpha carbons and not the minimum common subset of atoms is that backbone changes are large scale, while the side chain changes only affect locally —so their inclusion would needlessly dilute the score. The C prime and backbone nitrogens behave like the C alpha so there is no need for these.</p>

<h2>Extraction of coordinates</h2>

<p>Assuming by features you mean atomic coordinates, there are loads of ways. Using Pymol module for Python, one could do something like:</p>

<pre><code>import pymol2
with pymol2.PyMOL() as pymol: #can be parallelised
    pymol.cmd.load('trajectory.gro', 'mytraj')
    pymol.cmd.remove('h.') #remove hydrogens
    pymol.cmd.intra_fit("name CA", 1) #align all steps in the trajectory
    for i in range(1, pymol.cmd.count_states('mytraj')):
        for atom in pymol.cmd.get_model(f'state {i}').atom:
            atom.coord #List[int int int]
</code></pre>

<p>One could change <code>pymol.cmd.get_model(f'state {i}')</code> to select <code>state {i} and name CA</code> for C&alpha;s only.</p>

<h2>Edit: Mutated residues</h2>

<p>In the case of mutated residues or residue differences due to the two proteins being close homologues, "mutating" the differing residues to alanine, i.e. by stripping all heavy atom beyond the C&beta; (keeping C&prime;, C&alpha;, H, N, O &amp; C&beta;) in the MD trajectory —or glycine if one is glycine. If they are homologues with different lengths, this approach would mean skipping residues that match up with gaps in the MSA. Even though not uncommon for statistically analyses, it does pose some issues statistically. It may unbury hidden residues, but length variant generally happens with loops.</p>

<p>In the snippet above, the pymol mutagenesis wizard could be used, but that is overkill, does not work in parallel and the approach does not port to other PDB reading modules in whatever language one wants. So say you have a list <code>to_be_trimmed</code> of integers of PDB residue indices (not pose residue indices):</p>

<pre><code>if atom.resi not in to_be_trimmed or atom.name.strip() in ('C', 'CA', 'H', 'N', 'O', 'CB'):
      do whatever with atom.coord 
</code></pre>

<p>In acidic environments, you get some funky things happening like exposed aspartate-glycine residue pairs forming <a href="https://en.wikipedia.org/wiki/Isoaspartate" rel="nofollow noreferrer">isoaspartate</a> or exposed aspartate-proline resulting in <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3149706/" rel="nofollow noreferrer">a cleavage</a>, etc. For these cases, which are nearly never modelled, ignoring these values is the best option.</p>

<h2>Edit: small comment on SASA</h2>

<p>The investigated property list is very extensive and some reader may adopt them. So I thought I should mention that per residue SASA is generally converted to relative surface area, which is residue independent, by dividing it by the maximum SASA for that residue (values from Tien et al. 2013: <code>'A': 121.0, 'R': 265.0, 'N': 187.0, 'D': 187.0, 'C': 148.0, 'E': 214.0, 'Q': 214.0, 'G': 97.0, 'H': 216.0, 'I': 195.0, 'L': 191.0, 'K': 230.0, 'M': 203.0, 'F': 228.0, 'P': 154.0, 'S': 143.0, 'T': 163.0, 'W': 264.0, 'Y': 255.0, 'V': 165.0}</code>), where RSA > 0.2 is an exposed residue.</p>

CC BY-SA 4.0
2020-03-27T02:11:58.727Z
thanks, I have updated my question.
lanselibai
CC BY-SA 4.0
2020-03-26T22:54:31.533Z
2020-03-27T09:54:20.510Z
2020-03-27T09:54:20.510Z
Matteo Ferla
<p>I want to compare the protein dynamics 
) pH 7 versus pH 3, or 
) wild type versus mutant</p>

<p>The protein will have slightly different number of atoms at each condition, due to protonation or mutation, which is bad for machine learning. The alternative is to only consider the alpha-carbon atoms, but this will lose significant amount of information (e.g. side chain, salt bridge).</p>

<p>Is there a way in molecular dynamics to extract features from ensembles of different number of atoms?</p>

<p>Note: I have used common methods to decipher the difference between two conditions, including RMSD, RMSF, Rg, secondary structure, salt bridge, SASA, etc. They can explain the difference to some extent. However, I feel the selection of properties is "subjective", and there must be some hidden features not known. So I am seeking a machine learning method, that can "automatically" capture the most essential properties based on the coordinates as inputs.</p>

<machine-learning><features>
Feature extraction methods that can handle inconsistent numbers of atoms for molecular dynamics
# Feature extraction methods that can handle inconsistent numbers of atoms for molecular dynamics

(Asked by: username_0 on 2020-03-26)

I want to compare the protein dynamics
) pH 7 versus pH 3, or
) wild type versus mutant

The protein will have slightly different number of atoms at each condition, due to protonation or mutation, which is bad for machine learning. The alternative is to only consider the alpha-carbon atoms, but this will lose significant amount of information (e.g. side chain, salt bridge).

Is there a way in molecular dynamics to extract features from ensembles of different number of atoms?

Note: I have used common methods to decipher the difference between two conditions, including RMSD, RMSF, Rg, secondary structure, salt bridge, SASA, etc. They can explain the difference to some extent. However, I feel the selection of properties is "subjective", and there must be some hidden features not known. So I am seeking a machine learning method, that can "automatically" capture the most essential properties based on the coordinates as inputs.

**Tags:** machine-learning, features

---

## 1 answers

### Answer by username_1 on 2020-03-26. Score: 1

This answer is no longer on topic. The question is about what is the best machine learning algorithm to use to analyse atomic coordinates from an MD trajectory in order to infer a novel properties.

 

Also, it should be preface for any confused reader that unfortunately "feature" is a technical term in both genetics and statistics. For the former a feature is a region of DNA, RNA or protein that has a given property, such as open reading frame or PFAM domain. While in the latter a feature is a preferably independent property that forms part of a feature vector for different types of machine learning.

Heavy atoms are common
Assuming the pH difference only results in protonations, the protons differ between the two conditions, but not the heavy atoms. These will retain all the side chain information.
Merit of backbone only
(Section no longer relevant due to OP edit)
The common metric used to compare two structures is root mean square deviation (RMSD) of the alpha carbons to assess how much does the backbone differ and with analysis of MD simulations it is used to assess whether one is more dynamic than the other (e.g. this Bioinformatics SE question). The reason why the RMSD is done with the alpha carbons and not the minimum common subset of atoms is that backbone changes are large scale, while the side chain changes only affect locally —so their inclusion would needlessly dilute the score. The C prime and backbone nitrogens behave like the C alpha so there is no need for these.
Extraction of coordinates
Assuming by features you mean atomic coordinates, there are loads of ways. Using Pymol module for Python, one could do something like:
import pymol2
with pymol2.PyMOL() as pymol: #can be parallelised
    pymol.cmd.load('trajectory.gro', 'mytraj')
    pymol.cmd.remove('h.') #remove hydrogens
    pymol.cmd.intra_fit("name CA", 1) #align all steps in the trajectory
    for i in range(1, pymol.cmd.count_states('mytraj')):
        for atom in pymol.cmd.get_model(f'state {i}').atom:
            atom.coord #List[int int int]

One could change pymol.cmd.get_model(f'state {i}') to select state {i} and name CA for Cαs only.
Edit: Mutated residues
In the case of mutated residues or residue differences due to the two proteins being close homologues, "mutating" the differing residues to alanine, i.e. by stripping all heavy atom beyond the Cβ (keeping C′, Cα, H, N, O & Cβ) in the MD trajectory —or glycine if one is glycine. If they are homologues with different lengths, this approach would mean skipping residues that match up with gaps in the MSA. Even though not uncommon for statistically analyses, it does pose some issues statistically. It may unbury hidden residues, but length variant generally happens with loops.
In the snippet above, the pymol mutagenesis wizard could be used, but that is overkill, does not work in parallel and the approach does not port to other PDB reading modules in whatever language one wants. So say you have a list to_be_trimmed of integers of PDB residue indices (not pose residue indices):
if atom.resi not in to_be_trimmed or atom.name.strip() in ('C', 'CA', 'H', 'N', 'O', 'CB'):
      do whatever with atom.coord 

In acidic environments, you get some funky things happening like exposed aspartate-glycine residue pairs forming isoaspartate or exposed aspartate-proline resulting in a cleavage, etc. For these cases, which are nearly never modelled, ignoring these values is the best option.
Edit: small comment on SASA
The investigated property list is very extensive and some reader may adopt them. So I thought I should mention that per residue SASA is generally converted to relative surface area, which is residue independent, by dividing it by the maximum SASA for that residue (values from Tien et al. 2013: 'A': 121.0, 'R': 265.0, 'N': 187.0, 'D': 187.0, 'C': 148.0, 'E': 214.0, 'Q': 214.0, 'G': 97.0, 'H': 216.0, 'I': 195.0, 'L': 191.0, 'K': 230.0, 'M': 203.0, 'F': 228.0, 'P': 154.0, 'S': 143.0, 'T': 163.0, 'W': 264.0, 'Y': 255.0, 'V': 165.0}), where RSA > 0.2 is an exposed residue.

> **Comments:**
> **username_0**: thanks, I have updated my question.  

---

