2
$\begingroup$

I would like to delete everything from a PDB file except a specific ligand that I know the PDB code for. Is there a simple way to using free Linux-compatible software? If you want a specific example for your answer 1YAT and its ligand FK5 (tacrolimus) is an example I'm presently working on. I think PyMOL might have this capability using the delete command but running:

delete /1YAT/A

which should delete the macromolecule (chain A) at least but I saw no visually-obvious change. I have viewed the PyMOL Wiki article on the delete command but it was not helpful as what name meant was not obvious to me.

By free software I mean free of charge not free as in freedom. One piece of software that I used to do this with on Windows was Accelrys (or BIOVIA) Discovery Studio Visualizer, tried to run it on Arch Linux, however, as it has a Linux binary, but it failed to run. This is presumably because it is for Red Hat Enterprise Linux/SUSE Linux Enterprise which has too old of system libraries for Arch Linux compatibility.

$\endgroup$
  • 2
    $\begingroup$ The PDB is human readable, so the quickest way is just to use a text editor and delete all the bits you don't want; its messy but if you have only to do it once then probably ok. Alternatively if you have many files use python (with, say, Atom(apple mac) or notepad++(PC) code editors) to read line by line and print same for only the header parts (those not starting with word 'ATOM' ) and then print the 'HETATM' parts you want. Python, Atom and Notepad++ are all free and there is lots of online help to use python. $\endgroup$ – porphyrin Jul 25 '17 at 10:40
  • 1
    $\begingroup$ Sed and/or vim. $\endgroup$ – Todd Minehardt Jul 25 '17 at 20:59
  • $\begingroup$ I'm having trouble envisioning why you want to get the conformation of the ligand using this method. There is a plethora of open-source, linux-compatible chemoinformatic software to do this. Here's an example using rdkit: nbviewer.jupyter.org/github/tentrillion/ipython_notebooks/blob/… . (Note that you should be able to pan/zoom with the mouse on "Out[6]" to look at the conformation in detail). There are similar capabilities, I'm sure, in cdk and other software. $\endgroup$ – Curt F. Jul 25 '17 at 23:46
  • 1
    $\begingroup$ I usually use Avogadro, Jmol, Mercury and PyMOL only and I was unaware of ways to remove everything but the ligand with any of these pieces of software. Guessing that was what you were asking since your rdkit example was along the line of suggesting another method of doing this. If you're asking why this method of determining the 3D structure as opposed to optimization and other methods well I want to draw structures for Wikipedia (e.g. here is one of mine commons.wikimedia.org/wiki/File:Tianeptine-xtal-2012.png) and crystal structures are preferred there. $\endgroup$ – BH2017 Jul 26 '17 at 0:12
6
$\begingroup$

You can do this with Avogadro

First, open the PDB file. Then choose Select > Select by Residue

enter image description here

Now pick Select > Invert Selection followed by Edit > Clear

Done. (Well, save the new file... :-)

$\endgroup$
  • 1
    $\begingroup$ I'll note that there must be some way to do this with PyMol, but it's pretty easy to do in Avogadro. $\endgroup$ – Geoff Hutchison Jul 25 '17 at 18:56
  • $\begingroup$ Is it possible to do this with Avogadro2? I don't see a "Select by Residue" option in is Select menu, only All, None and Invert Selection. $\endgroup$ – BH2017 May 19 '18 at 19:26
  • 1
    $\begingroup$ @BH2017 - Avogadro2 at the moment is in beta and has no residue/biomolecule support yet. $\endgroup$ – Geoff Hutchison May 19 '18 at 20:06
6
$\begingroup$

What about a straightforward

grep -w " AAA " file.pdb > ligand.pdb

? Where you substitute AAA with the name of the residue you want.

$\endgroup$
  • $\begingroup$ While you don't get visual confirmation of the ligand match, I think this is a nice hack. :-) $\endgroup$ – Geoff Hutchison Jul 26 '17 at 14:05
  • 1
    $\begingroup$ Well, usually before redirecting the output to a file you try few things. grep -w is not immediate, one learns it step by step. First you grep only and then you refine the command, maybe even piping to sed or head or whatever. Or you redirect using tee. Or maybe I misunderstood and you meant "visual" as in "actually visualizing the structure"...but I don't think it's really necessary! $\endgroup$ – Anon Jul 26 '17 at 16:15
  • 1
    $\begingroup$ I meant "actually visualizing the structure" but agree that all the points you mention are important in building up such hacks. $\endgroup$ – Geoff Hutchison Jul 26 '17 at 20:59
2
$\begingroup$

In Pymol:

  1. create a new object for your residue:

create myobj, r. fk5

  1. delete the original object with the entire protein:

delete 1yat

$\endgroup$
1
$\begingroup$

I have written some simple code in python to do what you ask. ( It has to be inserted as an image because of the way markdown changes the text.) (Note that python uses 4 spaces or a tab for each part of the code at the same level in any loop of if statement)

read pdb

$\endgroup$
  • 1
    $\begingroup$ For me this script returns the error (and yes 1yat.pdb does exist in the folder where I am running the script) shown here gist.github.com/fusion809/11278bea129cee1adfa495e0767c8439. The script is also shown at that gist. $\endgroup$ – BH2017 Jul 25 '17 at 16:49
  • 1
    $\begingroup$ Does indenting the whole thing by four spaces, to enable code formatting, not make it render correctly? $\endgroup$ – hBy2Py Jul 25 '17 at 16:59
  • $\begingroup$ I used tabs but I did use it for each separate level. So, for example, for the if vals[0] line I used two tabs as it is level 2. While for line in f: is level 1 so one tab. $\endgroup$ – BH2017 Jul 25 '17 at 17:02
  • $\begingroup$ Oh, sorry, @BH2017, I wasn't referring to the error you observed; I was asking porphyrin about his troubles getting the code to render correctly in his post here. $\endgroup$ – hBy2Py Jul 25 '17 at 17:09
  • $\begingroup$ @BH2017 It looks like you're running this as a shells script instead of a python script. To fix this, add the following line as the first line of the script: #!/usr/bin/python3 $\endgroup$ – chipbuster Jul 25 '17 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.