<div dir="ltr">Hi João,<div><br><div>Sorry, no publication and not much documentation :-) The latter I can add, for the former (a publication) it always seemed more like bookkeeping than science. On the other hand a publication might have raised awareness of the lua version of this code that's been sitting on Github for 3 years now.</div><div><br></div><div>The approach is as follows:</div><div><br></div><div>- A hedron is a 3-atom unit defined by 2 bond lengths and an angle between. A dihedron is two hedra with one overlapping bond length and a specified dihedral angle.</div><div>- generate lists of all hedra and dihedra making up protein backbone and sidechains (like psi is N-CA-C-N+1. etc.). Plan the lists so they overlap in the right way to extend atom chains for the assembly step. </div><div>- read through the pdb structure and form the hedra and dihedra objects for each residue from the atom coordinates; residue i will include the hedra and dihedra which extend into residue i+1</div><div>- at the beginning of the chain and any chain breaks (determined by peptide C-N bond exceeding a cut-off), store the X, Y, Z coordinates for the N, CA and C atoms to restart the chain. We lose atoms in the case of chain fragments that don't start with N-CA-C. (Storing these is what links the internal coordinates to the coordinate space of the PDB file)</div><div>- at this point we have the internal coordinate set. Re-writing the code to work with Biopython (this is at least my 3rd iteration since grad school) got me to better support hydrogens and altlocs, so the .pic datafile captures Biopython disordered residues/atoms including occupancy, plus B-factors. The B-factors are definitely just tacked on at the end for each residue, but it does make for complete ATOM records when regenerating the PDB data.</div></div><div>- the assembly process uses a deque (double-ended queue) loaded up with initial hedra containing atom coordinates. For all the dihedra that a hedron from the queue starts, work out the coordinates for the 4th atom, and put the 2nd hedron at the back of the queue. This way we work though the correctly formed list above, and is explained in more detail in the doc at the start of PIC_Residue.assemble(). </div><div><br></div><div>The -hard- part is handling (or at least not crashing on) the altlocs, disordered atoms, etc.</div><div><br></div><div>Rob.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 9, 2019 at 5:39 PM João Rodrigues <<a href="mailto:j.p.g.l.m.rodrigues@gmail.com">j.p.g.l.m.rodrigues@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Rob,<div><br></div><div>This is an extremely interesting contribution. Thanks for the time you took to write this. It would be very useful to have a conversion from cartesian to internal coordinates, as far as I know, there isn't a tool that does that (they usually do one way or the other). What is the convention you use for the conversion? How do you handle say, chain breaks or gaps? Is there a publication or small write-up you can provide about this (maybe it's in the documentation and I missed it)?</div><div><br></div><div>Cheers,</div><div><br></div><div>João</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">rob miller <<a href="mailto:rob.miller.gh@gmail.com" target="_blank">rob.miller.gh@gmail.com</a>> escreveu no dia terça, 9/04/2019 à(s) 06:09:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div>This is a request for feedback on code I would like to contribute to Biopython. I want to do more cleaning, testing, polishing and documenting before making a pull request, so don't worry yet :-). This post is to query whether there's sufficient interest to accept the facility into Biopython when I'm ready, hopefully gather some positive feedback and ideas, and to make it publicly available now as it's working for me for most structures.</div><div><br></div><div>This branch ( <a href="https://github.com/rob-miller/biopython/tree/rtm-pic" target="_blank">https://github.com/rob-miller/biopython/tree/rtm-pic</a> ) adds infrastructure for internal coordinates under a .pic attribute on Bio.PDB Chain and Residue objects. 'Internal coordinates' means phi, psi, omega, chi<X> dihedral angles, all bond angles and bond lengths. Internal coordinates can be read from a PDB structure and used to regenerate identical coordinate PDB chains (HETATMs not withstanding, although there is some support).</div><div><br></div><div>While my primary application is to support structure prediction work, there are some useful side effects. Probably most interesting is the ability to generate OpenSCAD files to 3D print protein structure models, as it uses the same algorithm for assembly of bond length, angle and dihedral angle data. (Please be aware that the initial OpenSCAD rendering is reasonably quick, but the detailed rendering to generate an .stl file for printing can take hours depending on your hardware.) Of lesser note, filtering options add support for removing Hydrogens from PDB structures, and obviously one can make Ramachandran plots and database projects looking at different subsets of chi rotamers and other aspects of protein structure. </div><div><br></div><div>I've made a gist at</div><div><a href="https://gist.github.com/rob-miller/0be208b73fe2ab36fadeeef60831fc92" target="_blank">https://gist.github.com/rob-miller/0be208b73fe2ab36fadeeef60831fc92</a></div><div>to access the basic functionality. Hopefully this is easy to get working in your hands, if you have a local pdb mirror there is a place to configure access to it near the beginning of the script.</div><div><br></div><div>If you are playing with OpenSCAD and your protein has chain breaks (or you excised lysozyme from a GPCR), increase the -maxp cutoff in the gist options to treat the gap as an extra long peptide bond.</div><div><br></div><div>All development so far has been exclusively on python3, so yes more versions to support. I am aware of the related projects FragBuilder and PeptideBuilder.</div><div><br></div><div>I hope you like it; please be gentle with me.</div><div><br></div><div>Rob.</div><div><br></div></div></div>
_______________________________________________<br>
Biopython mailing list - <a href="mailto:Biopython@mailman.open-bio.org" target="_blank">Biopython@mailman.open-bio.org</a><br>
<a href="https://mailman.open-bio.org/mailman/listinfo/biopython" rel="noreferrer" target="_blank">https://mailman.open-bio.org/mailman/listinfo/biopython</a></blockquote></div>
</blockquote></div>