Answers.Body: <p>Amino-acid content (eg Lys, Asp) can have drastic effect on observance in a particular MS-mode.</p>
  
  <p>You should consider including <code>Peptides::pI()</code> or <code>Peptides::charge()</code> to determine the likelihood of (de-)protonation in your calculations.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-03T16:24:46.723Z
Answers.LastActivityDate: 2018-04-03T16:24:46.723Z
Answers.UserDisplayName: chasemc
Answers.Body: <p>Your approach in general seems to be OK, but I have a few suggestions:</p>
  
  <ol>
  <li>You are basing all your calculations on whether the pH is above or below 7. However the N and C termini have pKa values that determine whether these groups will be ionized (8 and 3, respectively). You should check whether the pH is above/below these values instead of 7.</li>
  <li>Different amino acid side chains can also be ionized and should be accounted for when calculating the MW. Amino acid pKas can be found <a href="http://www.chem.ucla.edu/~rebecca/153A/amino_acids.pdf" rel="noreferrer">here</a></li>
  <li>Code wise: you pass a variable unimod_location in your function but it's never used. If it's not being used then take it out.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-21T20:17:52.403Z
Answers.LastActivityDate: 2018-02-21T20:17:52.403Z
Answers.UserDisplayName: Sevy
Body: <p>I'm using the <em>Peptides</em> package in R to calculate the mass of peptides with the mw() method. The thing is that I want to calculate them for different pH values, and thus I wrote this little function to take the pH value into account according this image:</p>
  
  <p><a href="https://i.sstatic.net/iA96t.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iA96t.jpg" alt="Enter image description here"></a></p>
  
  <p>My code is this:</p>
  
  <pre><code>phmw = function(pept_seq , unimod_location, pH ){
  
    monoisotopic_hydrogen_mass = 1.00794
  
    if(pH &lt; 7){
  
      # mol_weight = mol_weight_of_peptide + mol_weight_of_Hydrogen
      mol_weight = mw(pept_seq, monoisotopic = T) + monoisotopic_hydrogen_mass
  
    }else if(pH &gt; 7){
  
      # mol_weight = mol_weight_of_peptide - mol_weight_of_Hydrogen
      mol_weight = mw(pept_seq, monoisotopic = T) - monoisotopic_hydrogen_mass
  
    }else if(pH == 7){
  
      # mol_weight = mol_weight_of_peptide 
      mol_weight = mw(pept_seq, monoisotopic = T) 
    }
  
    return(mol_weight)
  
  }
  </code></pre>
  
  <p>Do you think that this approach is correct or not?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-20T16:14:41.517Z
Comments.Text: The code is correct as far as I can tell but there’s a lot to be said about style. The code can be made a lot shorter and more readable. Furthermore, don’t use `T` instead of `TRUE, and don’t use `return` (which is unnecessary here). Generally I suggest reading the [Tidyverse style guide](http://style.tidyverse.org/), even if you decide not to follow it.
Comments.UserDisplayName: Konrad Rudolph
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-21T04:29:21.570Z
Comments.Text: I'm curious as to the practical application? Is your interest specifically in peptides in solution at different pH values? Just wondering because most peptide MW prediction is with reference to mass spectrometry, where pH is not really relevant.
Comments.UserDisplayName: neilfws
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-21T09:52:20.367Z
Comments.Text: If you want completely accurate monoisotopic mass you should use the mass of the proton rather than hydrogen. (The difference is the mass of electron).
  I second the question of practical applicability since each amino acid will have individual pKa, moreover, in the peptide neighboring amino acids will interact. Thus the protonation and deprotonation will happen at the different pH.
Comments.UserDisplayName: Vladimir Gorshkov
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-21T19:35:44.680Z
Comments.Text: Actually I'm trying to mimic the mass spec for some peptides and see if I can characterize them as detectable by their m/z. 
  @neilfws Didn't understand exactly what you said. The algorithm behind the mw() assigns the masses of the a.a's from mass spec knowledge ? But one can run a mass spec experiment with different pH values ( Something that changes the mass of the total peptide). Which of these masses does the mw() algorithm uses ?
Comments.UserDisplayName: J. Doe
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-24T22:22:13.393Z
Comments.Text: I'm just wondering whether protons gained by protonation due to low pH are relevant to the ions generated during MS. For example in electrospray MS "it became evident that there is no correlation between solution charging and electrospray charging" - https://www.hindawi.com/journals/ijac/2012/282574/. I would think solution protons would be lost during fragmentation and ion generation.
Comments.UserDisplayName: neilfws
Tags: <r><proteins>
Title: Influence of pH on protein peptide mass
ThreadText: # Influence of pH on protein peptide mass
  
  (Asked by: username_0 on 2017-07-20)
  
  I'm using the *Peptides* package in R to calculate the mass of peptides with the mw() method. The thing is that I want to calculate them for different pH values, and thus I wrote this little function to take the pH value into account according this image:
  
  [![Enter image description here](https://i.sstatic.net/iA96t.jpg)](https://i.sstatic.net/iA96t.jpg)
  
  My code is this:
  
  ```
  phmw = function(pept_seq , unimod_location, pH ){
  
    monoisotopic_hydrogen_mass = 1.00794
  
    if(pH < 7){
  
      # mol_weight = mol_weight_of_peptide + mol_weight_of_Hydrogen
      mol_weight = mw(pept_seq, monoisotopic = T) + monoisotopic_hydrogen_mass
  
    }else if(pH > 7){
  
      # mol_weight = mol_weight_of_peptide - mol_weight_of_Hydrogen
      mol_weight = mw(pept_seq, monoisotopic = T) - monoisotopic_hydrogen_mass
  
    }else if(pH == 7){
  
      # mol_weight = mol_weight_of_peptide 
      mol_weight = mw(pept_seq, monoisotopic = T) 
    }
  
    return(mol_weight)
  
  }
  
  ```
  
  Do you think that this approach is correct or not?
  
  **Tags:** r, proteins
  
  > **Comments:**
  > **username_1**: The code is correct as far as I can tell but there’s a lot to be said about style. The code can be made a lot shorter and more readable. Furthermore, don’t use `T` instead of `TRUE, and don’t use `return` (which is unnecessary here). Generally I suggest reading the [Tidyverse style guide](http://style.tidyverse.org/), even if you decide not to follow it.  
  > **username_2**: I'm curious as to the practical application? Is your interest specifically in peptides in solution at different pH values? Just wondering because most peptide MW prediction is with reference to mass spectrometry, where pH is not really relevant.  
  > **username_3**: If you want completely accurate monoisotopic mass you should use the mass of the proton rather than hydrogen. (The difference is the mass of electron). I second the question of practical applicability since each amino acid will have individual pKa, moreover, in the peptide neighboring amino acids will interact. Thus the protonation and deprotonation will happen at the different pH.  
  > **username_0**: Actually I'm trying to mimic the mass spec for some peptides and see if I can characterize them as detectable by their m/z.  @username_2 Didn't understand exactly what you said. The algorithm behind the mw() assigns the masses of the a.a's from mass spec knowledge ? But one can run a mass spec experiment with different pH values ( Something that changes the mass of the total peptide). Which of these masses does the mw() algorithm uses ?  
  > **username_2**: I'm just wondering whether protons gained by protonation due to low pH are relevant to the ions generated during MS. For example in electrospray MS "it became evident that there is no correlation between solution charging and electrospray charging" - https://www.hindawi.com/journals/ijac/2012/282574/. I would think solution protons would be lost during fragmentation and ion generation.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_5 on 2018-02-21. Score: 6
  
  Your approach in general seems to be OK, but I have a few suggestions:
  
  1. You are basing all your calculations on whether the pH is above or below 7. However the N and C termini have pKa values that determine whether these groups will be ionized (8 and 3, respectively). You should check whether the pH is above/below these values instead of 7.
  2. Different amino acid side chains can also be ionized and should be accounted for when calculating the MW. Amino acid pKas can be found [here](http://www.chem.ucla.edu/~rebecca/153A/amino_acids.pdf)
  3. Code wise: you pass a variable unimod\_location in your function but it's never used. If it's not being used then take it out.
  
  
  ---
  
  ### Answer by username_4 on 2018-04-03. Score: 3
  
  Amino-acid content (eg Lys, Asp) can have drastic effect on observance in a particular MS-mode.
  
  You should consider including `Peptides::pI()` or `Peptides::charge()` to determine the likelihood of (de-)protonation in your calculations.
  
  
  ---
  
  