Answers.Body: <h2>Oligopeptide</h2>
  
  <p>The lipophilicity of an oligopeptide or a small molecule can be calculated with RDKit, the classic compChem python toolkit. The measure is <a href="https://en.wikipedia.org/wiki/Partition_coefficient" rel="nofollow noreferrer">logP or partition coefficient</a>, namely the magnitude of the ratio of the concentration in octanol over than in water, so the higher it is, the more it partitions in the octanol phase. However, with a compound of several dalton it may be good to see what the contribution of each atom to this score are. This measure is the Crippen contribution to logP, which can be handily plotted on the molecule. Note that these are may be at first glance look similar to Gastaiger partial changes, but are not.</p>
  
  <p>Okay, first the imports</p>
  
  <pre><code>from rdkit import Chem
  from rdkit.Chem import AllChem, Descriptors
  from rdkit.Chem.Draw import SimilarityMaps
  </code></pre>
  
  <p>Now let's make the molecules. Let's start with something we can simply use a SMILES string of the web: <a href="https://en.wikipedia.org/wiki/Bortezomib" rel="nofollow noreferrer">Bortezomib</a>.</p>
  
  <pre><code>name = 'Bortezomib'
  mol = Chem.MolFromSmiles('O=C(N[C@H](C(=O)N[C@H](B(O)O)CC(C)C)Cc1ccccc1)c2nccnc2')
  </code></pre>
  
  <p>Now we can do all the relevant calculations on the <code>mol</code> object:</p>
  
  <pre><code>print('logP', Descriptors.MolLogP(mol))
  AllChem.Compute2DCoords(mol)
  contribs = Chem.rdMolDescriptors._CalcCrippenContribs(mol)
  fig = SimilarityMaps.GetSimilarityMapFromWeights(mol, [x for x,y in contribs], colorMap='BuPu', contourLines=10)
  fig.savefig(name+'_crippen.png', bbox_inches='tight')
  </code></pre>
  
  <p>LogP=0.3
  <a href="https://i.sstatic.net/M6qEH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/M6qEH.png" alt="Bortezomib"></a></p>
  
  <p><code>colorMap='BuPu'</code> is the matplotlib colorscheme. I have no idea which work best, I have spent way too much time trying and I do not know. But with BuPu, white is hydrophilic, purple is hydrophobic.</p>
  
  <p>Say the oligopeptide does not have a SMILES or we don't want to do it that way. Let's take <a href="https://en.wikipedia.org/wiki/Casomorphin" rel="nofollow noreferrer">β-Casomorphins 1–3</a>:</p>
  
  <pre><code>name = 'β-Casomorphins 1–3'
  mol = Chem.MolFromFASTA('YPF')
  mol = AllChem.ReplaceSubstructs(mol,
                                  Chem.MolFromSmiles('N'),
                                  Chem.MolFromSmiles('[NH][OH]'),
                                  replacementConnectionPoint=0)[0]
  </code></pre>
  
  <p>The result with the last block from before gives:</p>
  
  <p>logP=1
  <a href="https://i.sstatic.net/1JHCC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/1JHCC.png" alt="casomorphin"></a></p>
  
  <h2>Proteins</h2>
  
  <p>With protein, it is a lot harder. Membrane affinity of protein is dependent on their structure. In PyMOL you can use the Adaptive Poisson-Boltzmann Solver (APBS) to show the surface by charge. For transmembrane protein there is clear ring of hydrophobicity —CHARMM-GUI membrane builder and a variety of tools for example can guess where it is. For a membrane associated protein only one side will be hydrophobic with a tell-tell charged ring around it (e.g. DHR1 domain) and there are no hard and tested methods for that.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T00:35:39.963Z
Answers.LastActivityDate: 2020-03-03T21:15:15.950Z
Answers.LastEditDate: 2020-03-03T21:15:15.950Z
Answers.UserDisplayName: Matteo Ferla
Body: <p>The question says it all. I want to calculate lipophilicity of proteins to screen the compounds out for antigen-antibody interactions.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-07T00:31:18.513Z
Comments.Text: Membrane affinity of protein is dependent on their structure and for a membrane associated protein only one side will be hydrophobic with a tell-tell charged ring around it (e.g. DHR1 domain). I.e. The structure or that of a homologue needs to be known.
Comments.UserDisplayName: Matteo Ferla
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-07T00:31:23.003Z
Comments.Text: I am not sure what you mean by " screen the compounds out for". Compounds normally means small molecules, but I have the feeling you mean the protein themselves (macromolecules). If so, that sounds like you are interested in doing global docking of a panel of protein vs. a threaded model (or similar) of an antibody, which is an absolute no go zone due to the propagated imprecision.
Comments.UserDisplayName: Matteo Ferla
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-07T07:31:15.113Z
Comments.Text: Agreed the question requires further clarification
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-10T21:49:31.407Z
Comments.Text: A clarification:
Comments.UserDisplayName: Nurlybek Amangeldiuly
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-10T21:59:52.583Z
Comments.Text: I am not going to dock anything. I would like to calculate the lipophilicity of peptides, so still the question  'How?' remains. Also, protein is a chemical compound.
Comments.UserDisplayName: Nurlybek Amangeldiuly
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-11T20:15:24.577Z
Comments.Text: If it's oligopeptides see https://biology.stackexchange.com/questions/89177/what-is-the-role-of-the-pyrrolidine-piperidine-moieties-in-fagopyrins/89233#89233 for code
Comments.UserDisplayName: Matteo Ferla
Tags: <protein-protein-interaction>
Title: How to calculate lipophilicity of proteins?
ThreadText: # How to calculate lipophilicity of proteins?
  
  (Asked by: username_0 on 2020-02-06)
  
  The question says it all. I want to calculate lipophilicity of proteins to screen the compounds out for antigen-antibody interactions.
  
  **Tags:** protein-protein-interaction
  
  > **Comments:**
  > **username_1**: Membrane affinity of protein is dependent on their structure and for a membrane associated protein only one side will be hydrophobic with a tell-tell charged ring around it (e.g. DHR1 domain). I.e. The structure or that of a homologue needs to be known.  
  > **username_1**: I am not sure what you mean by " screen the compounds out for". Compounds normally means small molecules, but I have the feeling you mean the protein themselves (macromolecules). If so, that sounds like you are interested in doing global docking of a panel of protein vs. a threaded model (or similar) of an antibody, which is an absolute no go zone due to the propagated imprecision.  
  > **username_2**: Agreed the question requires further clarification  
  > **username_0**: A clarification:  
  > **username_0**: I am not going to dock anything. I would like to calculate the lipophilicity of peptides, so still the question  'How?' remains. Also, protein is a chemical compound.  
  > **username_1**: If it's oligopeptides see https://biology.stackexchange.com/questions/89177/what-is-the-role-of-the-pyrrolidine-piperidine-moieties-in-fagopyrins/89233#89233 for code  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-02-12. Score: 2 | Accepted answer
  
  ## Oligopeptide
  
  The lipophilicity of an oligopeptide or a small molecule can be calculated with RDKit, the classic compChem python toolkit. The measure is [logP or partition coefficient](https://en.wikipedia.org/wiki/Partition_coefficient), namely the magnitude of the ratio of the concentration in octanol over than in water, so the higher it is, the more it partitions in the octanol phase. However, with a compound of several dalton it may be good to see what the contribution of each atom to this score are. This measure is the Crippen contribution to logP, which can be handily plotted on the molecule. Note that these are may be at first glance look similar to Gastaiger partial changes, but are not.
  
  Okay, first the imports
  
  ```
  from rdkit import Chem
  from rdkit.Chem import AllChem, Descriptors
  from rdkit.Chem.Draw import SimilarityMaps
  
  ```
  
  Now let's make the molecules. Let's start with something we can simply use a SMILES string of the web: [Bortezomib](https://en.wikipedia.org/wiki/Bortezomib).
  
  ```
  name = 'Bortezomib'
  mol = Chem.MolFromSmiles('O=C(N[C@H](C(=O)N[C@H](B(O)O)CC(C)C)Cc1ccccc1)c2nccnc2')
  
  ```
  
  Now we can do all the relevant calculations on the `mol` object:
  
  ```
  print('logP', Descriptors.MolLogP(mol))
  AllChem.Compute2DCoords(mol)
  contribs = Chem.rdMolDescriptors._CalcCrippenContribs(mol)
  fig = SimilarityMaps.GetSimilarityMapFromWeights(mol, [x for x,y in contribs], colorMap='BuPu', contourLines=10)
  fig.savefig(name+'_crippen.png', bbox_inches='tight')
  
  ```
  
  LogP=0.3
  [![Bortezomib](https://i.sstatic.net/M6qEH.png)](https://i.sstatic.net/M6qEH.png)
  
  `colorMap='BuPu'` is the matplotlib colorscheme. I have no idea which work best, I have spent way too much time trying and I do not know. But with BuPu, white is hydrophilic, purple is hydrophobic.
  
  Say the oligopeptide does not have a SMILES or we don't want to do it that way. Let's take [β-Casomorphins 1–3](https://en.wikipedia.org/wiki/Casomorphin):
  
  ```
  name = 'β-Casomorphins 1–3'
  mol = Chem.MolFromFASTA('YPF')
  mol = AllChem.ReplaceSubstructs(mol,
                                  Chem.MolFromSmiles('N'),
                                  Chem.MolFromSmiles('[NH][OH]'),
                                  replacementConnectionPoint=0)[0]
  
  ```
  
  The result with the last block from before gives:
  
  logP=1
  [![casomorphin](https://i.sstatic.net/1JHCC.png)](https://i.sstatic.net/1JHCC.png)
  
  ## Proteins
  
  With protein, it is a lot harder. Membrane affinity of protein is dependent on their structure. In PyMOL you can use the Adaptive Poisson-Boltzmann Solver (APBS) to show the surface by charge. For transmembrane protein there is clear ring of hydrophobicity —CHARMM-GUI membrane builder and a variety of tools for example can guess where it is. For a membrane associated protein only one side will be hydrophobic with a tell-tell charged ring around it (e.g. DHR1 domain) and there are no hard and tested methods for that.
  
  
  ---
  
  