<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Thanks very much for your help Tom, really appreciated.</p>
<p><br>
</p>
<p>Dan</p>
<p><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p></p>
<div>Prof Daniel Rigden <span style="font-size:9pt">(He/Him)</span></div>
<div>Department of Biochemistry and Systems Biology </div>
<div>Institute of Systems, Molecular and Integrative Biology</div>
<div>Room 101, Biosciences Building</div>
<div>University of Liverpool </div>
<div>Crown St., Liverpool, L69 7ZB</div>
<div><br>
</div>
<div>(+44) 151 795 4467</div>
<div>www.liverpool.ac.uk/integrative-biology/staff/daniel-rigden/</div>
<br>
<p></p>
</div>
</div>
</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> Tom Goddard <goddard@sonic.net><br>
<b>Sent:</b> 17 November 2021 08:03:00<br>
<b>To:</b> Elliott, Luc<br>
<b>Cc:</b> chimera-dev@cgl.ucsf.edu; Rigden, Dan<br>
<b>Subject:</b> Re: [chimera-dev] Chimera assistance</font>
<div> </div>
</div>
<div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">Hi Luc,
<div class=""><br class="">
</div>
<div class=""> The Chimera Segger tool does not have an equivalent command for its menu entry File / Save Each Region to .mrc File. So it would require some Python code to do that without using the GUI. </div>
<div class=""><br class="">
</div>
<div class=""> I can show you how to do that in ChimeraX. All our development effort has been on ChimeraX and not the old Chimera program for several years now. Maybe you could adapt my example code to work in Chimera if you are familiar with the Python
language.</div>
<div class=""><br class="">
</div>
<div class=""> I looked in my ChimeraX distribution in (on Mac) for the Segger code for that menu entry which I found in</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>ChimeraX.app/Contents/lib/python3.9/site-packages/chimerax/segger/segment_dialog.py</div>
<div class=""><br class="">
</div>
<div class="">and just copied some of that code to the attached Python mrcregion.py which looks like this</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""># From Segment Map menu entry "Save each region to .mrc file..."</div>
<div class=""># which calls VolumeSegmentationDialog.WriteEachReginMRCFile() in Segger/segment_dialog.py</div>
<div class="">#</div>
<div class="">from chimerax.segger.segment_dialog import volume_segmentation_dialog</div>
<div class="">vsd = volume_segmentation_dialog(session)</div>
<div class="">smod = vsd.CurrentSegmentation()</div>
<div class="">dmap = vsd.SegmentationMap()</div>
<div class="">path = '/Users/goddard/Desktop/test/test_region_%d.mrc'</div>
<div class="">for region in smod.regions:</div>
<div class=""> vsd.SaveRegsToMRC([region], dmap, path % region.rid)</div>
</div>
<div class=""><br class="">
</div>
<div class="">After opening or creating your segmentation you can just open my attached Python script in ChimeraX to write the MRC files. The path is coded in the file so you would need to change it to where you want the MRC files to be written. This could
be improved to register a ChimeraX command where you could specify the path to write the files.</div>
<div class=""><br class="">
</div>
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>Tom</div>
<div class=""><br class="">
</div>
<div class=""></div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Nov 16, 2021, at 6:46 AM, Elliott, Luc via Chimera-dev <<a href="mailto:chimera-dev@cgl.ucsf.edu" class="">chimera-dev@cgl.ucsf.edu</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div id="x_divtagdefaultwrapper" dir="ltr" class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-size:12pt; font-family:Calibri,Helvetica,sans-serif">
<div class="" style="margin-top:0px; margin-bottom:0px">Hello,</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">I'm a first year PhD student with the University of Liverpool and I have a query regarding chimera.<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">I'm trying to write some code which selects all the regions of a segmented map (.seg) and saves each region to its own .mrc file, similarly to how it works in the program but without needing to interact
with the GUI. Would there be a way to make this happen?</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Thank you for your time.</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Kind regards,</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Luc Elliott<br class="">
</div>
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Chimera-dev
mailing list</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="mailto:Chimera-dev@cgl.ucsf.edu" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">Chimera-dev@cgl.ucsf.edu</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://plato.cgl.ucsf.edu/mailman/listinfo/chimera-dev</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>