<html>
<head>
<!-- BaNnErBlUrFlE-HeAdEr-start -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.pfptBannerTableMSO { padding: 0px 12px 5px 12px; width: 100%;border-radius:4px;border-top:4px solid #90a4ae;background-color:#D0D8DC; }
.pfptTitleMSO { color:#000000 !important;font-family: 'Arial', sans-serif !important;font-weight:bold !important;font-size:14px !important; }
.pfptSubtitleMSO { font-size:12px !important; font-family: 'Arial', sans-serif !important; }
.pfptButtonMSO { mso-padding-alt: 7.5px; padding: 7.5px; text-decoration: none; font-family: 'Arial', sans-serif !important; font-size: 14px; line-height: 40px; border-radius:2px; }
.pfptPrimaryButtonMSO {
border: 1.5px solid #666666; color: #000000;
}
.pfptBanner {
margin: 15px 14px 30px 14px;
padding: 8px 16px 8px 16px;
border-radius: 4px;
min-width: 200px;
background-color: #D0D8DC;
border-top: 4px solid #90a4ae;
}
.pfptBannerTitle {
color: #000000;
font-family: 'Arial', sans-serif;
font-size: 14px;
font-weight: bold;
line-height: 18px;
display: block;
}
.pfptBannerSubtitle {
color: #000000;
font-weight: normal;
font-family: 'Arial', sans-serif;
font-size: 12px;
line-height: 18px;
margin-top: 2px;
display: block;
}
.pfptButton {
display: inline-block;
font-family: 'Arial', sans-serif;
font-size: 14px;
font-weight: normal;
border-radius: 2px;
padding: 7.5px 16px;
margin: 3px 0 3px 16px;
white-space: nowrap;
width: fit-content;
}
.pfptPrimaryButton {
border: 1px solid #666666;
}
.pfptPrimaryButton:hover, .pfptPrimaryButton:focus {
background-color: #b4c1c7;
}
.pfptPrimaryButton:active {
background-color: #90a4ae;
}
.pfptMessageContainer {
display: inline-block;
margin: 0px 0px 1px 0px;
max-width: 600px;
}
.pfptButtonGroup {
float: right;
margin: 0px 0px 0px 16px;
text-align: right;
width: fit-content;
}
.pfptPreheader { display:none !important; visibility:hidden; mso-hide:all; font-size:1px; line-height:1px; max-height:0px; max-width:0px; opacity:0; overflow:hidden; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
<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">
<!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<span class="pfptPreheader" style="display:none !important;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">
Hello everyone, Please see my script below: import os import sys from chimerax.core.commands import run as rc target_folder = '/wynton/home/jacobson/avranga1008/Documents/0-combo' os.chdir(target_folder) home =os.getcwd()
</span>
<!-- Preheader Text : END -->
<!-- Email Banner : BEGIN -->
<span style="display:none !important;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</span>
<!--[if ((ie)|(mso))]>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 3px 0px 16px 0px; direction: ltr" lang="en"><tr><td>
<table class="pfptBannerTableMSO" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%;border-radius:4px;border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
<table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
<tr><td><span class="pfptTitleMSO" style="color:#000000 !important;font-family: 'Arial', sans-serif;font-weight:bold !important;font-size:14px !important; direction: ltr">
This Message Is From an External Sender
</span></td></tr>
<tr><td><span class="pfptSubtitleMSO" style="color:#000000 !important;font-weight:normal !important;font-family: 'Arial', sans-serif; font-size:12px !important; direction: ltr">
This message came from outside your organization.
</span></td></tr>
</table>
</td></tr></table>
</td></tr></table>
<![endif]-->
<![if !((ie)|(mso))]>
<div dir="ltr" lang="en" class="pfptBanner" style="margin:16px 0px 16px 0px; padding:8px 16px 8px 16px; border-radius: 4px; min-width: 200px;background-color: #D0D8DC; border-top: 4px solid #90a4ae;">
<div class="pfptMessageContainer" style="display: inline-block; margin: 0px 0px 1px 0px; max-width: 600px;">
<div class="pfptBannerTitle" style="color:#000000 !important;font-family: 'Arial', sans-serif !important;font-weight:bold !important;font-size:14px !important;line-height:18px;display:block;">
This Message Is From an External Sender
</div>
<div class="pfptBannerSubtitle" style="color:#000000 !important;font-weight:normal !important;font-family: 'Arial', sans-serif !important;font-size:12px !important;line-height:18px;margin-top:2px;display:block">
This message came from outside your organization.
</div>
</div>
</div>
<![endif]>
<div style="display:none !important;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->
<!-- BaNnErBlUrFlE-BoDy-end -->
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Hello everyone,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<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);">
Please see my script below:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<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);">
import os
<div>import sys</div>
<div>from chimerax.core.commands import run as rc</div>
<div>target_folder = '/wynton/home/jacobson/avranga1008/Documents/0-combo'</div>
<div>os.chdir(target_folder)</div>
<div>home =os.getcwd()</div>
<div>all = os.listdir()</div>
<div>xp_distance_file = os.path.join(home,'xp-distance.log')</div>
<div>print_to_screen = sys.stdout</div>
<div>mae_files =[]</div>
<div>for f in all:</div>
<div> if f.endswith('.mae'):</div>
<div> mae_files.append(f)</div>
<div> print(f'working on {f}')</div>
<div> sys.stdout = open(xp_distance_file,'a')</div>
<div> rc(session,"open " + f)</div>
<div> rc(session,"measure center #1.1 & ligand mark true")</div>
<div> rc(session,"measure center #1.1 :310,335,728,759 mark true")</div>
<div> rc(session,"distance #2 #3")</div>
<div> rc(session,"close")</div>
<div> sys.stdout = print_to_screen</div>
<div>print(f'completed writing xp-distance values to {xp_distance_file} ; now moving to next loop')</div>
<div>for f in mae_files:</div>
<div> line = f + '\n'</div>
<div> open('file_list.txt','a').write(line)</div>
<div>print("loop is complete")</div>
exit()<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);">
<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);">
I am curently using stdout to write the distance values to a file .I am currently running it on command line</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
</div>
<img style="margin: 0px; max-width: 100%; color: rgb(0, 0, 0);" class="w-326 h-28" size="3867" contenttype="image/png" data-outlook-trace="F:1|T:1" src="cid:68afa919-1a35-470f-808c-242e97c85957">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<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);">
it seems like a round about way to do it. The output file has lot of special characters and it takes a bit of effort using regex to extract the values.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<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);">
I think there might be some logger in chimerax which can do this or some other better way to write results to a file , but i am not able to find it. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
#############</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<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);">
<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);">
<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);">
please let me know your suggestions on improving this code.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<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);">
thanks,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
amith</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<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);">
<br>
</div>
</body>
</html>