[Biopython] Editing Structure and Replacing Coordinates with new set

Souparno Adhikary souparnoa91 at gmail.com
Wed May 24 08:00:34 UTC 2017


Joao,

I'm quite sure you are not suggesting to change the co-ordinates "manually"
i.e. one by one like in a text file. I'm writing some code to do that.
Also, I am yet to check out Patrick Kunzmann's code. I think Patrick's code
would do a great job.

Souparno Adhikary,
CHPC Lab,
Department of Microbiology,
University of Calcutta.

On Tue, May 23, 2017 at 6:54 PM, João Rodrigues <
j.p.g.l.m.rodrigues at gmail.com> wrote:

> Meanwhile, the way to do it is to go over all the atoms again and change
> their xyz coordinates manually.
>
> 2017-05-23 4:01 GMT-07:00 Souparno Adhikary <souparnoa91 at gmail.com>:
>
>> The page shows a 404 error. Can you please check the link again?
>>
>> Regards,
>>
>> Souparno Adhikary,
>> CHPC Lab,
>> Department of Microbiology,
>> University of Calcutta.
>>
>> On Tue, May 23, 2017 at 4:01 PM, Patrick Kunzmann <padix.kleber at gmail.com
>> > wrote:
>>
>>> I am currently working on a subpackage for Biopython (called
>>> Bio.Structure), that converts a Bio.PDB.Model.Model into a numpy array
>>> containing coordinates and annotations for doing easily efficient
>>> calculations (for example calculating average structure). This array can be
>>> converted back into a Bio.PDB.Model.Model and than saved as PDB file using
>>> PDBIO(). Currently docstrings and code comments are missing, so I will
>>> contribute this code only in a few days, but you can check out the source
>>> code at https://github.com/padix-key/biopython/tree/numpy-structure.
>>>
>>> Best regards,
>>>
>>> Patrick Kunzmann
>>>
>>> Am 23.05.2017 um 12:04 schrieb Souparno Adhikary:
>>>
>>> I want to calculate the average structure from multiple frames in a pdb
>>> file and save it to another pdb file.
>>>
>>> I wrote the code to calculate the average co-ordinates successfully like
>>> below:
>>>
>>> #!/usr/bin/python
>>>
>>> from Bio.PDB.PDBParser import PDBParser
>>>
>>> import numpy as np
>>>
>>> parser=PDBParser(PERMISSIVE=1)
>>>
>>> structure_id="mode_7"
>>> filename="mode_7.pdb"
>>> structure=parser.get_structure(structure_id, filename)
>>> model1=structure[0]
>>> s=(124,3)
>>> newc=np.zeros(s,dtype=np.float32)
>>> counter=1
>>> fincoord=[]
>>> for i in range(0,29):
>>>     coord=[]
>>>     model=structure[i]
>>>     for chain in model.get_list():
>>>         for residue in chain.get_list():
>>>             ca=residue["CA"]
>>>             coord.append(ca.get_coord())
>>>
>>>     newc=np.add(newc,coord)
>>>     counter+=1
>>>
>>> fincoord=np.divide(newc,counter)
>>>
>>> print fincoord
>>>
>>> print "END"
>>>
>>> Now I want to write the coordinates in fincoord to a new pdb file i.e.
>>> everything will be the same like the structure[0] except the coordinates.
>>> Can you tell me how can I edit the coordinates of a specific model or
>>> replace it with my array and save it to another file?
>>>
>>> Thanks
>>>
>>> Souparno Adhikary,
>>> CHPC Lab,
>>> University of Calcutta.
>>>
>>>
>>> _______________________________________________
>>> Biopython mailing list  -  Biopython at mailman.open-bio.orghttp://mailman.open-bio.org/mailman/listinfo/biopython
>>>
>>>
>>>
>>
>> _______________________________________________
>> Biopython mailing list  -  Biopython at mailman.open-bio.org
>> http://mailman.open-bio.org/mailman/listinfo/biopython
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20170524/b48ef103/attachment.html>


More information about the Biopython mailing list