<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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); background-color: rgb(255, 255, 255);" class="elementToProof">
Thanks Eric,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
I will try first with the <span class="ContentPasted0">computeRealignment() method. Both alignments algorithms seem to work so I'll try Crustal-Omega first. Most likely will have more questions coming.
<br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span class="ContentPasted0"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span class="ContentPasted0">Eventually we'll try chimera-X which indeed seems like an easier route. However, the problem is that this script is part of a library of scripts and functions that we have built over the years for Chimera (in python 2.7). Translating
all to python 3.0 and the different environment of ChimeraX may be more difficult and time consuming at this time.
<br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span class="ContentPasted0"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span class="ContentPasted0">Thanks again,</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span class="ContentPasted0"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span class="ContentPasted0">Hernando<br>
</span></div>
<div id="signature_bookmark"></div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Eric Pettersen <pett@cgl.ucsf.edu><br>
<b>Sent:</b> Monday, November 14, 2022 3:04 PM<br>
<b>To:</b> Hernando J Sosa <hernando.sosa@einsteinmed.edu><br>
<b>Cc:</b> Chimera <chimera-users@cgl.ucsf.edu><br>
<b>Subject:</b> Re: [Chimera-users] Realign sequences</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<table style="background-color:#fe0000; border-collapse:collapse; border:4px solid #CBCBCB; color:#ffcc67; width:100%; text-align:center" cellspacing="3" cellpadding="3" border="4">
<tbody>
<tr>
<td><i>CAUTION: This email comes from an external source; the attachments and/or links may compromise our secure environment. Do not open or click on suspicious emails. Please click on the “Phish Alert” button on the top right of the Outlook dashboard to report
any suspicious emails.</i></td>
</tr>
</tbody>
</table>
<div>Hi Hernando,
<div class=""><span class="x_Apple-tab-span" style="white-space:pre"></span>So the first thing I want to say is that this is about a thousand times easier in ChimeraX, because the <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Fchimerax%2Fdocs%2Fuser%2Fcommands%2Fsequence.html%23align&data=05%7C01%7Chernando.sosa%40einsteinmed.edu%7C51e6f1e00b82448da82a08dac67b680e%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638040530608108295%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ls90S%2FQVnv814c0rJWqyDSnbQP6REGxMJZ6ZoTvVYEY%3D&reserved=0" data-auth="Verified" originalsrc="https://www.rbvi.ucsf.edu/chimerax/docs/user/commands/sequence.html#align" shash="elN1rsmuoN6upAcB4Wi774yvtPiPs4RTjPg4oW9IpdF/1Ak6DTzU5KXnimC/QgXuRCd/azBBfDmrA8pE3TiG5wjY8jn7hhxvSB6nT/Dv3tPpCh8ucE6E4YrdQmHuoRSyR968F2/XPOH/gjDk1JfrjKdM7aifuC564OOcidAU/GA=" class="">"seq
align" command</a> in ChimeraX does this directly.</div>
<div class="">
<div><span class="x_Apple-tab-span" style="white-space:pre"></span>At any rate, you would use the computeRealignment() method rather than the realign() method (the latter is for when you already have the realigned sequence in hand). Getting the right argument
values will be somewhat challenging. Depending on what realignment method you want to use, you will need to look at either Muscle.py or ClustalOmega.py in the MultAlignViewer folder to find the appropriate values. In particular, look at the return value
of the get() method in those files. It returns a (service name, in/out flag strings, option strings) tuple. Those correspond directly to the
<i class="">serviceName</i><span class="" style="font-style:normal">, </span><i class="">inOutFlags</i><span class="" style="font-style:normal">, and
</span><i class="">options</i><span class="" style="font-style:normal"> arguments of the computeRealignment() method. You will need to look at the lines above the return statement to find the strings that compose the
</span><i class="">options</i> value. Lastly, if you are use Muscle realignment you will have to specify "reordersSequence=True" to the computeRealignment() call.</div>
<div><span class="x_Apple-tab-span" style="white-space:pre"></span>Good luck! :-)</div>
<div><br class="">
</div>
<div>
<div>--Eric</div>
<div><br class="">
</div>
<div><span class="x_Apple-tab-span" style="white-space:pre"></span>Eric Pettersen</div>
<div><span class="x_Apple-tab-span" style="white-space:pre"></span>UCSF Computer Graphics Lab</div>
<div><br class="">
</div>
<blockquote type="cite" class="">
<div class="">On Nov 12, 2022, at 4:01 PM, Hernando J Sosa via Chimera-users <<a href="mailto:chimera-users@cgl.ucsf.edu" data-auth="NotApplicable" class="">chimera-users@cgl.ucsf.edu</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="x_elementToProof" style="font-style:normal; font-variant-caps: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-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
<br class="x_Apple-interchange-newline">
Is there a way to realign sequences already in a multialign window within a python script? <span class="x_Apple-converted-space"> </span><br class="">
</div>
<div class="x_elementToProof" style="font-style:normal; font-variant-caps: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-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
I want to do this because the first alignment dome using matchmaker in many cases contains mismatches to the aligned structures. Using the realign option in the menu fixes the problem but I want to do this within a script. <br class="">
</div>
<div class="x_elementToProof" style="font-style:normal; font-variant-caps: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-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
<br class="">
</div>
<div class="x_elementToProof" style="font-style:normal; font-variant-caps: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-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
I have code that creates the alignment window and then retrieves the instance:</div>
<div class="x_ContentPasted3 x_elementToProof x_ContentPasted0" style="font-style:normal; font-variant-caps: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-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
<br class="">
</div>
<div class="x_ContentPasted3 x_elementToProof x_ContentPasted0" style="font-style:normal; font-variant-caps: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-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
from chimera.extension import manager
<div class="x_ContentPasted3">from MultAlignViewer.MAViewer import MAViewer</div>
<div class="x_ContentPasted3"><br class="">
</div>
<div class="x_ContentPasted4 x_ContentPasted3">runCommand('mm #0 #1 show true')<br class="">
</div>
<div class="x_ContentPasted3">mavs = [inst for inst in manager.instances if isinstance(inst, MAViewer)]</div>
<div class="x_ContentPasted5 x_ContentPasted3">mymav = mavs[-1]</div>
<div class="x_ContentPasted5 x_ContentPasted3"><br class="">
</div>
<div class="x_ContentPasted5 x_ContentPasted3">I tried then to do something like</div>
<div class="x_ContentPasted5 x_ContentPasted3">mymav.realign()</div>
<div class="x_ContentPasted5 x_ContentPasted3"><br class="">
</div>
<div class="x_ContentPasted5 x_ContentPasted3">However, I don't know what parameters to put in the realign function, or whether this is the right function to use or whether there is a better way to do this.</div>
<div class="x_ContentPasted5 x_ContentPasted3"><br class="">
</div>
<div class="x_ContentPasted5 x_ContentPasted3">Any help would be appreciated<br class="">
</div>
<div class="x_ContentPasted5 x_ContentPasted3"><br class="">
</div>
<div class="x_ContentPasted5 x_ContentPasted3">Thanks</div>
<div class="x_ContentPasted5 x_ContentPasted3"><br class="">
</div>
<div class="x_ContentPasted5 x_ContentPasted3">Hernando<br class="">
</div>
<br class="">
</div>
<div class="x_ContentPasted2 x_elementToProof x_ContentPasted0" style="font-style:normal; font-variant-caps: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-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
</div>
<div class="x_elementToProof x_ContentPasted1 x_ContentPasted0" style="font-style:normal; font-variant-caps: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-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; background-color:rgb(255,255,255)">
<br class="">
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps: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-variant-caps: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-variant-caps: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-users
mailing list:<span class="x_Apple-converted-space"> </span></span><a href="mailto:Chimera-users@cgl.ucsf.edu" data-auth="NotApplicable" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps: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-users@cgl.ucsf.edu</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps: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-variant-caps: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">Manage
subscription:<span class="x_Apple-converted-space"> </span></span><a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Fmailman%2Flistinfo%2Fchimera-users&data=05%7C01%7Chernando.sosa%40einsteinmed.edu%7C51e6f1e00b82448da82a08dac67b680e%7C9c01f0fd65e040c089a82dfd51e62025%7C0%7C0%7C638040530608264514%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gNhUsyA%2BvqiBWts2E0B8g1Mon37ow0kXFQnPO90HaTY%3D&reserved=0" data-auth="Verified" originalsrc="https://www.rbvi.ucsf.edu/mailman/listinfo/chimera-users" shash="PVHljlT992GQ+hyE2uo3gQHeqOkOs2YW9syjdqIQNLPYPRFLXgkNb4IGaOeJXS0HrGkWidSo9SvjBRWBuHRJsZaNdJPPKNdafUQEmiepAh4QwUZbVjJx/53HLhIvLwCkqkxa1JhMdznw1FOnKvJDlUE3jfodMkvhRZECsisX5JI=" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps: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://www.rbvi.ucsf.edu/mailman/listinfo/chimera-users</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>