<div dir='auto'><div>Hi Eric,</div><div dir="auto"><br></div><div dir="auto">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"><br></div><div dir="auto">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"><br></div><div dir="auto">Best, </div><div dir="auto">Jan</div><div dir="auto"><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Jan 31, 2020 10:16 PM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Jan!<div><span style="white-space:pre"> </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>etc.</i><span style="font-style:normal"> there are two routes:</span></div><div><br></div><div>In the code below I am going to assume you have your color in a variable named <font face="Courier New"><span style="font-style:normal">color</span></font>, and the model in a variable named <font face="Courier New"><span style="font-style:normal">m</span></font> and that you are coloring chain A.</div><div><br></div><div><b><u>All atoms with that chain ID</u></b></div><div><font face="Courier New"><span style="font-style:normal">for a in m.atoms:</span></font></div><div><font face="Courier New"><span style="font-style:normal"><span style="white-space:pre"> </span>if <a href="http://a.residue.id">a.residue.id</a>.chainId == ‘A’:</span></font></div><div><font face="Courier New"><span style="font-style:normal"><span style="white-space:pre"> </span>a.color = color</span></font></div><div><br></div><div><b><u>All polymer atoms in that chain</u></b></div><div><div><font face="Courier New"><span style="font-style:normal">seq = m.sequence(‘A’)</span></font></div><div><font face="Courier New"><span style="font-style:normal">for r in seq.residues:</span></font></div><div><font face="Courier New"><span style="font-style:normal"><span style="white-space:pre"> </span>if r:</span></font></div><div><font face="Courier New"><span style="font-style:normal"><span style="white-space:pre"> </span>for a in r.atoms:</span></font></div><div><font face="Courier New"><span style="font-style:normal"><span style="white-space:pre"> </span>a.color = color</span></font></div><div><br></div><div>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><br></div><div>—Eric</div><div>
<div style="color:rgb( 0 , 0 , 0 );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"><span style="white-space:pre"><br> </span>Eric Pettersen</div><div style="color:rgb( 0 , 0 , 0 );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"><span style="white-space:pre"> </span>UCSF Computer Graphics Lab</div>
</div>
<br><div><blockquote><div>On Jan 31, 2020, at 5:54 AM, Jan Kosinski <<a href="mailto:jan.kosinski@embl.de">jan.kosinski@embl.de</a>> wrote:</div><br><div><div>Hi,<br><br>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><br>Best,<br>Jan<br>_______________________________________________<br>Chimera-dev mailing list<br><a href="mailto:Chimera-dev@cgl.ucsf.edu">Chimera-dev@cgl.ucsf.edu</a><br>http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev<br><br></div></div></blockquote></div><br></div></div></blockquote></div><br></div></div></div>