<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"CMU Serif Roman";
panose-1:2 0 6 3 0 0 0 0 0 0;}
@font-face
{font-family:"CMU Sans Serif Medium";
panose-1:2 0 6 3 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi Tom,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Perfect – thanks for clearing up the confusion!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I’m looking forward to moving over to scripting for ChimeraX (not least because I work on large structures), but it hasn’t quite got the featureset I need just yet…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Many thanks for the help,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Joe<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Serif Roman";color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:white"><u><span style="font-size:10.0pt;font-family:"CMU Serif Roman";color:black">
<o:p></o:p></span></u></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:#941100">Dr. Joseph Healey Ph.D. M.Sc. B.Sc. (Hons) MRSB</span><span style="font-size:12.0pt;font-family:"CMU Sans Serif Medium";color:#941100"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">Research Fellow<o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">Warwick Medical School</span><span style="font-size:12.0pt;font-family:"CMU Sans Serif Medium";color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">University of Warwick</span><span style="font-size:12.0pt;font-family:"CMU Sans Serif Medium";color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">Coventry</span><span style="font-size:12.0pt;font-family:"CMU Sans Serif Medium";color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">CV47AL<br>
Mob: +44 (0) 7536 042620 | Twitter: <a href="https://twitter.com/JRJHealey"><span style="color:#0563C1">@JRJHealey</span></a> | </span><span style="font-size:12.0pt;font-family:"CMU Sans Serif Medium";color:black"><a href="http://www2.warwick.ac.uk/fac/sci/moac/people/students/2013/joseph_healey"><span style="font-size:10.0pt;color:#0563C1">Website</span></a><o:p></o:p></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">Email:
<a href="mailto:J.Healey.1@warwick.ac.uk"><span style="color:#0563C1">J.Healey.1@warwick.ac.uk</span></a> | ORCID: orcid.org/0000-0002-9569-6738</span><span style="font-size:12.0pt;font-family:"CMU Sans Serif Medium";color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Tom Goddard <goddard@sonic.net><br>
<b>Date: </b>Friday, 14 February 2020 at 18:34<br>
<b>To: </b>"Healey, Joseph" <J.Healey.1@warwick.ac.uk><br>
<b>Cc: </b>"chimera-users@cgl.ucsf.edu" <chimera-users@cgl.ucsf.edu><br>
<b>Subject: </b>Re: [Chimera-users] SplitCommand python<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Here is a bit a Python code to count the number of chains in a molecule m.
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">>>> import chimera<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">>>> m = chimera.openModels.list()[0]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">>>> m<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><_molecule.Molecule object at 0x7fb988fed620><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">>>> len(set(r.id.chainId for r in m.residues))<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">4<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">We have been working on ChimeraX the replacement for Chimera for a few years and it is quite a bit nicer. In ChimeraX the code would be<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">m = session.models.list()[0]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">m.num_chains<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> Tom<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Feb 14, 2020, at 2:09 AM, Healey, Joseph <<a href="mailto:J.Healey.1@warwick.ac.uk">J.Healey.1@warwick.ac.uk</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Chimera Team,<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">I’m trying to reduce some overheads in one of my scripts part of which is coming from my use of `runCommand`. At the moment, I’m only using it for `split`, but I’d like to first test whether a model is already split to avoid unnecessary
invocation.<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">I’m aware the python equivalent of the command is buried inside chimera.SplitMolecule and the command split_command, however it doesn’t seem to be importable, as when I try:<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">>>> from chimera import SplitMolecule<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">Traceback (most recent call last):<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> File "<pyshell#25>", line 2, in <module><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">ImportError: cannot import name SplitMolecule<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">I’m getting the above ImportError. I can import other members of the chimera class (e.g. chimera.openModels or chimera.Molecule and chimera itself without issue). I’ve seen in the source code that SplitMolecule gets imported elsewhere,
and it has the __init__ file, so I assume I’m just doing something stupid with paths or similar. That said, SplitMolecule is clearly within the main chimera modules directory, so I would have expected it to only be one ‘layer’ below `chimera` itself. Can you
elighten me?<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">I’m currently on chimera production version 1.14 (build 42094) 2019-11-13 06:05:13 UTC if that helps.<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">If you could point me in the right direction to understand how the code will check for multiple chains and decide to split by chain, that would also be a massive help.<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">Many thanks,<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"> <span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">Joe<span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Serif Roman";color:black"> </span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><u><span style="font-size:10.0pt;font-family:"CMU Serif Roman";color:black"> </span></u><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:#941100">Dr. Joseph Healey Ph.D. M.Sc. B.Sc. (Hons) MRSB</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">Research Fellow</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">Warwick Medical School</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">University of Warwick</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">Coventry</span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">CV47AL<br>
Mob: +44 (0) 7536 042620 | Twitter: <a href="https://twitter.com/JRJHealey"><span style="color:#0563C1">@JRJHealey</span></a> | </span><span style="font-size:12.0pt;font-family:"CMU Sans Serif Medium";color:black"><a href="http://www2.warwick.ac.uk/fac/sci/moac/people/students/2013/joseph_healey"><span style="font-size:10.0pt;color:#0563C1">Website</span></a></span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"CMU Sans Serif Medium";color:black">Email:<span class="apple-converted-space"> </span><a href="mailto:J.Healey.1@warwick.ac.uk"><span style="color:#0563C1">J.Healey.1@warwick.ac.uk</span></a><span class="apple-converted-space"> </span>|
ORCID: <a href="http://orcid.org/0000-0002-9569-6738">orcid.org/0000-0002-9569-6738</a></span><span style="font-size:12.0pt"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt"> <o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Helvetica">_______________________________________________<br>
Chimera-users mailing list:<span class="apple-converted-space"> </span></span><a href="mailto:Chimera-users@cgl.ucsf.edu"><span style="font-size:9.0pt;font-family:Helvetica">Chimera-users@cgl.ucsf.edu</span></a><span style="font-size:9.0pt;font-family:Helvetica"><br>
Manage subscription:<span class="apple-converted-space"> </span></span><a href="http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users"><span style="font-size:9.0pt;font-family:Helvetica">http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users</span></a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>