<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Milan,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>The return value from matchmaker is a list of dictionaries, one per chain pairing. The atomic.molarray.Atoms objects in them are efficient containers for multiple Atom objects, that allows vector-like operations on them for setting and getting attribute values. But those objects can also be treated just like lists, iterated over, etc. Therefore you can use len() to find out how many atoms there are. The 'full' Atoms objects are all the paired atoms from the initial sequence alignment, and the 'finall' Atoms objects are after iterative pruning to discard poorly matching regions.</div><div class=""><br class=""></div><div class=""><div class="">--Eric</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>UCSF Computer Graphics Lab</div></div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 18, 2023, at 4:33 AM, Borchert, Milan via ChimeraX-users <<a href="mailto:chimerax-users@cgl.ucsf.edu" class="">chimerax-users@cgl.ucsf.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div id="divtagdefaultwrapper" dir="ltr" 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; -webkit-text-stroke-width: 0px; text-decoration: none; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" class=""><div style="margin-top: 0px; margin-bottom: 0px;" class="">Hello ChimeraX community,</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">I have been trying to use the Chimerax tool to sequentially check one query pdb against multiple (later up to 10000) pdb files. For this I have been working with the python scripting functionality. With the following code I was able to get the resulting data (number of matched atoms and resulting RMSD) saved as a html log file:</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><p style="margin-top: 0px; margin-bottom: 0px;" class=""></p><div class="">import os<br class="">from chimerax.core.commands import run as rc<br class=""><br class=""># change to folder with data files<br class="">os.chdir("/home/ubuntu/Desktop/Chimerax_search/N_crassa_pdb")<br class=""><br class=""># gather the names of .pdb files in the folder<br class="">file_names = [fn for fn in os.listdir(".") if fn.endswith(".pdb")]<br class=""><br class=""># give path to query file to be searched against pdb library<br class="">query = "/home/ubuntu/Desktop/Chimerax_search/query/BDFB_007497.pdb"<br class=""><br class=""># open the query file as #1 in ChimeraX<span class="Apple-converted-space"> </span><br class="">rc(session, "open /home/ubuntu/Desktop/Chimerax_search/query/BDFB_007497.pdb")<br class=""><br class=""># loop through the files<br class="">for fn in file_names:<br class=""># open first target pdb as #2<span class="Apple-converted-space"> </span><br class=""> rc(session, "open " + fn)<br class=""># match both structures<br class=""> rc(session, "match #1 to #2")<br class=""># save log with ID matching input filename, close #2 and clear log<br class=""> rc(session, "log save " + fn.split(".")[0] + ".log")<br class=""> rc(session, "close #2")<br class=""> rc(session, "log clear")</div><p style="margin-top: 0px; margin-bottom: 0px;" class=""></p><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Instead of trying to gather the relevant data from thousands of rather large html output files I instead would prefer to only get then resulting values from matchmaker. I learned that the command actually has all the values I wanted as return values, so I tried to write a modified script, that saves these values in a variable and collects the values for every target pdb file in a dict:</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><p style="margin-top: 0px; margin-bottom: 0px;" class=""></p><div class="">import os<br class="">from chimerax.core.commands import run as rc<br class=""><br class=""># change to folder with data files<br class="">os.chdir("/home/ubuntu/Desktop/Chimerax_search/N_crassa_pdb")<br class=""><br class=""># gather the names of .pdb files in the folder<br class="">file_names = [fn for fn in os.listdir(".") if fn.endswith(".pdb")]<br class=""><br class=""># give path to query file to be searched against pdb library<br class="">query = "/home/ubuntu/Desktop/Chimerax_search/query/BDFB_007497.pdb"<br class=""><br class=""># open the query file as #1 in ChimeraX<span class="Apple-converted-space"> </span><br class="">rc(session, "open /home/ubuntu/Desktop/Chimerax_search/query/BDFB_007497.pdb")<br class=""><br class=""># create empty dict to collect matchmaker output<br class="">output = {}<br class=""><br class=""># loop through the files, opening, processing, and closing each in turn<br class="">for fn in file_names:<br class=""> id = fn.split("/")[-1].split(".")[0]<br class=""> rc(session, "open " + fn)<br class=""> match = rc(session, "match #1 to #2")<br class=""> output.update({id : match})<br class=""> rc(session, "log save " + fn.split(".")[0] + ".log")<br class=""> rc(session, "close #2")<br class=""> rc(session, "log clear")<br class=""><br class=""># display dict<br class="">print(output)</div><p style="margin-top: 0px; margin-bottom: 0px;" class=""></p><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">For now I just used 4 target pdbs with my query and only tried printing the result to quickly check if it fits. However the result is a bit baffling to me. I do get the RMSD values, but not the other data:</div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-family: "DejaVu Serif"; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; float: none; display: inline !important;" class="">{'NCU01382': [{'full match atoms': <chimerax.atomic.molarray.Atoms object at 0x7f1944492130>, 'full ref atoms': <chimerax.atomic.molarray.Atoms object at 0x7f194448f610>, 'final match atoms': <chimerax.atomic.molarray.Atoms object at 0x7f1946694430>, 'final ref atoms': <chimerax.atomic.molarray.Atoms object at 0x7f1946694550>, 'full RMSD': 63.065617285514556, 'final RMSD': 1.365365439813019, 'transformation matrix': <chimerax.geometry.place.Place object at 0x7f194669c130>, 'aligned ref seq': <chimerax.atomic.molobject.Sequence object at 0x7f19f7b8f8b0>, 'aligned match seq': <chimerax.atomic.molobject.StructureSeq object at 0x7f19f7b8f610>}</span></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">here is one of the resulting hits, for my first target pdb (NCU01382). As you can see, the RMSD scores are correctly given, but for other values the internal object names and no resulting value are displayed. Any help with figuring this out would be greatly appreciated.<br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class="">Best Wishes<br class="">Milan Borchert<br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div><div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class=""></div></div><span style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">ChimeraX-users mailing list</span><br style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:ChimeraX-users@cgl.ucsf.edu" 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; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">ChimeraX-users@cgl.ucsf.edu</a><br style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Manage subscription:</span><br style="caret-color: rgb(0, 0, 0); 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; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" 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; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a></div></blockquote></div><br class=""></div></body></html>