4 ms·
I’m not sure how is he orienting the camera in his library (https://github.com/fogleman/ribbon https://github.com/fogleman/ribbon), but the usual approach is to
by flobosg 2y ago
I’m not sure how is he orienting the camera in his library (https://github.com/fogleman/ribbon https://github.com/fogleman/ribbon), but the usual approach is to maximize what is shown on the X and Y axes by e.g. aligning principal components (as PyMOL does).
- gilleain 2y agoLooking at this function: https://github.com/fogleman/ribbon/blob/master/ribbon/camera.go#L26 https://github.com/fogleman/ribbon/blob/master/ribbon/camera... it's getting the carbonyls (C and O atoms) and then trying to pick a view vector based on maximising some scores ... of some kind. Like the aspect ratio and number of visible points? Not sure.
- flobosg 2y agoHe’s using the alpha carbons (CA) adjacent to the carbonyl groups as well as the carbonyl oxygens (O), approximating the peptide plane. In addition he incorporates heteroatoms, so the scoring function takes ligands into account, if present.
- fogleman 2y agoDefinitely didn't expect people on Hacker News to scrutinize this code when I wrote it 7 years ago, hah! Curious to hear how a "protein structure expert" would prefer to pose the proteins? I did sell some of these drawings. Two customers stand out in my memory. One wanted drawings as a gift to his father who had spent most of his career working with some specific protein. The other was someone who had a genetic defect in the family and wanted a drawing of the protein responsible for it.
- gilleain 2y agoOk, I don't mean at all to suggest that there is only one 'right' pose or representation. Different orientations and levels of detail would emphasise different things. For example, it's quite nice that the haemoglobin one is down the central axis of the tetramer, and shows all the haem groups. I would expect almost any image that wanted to show the most parts of that structure to use a similar pose. I had not realised when I asked the question that the poses were picked in code, which is similar to how PDBsum does it (pretty sure Roman Laskowski told me it did, but I would have to check). Something like maximising the number of atoms in the plane of the screen. Of course, when it comes to YFP (your favourite protein), individual researchers are likely going to focus on different parts. My interest was always in the topology, so I would want to see all the helices and sheets, but someone else might want to see the active site front and center. Incidentally, I've heard the term 'molecular porn' used for fancy/shiny looking diagrams - not sure if it applies to these as well :)