<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);">
Hi, </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'm attempting to use a python script to save the names of each residue in a protein </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The code I have is as follows: </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="color:#d4d4d4;background-color:#1e1e1e;font-family:Consolas, 'Courier New', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span style="color:#c586c0">import</span><span> chimerax, </span></span>sys</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="color:#d4d4d4;background-color:#1e1e1e;font-family:Consolas, 'Courier New', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span style="color:#c586c0">from</span><span> chimerax.core.commands </span><span style="color:#c586c0">import</span><span> run</span></span></div>
<div style="color:#d4d4d4;background-color:#1e1e1e;font-family:Consolas, 'Courier New', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span>
<div style="color:#d4d4d4;background-color:#1e1e1e;font-family:Consolas, 'Courier New', monospace;font-weight:normal">
<span><span>cwd = (</span><span style="color:#4ec9b0">str</span><span>(sys.argv[</span><span style="color:#b5cea8">0</span><span>][:-</span><span style="color:#b5cea8">17</span><span>]))</span></span></div>
<div style="color:#d4d4d4;background-color:#1e1e1e;font-family:Consolas, 'Courier New', monospace;font-weight:normal">
<span><span>
<div style="color:#d4d4d4;background-color:#1e1e1e;font-family:Consolas, 'Courier New', monospace;font-weight:normal">
<span><span>prot = </span><span style="color:#ce9178">"/A"</span></span></div>
</span></span></div>
</span></span></div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="color:#d4d4d4;background-color:#1e1e1e;font-family:Consolas, 'Courier New', monospace;font-weight:normal;font-size:14px;line-height:19px">
<span><span>run(session, </span><span style="color:#ce9178">"open 3GDM"</span><span>)</span></span>
<div><span>run(session, </span><span style="color:#ce9178">"save "</span><span> + </span><span style="color:#4ec9b0">str</span><span>(cwd) + </span><span style="color:#ce9178">"/script_content/sasa/name.defattr "</span><span> + </span><span style="color:#4ec9b0">str</span><span>(prot) + </span><span style="color:#ce9178">" & protein attrName r:name format defattr"</span><span>)</span></div>
</div>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The command being input into the command line of ChimeraX by the script is as follows: </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
"save [file path]/name.defattr /A & protein attrName r:name format defattr" </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've also tried using: </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
"<span style="background-color:rgb(255, 255, 255);display:inline !important">save [file path]/name.defattr attrName r:name format defattr models /A & protein" </span></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);">
However, both commands give me a file with all the residues and all the names contained within the model rather than just the chain I'm interested in. </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);">
Could you advise on how I can better use this command to save a file with the residue positions and corresponding amino acid for each residue from a single chain only? </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've attached the resultant file to this email. </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);">
Kind regards, </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
David </div>
</body>
</html>