Answers.Body: <p>Note: as I don't have any working version of pymol at the moment,
  I am not able to test the solution properly.<br>
  However, an easy way is to first create a selection, and then to color it:</p>
  
  <pre><code>select toBecolored, resi 3-8
  color yellow, toBecolored
  </code></pre>
  
  <p>Regarding the L/H chain part, if they are effectively annotated as L and H, something like the following should work:</p>
  
  <pre><code>select toBeColored, ((i. 10-20 or i. 30-40) and c. L ) or ((i. 5-10+20-30) and c. H)
  color yellow, toBeColored
  </code></pre>
  
  <p>Combining both commands is probably possible as:</p>
  
  <pre><code>color yellow, ((i. 10-20 or i. 30-40) and c. L ) or ((i. 5-10+20-30) and c. H)
  </code></pre>
  
  <p>Pymol allows synonyms (eg. resi and i.  or chain and c.).</p>
  
  <p>The following pages may be also helpful:</p>
  
  <ul>
  <li><a href="https://pymolwiki.org/index.php/Selection_Algebra" rel="nofollow noreferrer">Pymol wiki: help on Selection</a></li>
  <li><a href="http://pymol.sourceforge.net/newman/user/S0220commands.htm" rel="nofollow noreferrer">SourceForge</a></li>
  </ul>
  
  <p>And the two following links, if you want to get a bit deeper in proper programming with python for pymol (as they can provide you with inspiration):</p>
  
  <ul>
  <li><a href="https://pymolwiki.org/index.php/Category:Plugins" rel="nofollow noreferrer">Pymol wiki: plugins</a></li>
  <li><a href="https://github.com/Pymol-Scripts/Pymol-script-repo" rel="nofollow noreferrer">Pymol scripts</a></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-16T14:54:09.983Z
Answers.Text: @Llopis: Thank you for the edit! It's a lot clearer now :)
Answers.UserDisplayName: Mitra
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-15T18:28:58.057Z
Answers.LastActivityDate: 2017-11-16T14:55:32.380Z
Answers.LastEditDate: 2017-11-16T14:55:32.380Z
Answers.UserDisplayName: Mitra
Body: <p>We can use</p>
  
  <pre><code>color yellow, resi 3
  color yellow, resi 3-8
  </code></pre>
  
  <p>to colour one residue or a range of residues. But what if I want to colour residue 3-8 and 10-20, how to write it?</p>
  
  <p>Also, my protein has two chains, light chain (L) with 100 residues and heavy chain (H) with 100 residues. How to colour the residue 10-20, 30-40 of light chain, and the residue 5-10, 20-30 of heavy chain in one go?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-15T18:21:02.317Z
Comments.Text: What you’ve written isn’t valid Python code. Is this in Pymol or similar?
Comments.UserDisplayName: Konrad Rudolph
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-15T18:28:48.587Z
Comments.Text: @KonradRudolph it is Pymol code (you can use python with pymol but in the GUI you can type pymol code)
Comments.UserDisplayName: Mitra
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-15T23:57:53.767Z
Comments.Text: I don't think that python is an appropriate tag for this post.  This really isn't a bioinformatics question.
Comments.UserDisplayName: Bioathlete
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-16T10:01:38.280Z
Comments.Text: there is no tag called "pymol", and where else would you recommend?
Comments.UserDisplayName: lanselibai
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-16T14:47:52.757Z
Comments.Text: @Bioathlete why wouldn't this be a bioinformatics question? Where would you have such question otherwise?
Comments.UserDisplayName: Mitra
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-16T16:14:55.393Z
Comments.Text: It is a general question for the use of a tool.  It belongs in a mailing or user list for that tool.
Comments.UserDisplayName: Bioathlete
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-16T18:28:42.430Z
Comments.Text: of course each software may have its own mailing list, like I use Gromacs as well. But we should still be able to ask questions here @Mitra thank you for changing it to tag pymol. I thought I do not have the authority as a newbie.
Comments.UserDisplayName: lanselibai
Tags: <pymol>
Title: How to colour multiple residues in Pymol?
ThreadText: # How to colour multiple residues in Pymol?
  
  (Asked by: username_0 on 2017-11-15)
  
  We can use
  
  ```
  color yellow, resi 3
  color yellow, resi 3-8
  
  ```
  
  to colour one residue or a range of residues. But what if I want to colour residue 3-8 and 10-20, how to write it?
  
  Also, my protein has two chains, light chain (L) with 100 residues and heavy chain (H) with 100 residues. How to colour the residue 10-20, 30-40 of light chain, and the residue 5-10, 20-30 of heavy chain in one go?
  
  **Tags:** pymol
  
  > **Comments:**
  > **username_1**: What you’ve written isn’t valid Python code. Is this in Pymol or similar?  
  > **username_2**: @username_1 it is Pymol code (you can use python with pymol but in the GUI you can type pymol code)  
  > **username_3**: I don't think that python is an appropriate tag for this post.  This really isn't a bioinformatics question.  
  > **username_0**: there is no tag called "pymol", and where else would you recommend?  
  > **username_2**: @username_3 why wouldn't this be a bioinformatics question? Where would you have such question otherwise?  
  > **username_3**: It is a general question for the use of a tool.  It belongs in a mailing or user list for that tool.  
  > **username_0**: of course each software may have its own mailing list, like I use Gromacs as well. But we should still be able to ask questions here @username_2 thank you for changing it to tag pymol. I thought I do not have the authority as a newbie.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-11-15. Score: 3 | Accepted answer
  
  Note: as I don't have any working version of pymol at the moment,
  I am not able to test the solution properly.  
  However, an easy way is to first create a selection, and then to color it:
  
  ```
  select toBecolored, resi 3-8
  color yellow, toBecolored
  
  ```
  
  Regarding the L/H chain part, if they are effectively annotated as L and H, something like the following should work:
  
  ```
  select toBeColored, ((i. 10-20 or i. 30-40) and c. L ) or ((i. 5-10+20-30) and c. H)
  color yellow, toBeColored
  
  ```
  
  Combining both commands is probably possible as:
  
  ```
  color yellow, ((i. 10-20 or i. 30-40) and c. L ) or ((i. 5-10+20-30) and c. H)
  
  ```
  
  Pymol allows synonyms (eg. resi and i. or chain and c.).
  
  The following pages may be also helpful:
  
  * [Pymol wiki: help on Selection](https://pymolwiki.org/index.php/Selection_Algebra)
  * [SourceForge](http://pymol.sourceforge.net/newman/user/S0220commands.htm)
  
  And the two following links, if you want to get a bit deeper in proper programming with python for pymol (as they can provide you with inspiration):
  
  * [Pymol wiki: plugins](https://pymolwiki.org/index.php/Category:Plugins)
  * [Pymol scripts](https://github.com/Pymol-Scripts/Pymol-script-repo)
  
  > **Comments:**
  > **username_2**: @Llopis: Thank you for the edit! It's a lot clearer now :)  
  
  ---
  
  