<div dir="ltr"><div>Joao,<br><br></div>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.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><div>Souparno Adhikary,<br></div>CHPC Lab,<br></div>Department of Microbiology,<br></div>University of Calcutta.<br></div></div></div>
<br><div class="gmail_quote">On Tue, May 23, 2017 at 6:54 PM, João Rodrigues <span dir="ltr"><<a href="mailto:j.p.g.l.m.rodrigues@gmail.com" target="_blank">j.p.g.l.m.rodrigues@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Meanwhile, the way to do it is to go over all the atoms again and change their xyz coordinates manually.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2017-05-23 4:01 GMT-07:00 Souparno Adhikary <span dir="ltr"><<a href="mailto:souparnoa91@gmail.com" target="_blank">souparnoa91@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>The page shows a 404 error. Can you please check the link again?<br><br></div>Regards,<br><div class="gmail_extra"><br clear="all"><div><div class="m_-182332765760807118m_-4537656661817331516gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><div>Souparno Adhikary,<br></div>CHPC Lab,<br></div>Department of Microbiology,<br></div>University of Calcutta.<br></div></div></div><div><div class="m_-182332765760807118h5">
<br><div class="gmail_quote">On Tue, May 23, 2017 at 4:01 PM, Patrick Kunzmann <span dir="ltr"><<a href="mailto:padix.kleber@gmail.com" target="_blank">padix.kleber@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>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
<a class="m_-182332765760807118m_-4537656661817331516m_-8833725069458260617moz-txt-link-freetext" href="https://github.com/padix-key/biopython/tree/numpy-structure" target="_blank">https://github.com/padix-key/b<wbr>iopython/tree/numpy-structure</a>.</p>
<p>Best regards,</p>
<p>Patrick Kunzmann<br>
</p><div><div class="m_-182332765760807118m_-4537656661817331516h5">
<br>
<div class="m_-182332765760807118m_-4537656661817331516m_-8833725069458260617moz-cite-prefix">Am 23.05.2017 um 12:04 schrieb Souparno
Adhikary:<br>
</div>
</div></div><blockquote type="cite"><div><div class="m_-182332765760807118m_-4537656661817331516h5">
<div dir="ltr">
<div>
<div>
<div>I want to calculate the average structure from multiple
frames in a pdb file and save it to another pdb file.<br>
<br>
</div>
I wrote the code to calculate the average co-ordinates
successfully like below:<br>
<br>
#!/usr/bin/python<br>
<br>
from Bio.PDB.PDBParser import PDBParser<br>
<br>
import numpy as np<br>
<br>
parser=PDBParser(PERMISSIVE=1)<br>
<br>
structure_id="mode_7"<br>
filename="mode_7.pdb"<br>
structure=parser.get_structure<wbr>(structure_id, filename)<br>
model1=structure[0]<br>
s=(124,3)<br>
newc=np.zeros(s,dtype=np.float<wbr>32)<br>
counter=1<br>
fincoord=[]<br>
for i in range(0,29):<br>
coord=[] <br>
model=structure[i]<br>
for chain in model.get_list():<br>
for residue in chain.get_list():<br>
ca=residue["CA"]<br>
coord.append(ca.get_coord())<br>
<br>
newc=np.add(newc,coord)<br>
counter+=1<br>
<br>
fincoord=np.divide(newc,counte<wbr>r)<br>
<br>
print fincoord<br>
<br>
print "END"<br>
<br>
</div>
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?<br>
<br>
</div>
Thanks<br clear="all">
<div>
<div>
<div>
<div>
<div>
<div class="m_-182332765760807118m_-4537656661817331516m_-8833725069458260617gmail_signature">
<div dir="ltr"><br>
</div>
<div>Souparno Adhikary,<br>
</div>
<div>CHPC Lab,<br>
</div>
<div>University of Calcutta.<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="m_-182332765760807118m_-4537656661817331516m_-8833725069458260617mimeAttachmentHeader"></fieldset>
<br>
</div></div><pre>______________________________<wbr>_________________
Biopython mailing list - <a class="m_-182332765760807118m_-4537656661817331516m_-8833725069458260617moz-txt-link-abbreviated" href="mailto:Biopython@mailman.open-bio.org" target="_blank">Biopython@mailman.open-bio.org</a>
<a class="m_-182332765760807118m_-4537656661817331516m_-8833725069458260617moz-txt-link-freetext" href="http://mailman.open-bio.org/mailman/listinfo/biopython" target="_blank">http://mailman.open-bio.org/ma<wbr>ilman/listinfo/biopython</a></pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div></div></div></div>
<br>______________________________<wbr>_________________<br>
Biopython mailing list - <a href="mailto:Biopython@mailman.open-bio.org" target="_blank">Biopython@mailman.open-bio.org</a><br>
<a href="http://mailman.open-bio.org/mailman/listinfo/biopython" rel="noreferrer" target="_blank">http://mailman.open-bio.org/ma<wbr>ilman/listinfo/biopython</a><br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>