Answers.Body: <p>I know that structure way too well —SARS-COV-2 MPro.</p>
  <p>In PyMOL command line</p>
  <pre><code> remove resn 02J or 010
  </code></pre>
  <p>or</p>
  <pre><code> cmd.remove('resn 02J or 010')
  </code></pre>
  <p>In python</p>
  <pre><code> import pymol2
   with pymol2.PyMOL() as pymol:
        pymol.cmd.fetch('6LU7')
        pymol.cmd.remove('resn 02J or 010')
        pymol.cmd.save('6LU7.mod.pdb') 
        #or pdbblock = pymol.cmd.get_pdbstr()
  </code></pre>
  <p>From the sounds of it you'd like to make the peptidomimetic a peptide. If you wanted to do the horrid thing of making PJE, the capped side chain glutamine ketamide, into glutamine, the command to rename atoms is a multitude of <code>cmd.alter('resn PJE and name &lt;atomname&gt;', 'name=&quot;&lt;newname&gt;&quot;)</code> followed by a <code>cmd.alter('resn PJE', 'resn=&quot;GLN&quot;')</code> and lastly <code>cmd.sort()</code> to commit the changes. Not pretty, but is all in PyMOL.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-08T16:07:34.247Z
Answers.Text: Wow, impressive response - thanks
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-11T13:58:43.070Z
Answers.Text: And, related, for the structure 6M2N, there are four 3WL ligands, one in each of the four protein chains.  I'd like to remove 3WL in chains B, C, and D, retain chain A ligand, also scripted (not select and remove).  Thanks!
Answers.UserDisplayName: user8338
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-11T16:01:53.347Z
Answers.Text: The selection algebra is listed in https://pymolwiki.org/index.php/Selection_Algebra
  But basically you want to select based on meeting two criteria so it's an `and`. Namely, `cmd.remove('3WL and not chain A')`
Answers.UserDisplayName: Matteo Ferla
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-11T21:07:58.160Z
Answers.Text: Typo: `cmd.remove('resn 3WL and not chain A')`
Answers.UserDisplayName: Matteo Ferla
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-08T15:24:31.907Z
Answers.LastActivityDate: 2020-07-08T15:35:45.033Z
Answers.LastEditDate: 2020-07-08T15:35:45.033Z
Answers.UserDisplayName: Matteo Ferla
Body: <p>I have the PDB <a href="https://www.rcsb.org/structure/6LU7" rel="nofollow noreferrer">6LU7</a>.</p>
  <ul>
  <li><p>I extracted the ligand using extract lig, org  and then the protein using extract prot, poly.  The ligand has three parts:  02J, PJE, and 010.</p>
  </li>
  <li><p>I want to select the 02J and 010 IN A SCRIPT and delete them.</p>
  </li>
  </ul>
  <p>I know how to do it by simply clicking, but want to incluse this in a script.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-08T15:58:24.670Z
Comments.Text: Hi @user8338 and welcome. I think what you are asking is PyMol scripting, I suspect Modeller will do something similar. Do you use PyMol/Modeller? If so could you please update and clarify your post accordingly. Thanks!
Comments.UserDisplayName: M__
Tags: <covid-19><sars-cov-2><pymol>
Title: Selecting part of an extracted ligand
ThreadText: # Selecting part of an extracted ligand
  
  (Asked by: username_0 on 2020-07-08)
  
  I have the PDB [6LU7](https://www.rcsb.org/structure/6LU7).
  
  * I extracted the ligand using extract lig, org and then the protein using extract prot, poly. The ligand has three parts: 02J, PJE, and 010.
  * I want to select the 02J and 010 IN A SCRIPT and delete them.
  
  I know how to do it by simply clicking, but want to incluse this in a script.
  
  **Tags:** covid-19, sars-cov-2, pymol
  
  > **Comments:**
  > **username_1**: Hi @username_0 and welcome. I think what you are asking is PyMol scripting, I suspect Modeller will do something similar. Do you use PyMol/Modeller? If so could you please update and clarify your post accordingly. Thanks!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-07-08. Score: 1
  
  I know that structure way too well —SARS-COV-2 MPro.
  
  In PyMOL command line
  
  ```
   remove resn 02J or 010
  
  ```
  
  or
  
  ```
   cmd.remove('resn 02J or 010')
  
  ```
  
  In python
  
  ```
   import pymol2
   with pymol2.PyMOL() as pymol:
        pymol.cmd.fetch('6LU7')
        pymol.cmd.remove('resn 02J or 010')
        pymol.cmd.save('6LU7.mod.pdb') 
        #or pdbblock = pymol.cmd.get_pdbstr()
  
  ```
  
  From the sounds of it you'd like to make the peptidomimetic a peptide. If you wanted to do the horrid thing of making PJE, the capped side chain glutamine ketamide, into glutamine, the command to rename atoms is a multitude of `cmd.alter('resn PJE and name <atomname>', 'name="<newname>")` followed by a `cmd.alter('resn PJE', 'resn="GLN"')` and lastly `cmd.sort()` to commit the changes. Not pretty, but is all in PyMOL.
  
  > **Comments:**
  > **username_1**: Wow, impressive response - thanks  
  > **username_0**: And, related, for the structure 6M2N, there are four 3WL ligands, one in each of the four protein chains.  I'd like to remove 3WL in chains B, C, and D, retain chain A ligand, also scripted (not select and remove).  Thanks!  
  > **username_2**: The selection algebra is listed in https://pymolwiki.org/index.php/Selection_Algebra But basically you want to select based on meeting two criteria so it's an `and`. Namely, `cmd.remove('3WL and not chain A')`  
  > **username_2**: Typo: `cmd.remove('resn 3WL and not chain A')`  
  
  ---
  
  