Message Boards Message Boards

6 Replies
8 Total Likes
View groups...
Share this post:

Extracting solvent O atoms from PDB files

Posted 11 years ago
Is there a way to extract from PDB files, the solvent-oxygen atom coordinates?

The only thing I've come up with so far is to take the coordinates in "VertexCoordinates" that are not in "ResidueCoordinates". Is there something more direct?
POSTED BY: Veit Elser
6 Replies
Hello Veit, Although I have not seen such an application in Mathematica, if you need to solve this problem under time contraints sooner than allow for finding an equivalent solution in Mathematica I suggest FORTRAN with some adaptations to some codes I have.  Additionally there are utilities in the GROMACS toolkit such as trjconv --
POSTED BY: Guy Mongelli
Dear Veit, note, you are pointing to the data on your local drive - inaccessible to other people - meaning they cannot run your code. You should always try to point to online resources - assuming you know where they are. In your case this proteine can be found in PDB database. But even better - you can just attach .PDB file to your post.

"PDB", "Rendering" -> #, ImageSize -> 400] & /@ {Automatic, "BallAndStick", "Wireframe", "Spacefilling"}

POSTED BY: Vitaliy Kaurov
Posted 11 years ago
Thanks Guy, but I prefer Mathematica to FORTRAN and GROMACS. The solution in my second post works fine, even if it is a hack. I encourage the Mathematica developers to add this functionality via a "SolventAtom" option.

Vitaliy: I was well aware that my code would not work without the PDB file. However, my question was not about aquiring PDB files, but the available options for Import when reading these files. 
POSTED BY: Veit Elser
Dear Veit, I was just pointing out that if you provide code that uses custom data - it is impossible to run that code without those data. Some people prefer to actually play with code a bit before giving an answer.
POSTED BY: Vitaliy Kaurov
Posted 11 years ago
Here's what I've been doing:
 pdb = "1W41";
 vertex = Transpose[{Import[directory <> pdb <> ".pdb",
     Import[directory <> pdb <> ".pdb",  "VertexCoordinates"]}];
 residue =
      Import[directory <> pdb <> ".pdb",  "ResidueAtoms"], 2],
    Flatten[Import[directory <> pdb <> ".pdb",  "ResidueCoordinates"],

solvent =
  Map[#[[2]] &,
   Select[Complement[vertex, residue], #[[1]] == "O" &]];
I get 94 solvent oxygens for this protein (1W41). Your example, 1PPT, doesn't have solvent atoms in the structure, only one Zn ion.
POSTED BY: Veit Elser
Dear Veit,
I know nothing about pdb, but perhaps this hack may be a useful direction for you?  Here  a GraphicsComplex is deconstructed to extract information.
 example =
  Import["ExampleData/1PPT.pdb", "Rendering" -> "Spacefilling"]
 centers = Cases[example, GraphicsComplex[a_, __] :> a, Infinity][[1]]
 spheres =  Cases[example, GraphicsComplex[a_, b_] :> b, Infinity][[1]]
 types = Partition[SplitBy[spheres, (Head[#] == RGBColor) &], 2]
typeColors = Flatten[First /@ types]

typeCoordinates =
Cases[#, Sphere[coord_, _] :>  centers[[coord]], Infinity] & /@ types


  Sphere[#, 150] & /@ typeCoordinates[[2]]}]

  Sphere[#, 150] & /@ typeCoordinates[[3]]}]

POSTED BY: W. Craig Carter
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract