<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Glad something works. :-)<div class=""><br class=""></div><div class="">—Eric<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 3, 2020, at 12:25 PM, Jan Kosinski <<a href="mailto:jan.kosinski@embl.de" class="">jan.kosinski@embl.de</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi Eric,</div><div class=""><br class=""></div><div class="">OK! I have just tested your "All polymer atoms in that chain” suggestion and actually it is sufficiently fast and we can now use all kind of weird characters, allowing us to use around 80 chains in the good old PDB format in the good old Chimera ;-)</div><div class=""><br class=""></div><div class="">Yes, indeed, the segments would work too but for now it would be too many changes to Xlink Analyzer.</div><div class=""><br class=""></div><div class="">Thanks, it got us going!</div><div class="">Jan</div><div class=""><br class=""></div>
<div class=""><br class=""><blockquote type="cite" class=""><div class="">On 3. Feb 2020, at 20:19, Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Jan,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>As far as I know, there is no way to use those special characters as chain IDs — there is no #1:12.’@‘. I don’t know if this helps or not, but Chimera reads columns 73-76 as a “segment ID” and assigns that as an atom attribute (really should probably be a residue attribute). Anyway, if you have values in those columns, the atom spec for segment ID “xyzw” would be: @/pdbSegment=xyzw.</div><div class=""><br class=""></div><div class="">—Eric<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jan 31, 2020, at 3:16 PM, <a href="mailto:jan.kosinski@embl.de" class="">jan.kosinski@embl.de</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="auto" class=""><div class="">Hi Eric,</div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">OK, this way I know if course, I've just thought I'm missing a way that doesn't require iteraitng through the atoms. </div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">For the 'color' command or stom spec, is there a universal way of escaping any special characters as chain ids such as , (comma) , @, =, : etc? Double quote works only for some of them. Yes, we trying to get a PDB file with 80sth chains working in the Xlink Analyzer 😉</div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">Best, </div><div dir="auto" class="">Jan</div><div dir="auto" class=""><div class="gmail_extra" dir="auto"><br class=""><div class="gmail_quote">On Jan 31, 2020 10:16 PM, Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>> wrote:<br type="attribution" class=""><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi Jan!<div class=""><span style="white-space:pre" class=""> </span>Depending on whether you want to color all atoms with a particular chain ID, or atoms in the peptide/nucleic acid chain with that ID but not waters, <i class="">etc.</i><span style="font-style:normal" class=""> there are two routes:</span></div><div class=""><br class=""></div><div class="">In the code below I am going to assume you have your color in a variable named <font face="Courier New" class=""><span style="font-style:normal" class="">color</span></font>, and the model in a variable named <font face="Courier New" class=""><span style="font-style:normal" class="">m</span></font> and that you are coloring chain A.</div><div class=""><br class=""></div><div class=""><b class=""><u class="">All atoms with that chain ID</u></b></div><div class=""><font face="Courier New" class=""><span style="font-style:normal" class="">for a in m.atoms:</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style:normal" class=""><span style="white-space:pre" class=""> </span>if <a href="http://a.residue.id/" class="">a.residue.id</a>.chainId == ‘A’:</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style:normal" class=""><span style="white-space:pre" class=""> </span>a.color = color</span></font></div><div class=""><br class=""></div><div class=""><b class=""><u class="">All polymer atoms in that chain</u></b></div><div class=""><div class=""><font face="Courier New" class=""><span style="font-style:normal" class="">seq = m.sequence(‘A’)</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style:normal" class="">for r in seq.residues:</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style:normal" class=""><span style="white-space:pre" class=""> </span>if r:</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style:normal" class=""><span style="white-space:pre" class=""> </span>for a in r.atoms:</span></font></div><div class=""><font face="Courier New" class=""><span style="font-style:normal" class=""><span style="white-space:pre" class=""> </span>a.color = color</span></font></div><div class=""><br class=""></div><div class="">Chimera just doesn’t have the data structures to do this efficiently that ChimeraX has. If the chain is being depicted as ribbon, you would actually set the residue’s color rather than the atom colors.</div><div class=""><br class=""></div><div class="">—Eric</div><div class="">
<div style="font-family: helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;" class=""><span style="white-space:pre" class=""><br class=""> </span>Eric Pettersen</div><div style="font-family: helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;" class=""><span style="white-space:pre" class=""> </span>UCSF Computer Graphics Lab</div>
</div>
<br class=""><div class=""><blockquote class=""><div class="">On Jan 31, 2020, at 5:54 AM, Jan Kosinski <<a href="mailto:jan.kosinski@embl.de" class="">jan.kosinski@embl.de</a>> wrote:</div><br class=""><div class=""><div class="">Hi,<br class=""><br class="">In the “old” Chimera, is there an efficient way of coloring an entire chain with a single defined color from the Python interface without resorting to runCommand(‘color …') and atom_spec ? The runCommand(‘color …atom_spec ’) makes some issues when special characters are used as chain ids in the atom_spec. I guess I could loop through all atoms of chain but that might be slow for big structures.<br class=""><br class="">Best,<br class="">Jan<br class="">_______________________________________________<br class="">Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class=""><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev</a><br class=""><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></div>_______________________________________________<br class="">Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class=""><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev</a><br class=""></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div>_______________________________________________<br class="">Chimera-dev mailing list<br class=""><a href="mailto:Chimera-dev@cgl.ucsf.edu" class="">Chimera-dev@cgl.ucsf.edu</a><br class="">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev<br class=""></div></blockquote></div><br class=""></div></body></html>