<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
It appears that Residue.number isn't registered in ChimeraX's attribute manager. That looks like a bug (will leave that to the ChimeraX team). You can work around it for now with a little tweak in the console (Tools/General/Shell):</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
from chimerax.atomic import Residue</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
session.attr_registration._class_builtin_types[Residue]['number']=(int,)</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Then your command should work - but I did run into a second bug using it when the ribbon is displayed:
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
color_by_attr
<div> rib_colors[:, 3] = residues.ribbon_colors[:, 3] if opacity is None else opacity</div>
ValueError: could not broadcast input array from shape (852) into shape (6733)
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
(but atoms are properly coloured)<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This can be worked around by repeating the command with a selection encompassing one atom per residue, e.g.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
color byattr r:number sel&@CA target r</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I'll report the issues via the bug tracker.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Tristan<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> ChimeraX-users <chimerax-users-bounces@cgl.ucsf.edu> on behalf of Daniel Larsson <daniel.larsson@icm.uu.se><br>
<b>Sent:</b> 17 November 2020 08:20<br>
<b>To:</b> chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu><br>
<b>Subject:</b> Re: [chimerax-users] sequential coloring of a range of residues</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">I can add that I only have problem with atom specifications with sequential coloring. Using the command "color #18/P:1-10 blue" works as expected and colors the designated range blue.
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Daniel</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 2020-11-17, at 09:03, Daniel Larsson <<a href="mailto:daniel.larsson@icm.uu.se" class="">daniel.larsson@icm.uu.se</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">Hi,
<div class=""><br class="">
</div>
<div class="">I have trouble coloring only a narrow range of residues (1-10) in one chain (P) of one model (#18). I've tried a few options:</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">color sequential #18/P:1-10</div>
<div class=""><br class="">
</div>
<div class="">This colors the entire chain P in rainbow colors (equivalent to atom selection #18/P).</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">color sequential #18:1-10/P</div>
<div class=""><br class="">
</div>
<div class="">This colors _all_ residues of all chains in model #18 -- except of one chain which lacks residues 1-10.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">I also tried with the "rainbow" synonym. When this failed, I tried coloring according to the residue number:</div>
<div class=""> </div>
<div class=""><br class="">
</div>
<div class="">color byattribute r:number #18/P:1-10 </div>
<div class=""><br class="">
</div>
<div class="">This throws an error "Unknown/unregistered Residue attribute number", although number should be an attribute of residues according to this page: <a href="https://www.cgl.ucsf.edu/chimerax/docs/user/attributes.html#residue" class="">https://www.cgl.ucsf.edu/chimerax/docs/user/attributes.html#residue</a></div>
<div class=""><br class="">
</div>
<div class="">Am I doing something wrong? Is this feature not implemented yet? Is there a work-around?</div>
<div class=""><br class="">
</div>
<div class="">Regards,</div>
<div class="">Daniel</div>
<div class=""><br class="">
</div>
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här:
<a href="http://www.uu.se/om-uu/dataskydd-personuppgifter/" class="">http://www.uu.se/om-uu/dataskydd-personuppgifter/</a>
<br class="">
<br class="">
E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here:
<a href="http://www.uu.se/en/about-uu/data-protection-policy" class="">http://www.uu.se/en/about-uu/data-protection-policy</a>
</div>
_______________________________________________<br class="">
ChimeraX-users mailing list<br class="">
<a href="mailto:ChimeraX-users@cgl.ucsf.edu" class="">ChimeraX-users@cgl.ucsf.edu</a><br class="">
Manage subscription:<br class="">
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>