Writing a pdb file from an xray_structure object
Hi everyone, i have been using the xray_structure_simple() method to get an xray.structure object from a pdb object and use it to perform some calculations on it, one of them being expand it to P1. After, i tried to write a new pdb out of this xray_structure in P1. For that purpose, i used the following method: cctbx.xray.structure.as_pdb_file(self, remark=None, remarks=[], fractional_coordinates=False, resname=None, connect=None) but using it both with the original xray structure and with the one on P1 I get very bad lookings pdbs, with incorrect formating, like that for the case of the one in P1: ATOM 1 PDB= PDB 1 12.330 -6.948 -40.820 1.00 19.26 N ATOM 2 PDB= PDB 2 49.988 55.370 3.948 1.00 19.26 N ATOM 3 PDB= PDB 3 36.092 30.710 93.483 1.00 19.26 N ATOM 4 PDB= PDB 4 55.370 49.988 175.123 1.00 19.26 N ATOM 5 PDB= PDB 5 30.710 36.092 85.587 1.00 19.26 N so i guessed that something must be wrong with the residues.... and went to check the code. That as_pdb_file method calls to iotbx.pdb.xray_structure.as_pdb_file(), and on that code i realised that as i was calling it whithout any resname, it was retrieving it from some information on the scatterers that could be wrong. Putting the value of resname to ALA, as a trial, produced almost the same output except for the name: ATOM 1 PDB= ALA 1 12.330 -6.948 -40.820 1.00 19.26 N ATOM 2 PDB= ALA 2 49.988 55.370 3.948 1.00 19.26 N ATOM 3 PDB= ALA 3 36.092 30.710 93.483 1.00 19.26 N ATOM 4 PDB= ALA 4 55.370 49.988 175.123 1.00 19.26 N ATOM 5 PDB= ALA 5 30.710 36.092 85.587 1.00 19.26 N Up to this point, i don't get what is wrong. It may be that i'm using a too simple method and without the correct parameters (xray_structure_simple()), as i guess part of the error is that the assignation of the types of atoms and residues is going crazy. There are other ways of performing this step from a pdb to an xray_structure and viceversa? Thanks in advance! Best regards, Claudia Millán ([email protected]) Institut de Biologia Molecular de Barcelona (IBMB-CSIC) Barcelona, Spain
Hi Claudia,
i have been using the xray_structure_simple() method to get an xray.structure object from a pdb object and use it to perform some calculations on it, one of them being expand it to P1. After, i tried to write a new pdb out of this xray_structure in P1. For that purpose, i used the following method:
cctbx.xray.structure.as_pdb_file(self, remark=None, remarks=[], fractional_coordinates=False, resname=None, connect=None)
but using it both with the original xray structure and with the one on P1 I get very bad lookings pdbs, with incorrect formating, like that for the case of the one in P1:
ATOM 1 PDB= PDB 1 12.330 -6.948 -40.820 1.00 19.26 N ATOM 2 PDB= PDB 2 49.988 55.370 3.948 1.00 19.26 N ATOM 3 PDB= PDB 3 36.092 30.710 93.483 1.00 19.26 N ATOM 4 PDB= PDB 4 55.370 49.988 175.123 1.00 19.26 N ATOM 5 PDB= PDB 5 30.710 36.092 85.587 1.00 19.26 N
xray_structure object does not have information about atom/residue/chain/etc labels. Conceptually, it is supposed to contain minimally necessary amount amount of data in order to calculate Fcalc. It gets stripped off the moment you go from pdb input object to xray_structure_simple(). To write a meaningful PDB file you need to use PDB hierarchy machinery. For details, see "cctbx PDB handling tools" article here: http://phenix-online.org/newsletter/CCN_2010_07.pdf There are numerous examples scattered across cctbx code of going back and forth between xray_structure object and pdb files. Pavel
Thank you Pavel :) Therefore i will apply the neccesary transformations
directly on the pdb, and after, i will create the xray structure and work
with it for the next steps. Thanks again!
Claudia Millán ([email protected])
Institut de Biologia Molecular de Barcelona (IBMB-CSIC)
Barcelona, Spain
2012/12/12 Pavel Afonine
Hi Claudia,
i have been using the xray_structure_simple() method to get an
xray.structure object from a pdb object and use it to perform some calculations on it, one of them being expand it to P1. After, i tried to write a new pdb out of this xray_structure in P1. For that purpose, i used the following method:
cctbx.xray.structure.as_pdb_**file(self, remark=None, remarks=[], fractional_coordinates=False, resname=None, connect=None)
but using it both with the original xray structure and with the one on P1 I get very bad lookings pdbs, with incorrect formating, like that for the case of the one in P1:
ATOM 1 PDB= PDB 1 12.330 -6.948 -40.820 1.00 19.26 N ATOM 2 PDB= PDB 2 49.988 55.370 3.948 1.00 19.26 N ATOM 3 PDB= PDB 3 36.092 30.710 93.483 1.00 19.26 N ATOM 4 PDB= PDB 4 55.370 49.988 175.123 1.00 19.26 N ATOM 5 PDB= PDB 5 30.710 36.092 85.587 1.00 19.26 N
xray_structure object does not have information about atom/residue/chain/etc labels. Conceptually, it is supposed to contain minimally necessary amount amount of data in order to calculate Fcalc. It gets stripped off the moment you go from pdb input object to xray_structure_simple().
To write a meaningful PDB file you need to use PDB hierarchy machinery. For details, see "cctbx PDB handling tools" article here: http://phenix-online.org/**newsletter/CCN_2010_07.pdfhttp://phenix-online.org/newsletter/CCN_2010_07.pdf
There are numerous examples scattered across cctbx code of going back and forth between xray_structure object and pdb files.
Pavel
______________________________**_________________ cctbxbb mailing list [email protected] http://phenix-online.org/**mailman/listinfo/cctbxbbhttp://phenix-online.org/mailman/listinfo/cctbxbb
participants (2)
-
Claudia Millán Nebot
-
Pavel Afonine