<div dir="ltr">* I meant <div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px">h = IMP.atom.Hierarchy(p)</div><div style="font-family:arial,sans-serif;font-size:13px">c = p.get_children(h)</div></div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">this assumes that particle p was already decorated as Hierarchy (let me know if you are not familiar with decorators, Hierarchy, or Particle).</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 2, 2014 at 3:02 PM, Barak Raveh <span dir="ltr">&lt;<a href="mailto:barak.raveh@gmail.com" target="_blank">barak.raveh@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Josh, <div><br><div>I think get_children() is only a member function of Hierarchy, so you should do something like</div>

<div><br></div><div>IMP.atom.Hierarchy(p)</div><div>c = p.get_children()<br><div><div class="gmail_extra">
<br></div><div class="gmail_extra">&#39;cs&#39; seems to be a ConfigurationSet object - are you sure that you expect it to have children?</div><div class="gmail_extra"><br></div><div class="gmail_extra">What do you want to do?</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,</div><div class="gmail_extra">Barak</div><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 2, 2014 at 1:42 PM, Josh Bullock <span dir="ltr">&lt;<a href="mailto:jma.bullock@gmail.com" target="_blank">jma.bullock@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">ah sorry ! this line gives me the error<div class="gmail_extra"><br></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:13px">h= IMP.atom.Hierarchy.get_</span><span style="font-family:arial,sans-serif;font-size:13px">children(cs)</span></div>



<div class="gmail_extra"><font face="arial, sans-serif"><br></font></div><div class="gmail_extra"><font face="arial, sans-serif">thanks</font></div><div class="gmail_extra"><font face="arial, sans-serif"><br></font></div>



<div class="gmail_extra"><font face="arial, sans-serif">josh<br></font><br><div class="gmail_quote">On 2 July 2014 17:45,  <span dir="ltr">&lt;<a href="mailto:imp-users-request@salilab.org" target="_blank">imp-users-request@salilab.org</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Send IMP-users mailing list submissions to<br>
        <a href="mailto:imp-users@salilab.org" target="_blank">imp-users@salilab.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://salilab.org/mailman/listinfo/imp-users" target="_blank">https://salilab.org/mailman/listinfo/imp-users</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:imp-users-request@salilab.org" target="_blank">imp-users-request@salilab.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:imp-users-owner@salilab.org" target="_blank">imp-users-owner@salilab.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of IMP-users digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Re: Sampling and writing to pym/rmf (Barak Raveh) (Barak Raveh)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 2 Jul 2014 09:45:30 -0700<br>
From: Barak Raveh &lt;<a href="mailto:barak.raveh@gmail.com" target="_blank">barak.raveh@gmail.com</a>&gt;<br>
To: Help and discussion for users of IMP &lt;<a href="mailto:imp-users@salilab.org" target="_blank">imp-users@salilab.org</a>&gt;<br>
Subject: Re: [IMP-users] Sampling and writing to pym/rmf (Barak Raveh)<br>
Message-ID:<br>
        &lt;CAHp+_Uo19VasJDJYi+2CoUUu=<a href="mailto:u_6duKCraVetU4dW45%2BoDhTAw@mail.gmail.com" target="_blank">u_6duKCraVetU4dW45+oDhTAw@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
Which lines throws the error?<br>
<br>
<br>
On Wed, Jul 2, 2014 at 4:56 AM, Josh Bullock &lt;<a href="mailto:jma.bullock@gmail.com" target="_blank">jma.bullock@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi Barek,<br>
&gt;<br>
&gt; So I&#39;m not giving hierarchy.get_children the correct input:<br>
&gt;<br>
&gt; TypeError: unbound method get_children() must be called with Hierarchy<br>
&gt; instance as first argument (got ConfigurationSet instance instead)<br>
&gt;<br>
&gt; I&#39;m not sure which argument is the hierarchy instance.<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Josh<br>
&gt;<br>
&gt; -------------------------------------------------<br>
&gt;<br>
&gt; cs= get_conformations(m)<div><br>
&gt;<br>
&gt; for i in range(0, cs.get_number_of_configurations()):<br>
&gt;     JOSH = cs.load_configuration(i)<br>
&gt;     S= IMP.atom.Selection<br>
&gt;     h= IMP.atom.Hierarchy.get_children(cs)<br>
&gt;     tfn = IMP.create_temporary_file_name(&quot;josh%d&quot;%i, &quot;.rmf&quot;)<br>
&gt;     rh = RMF.create_rmf_file(tfn)<br>
&gt;<br></div>
&gt; On 1 July 2014 17:31, &lt;<a href="mailto:imp-users-request@salilab.org" target="_blank">imp-users-request@salilab.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Send IMP-users mailing list submissions to<br>
&gt;&gt;         <a href="mailto:imp-users@salilab.org" target="_blank">imp-users@salilab.org</a><br>
&gt;&gt;<br>
&gt;&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>
&gt;&gt;         <a href="https://salilab.org/mailman/listinfo/imp-users" target="_blank">https://salilab.org/mailman/listinfo/imp-users</a><br>
&gt;&gt; or, via email, send a message with subject or body &#39;help&#39; to<br>
&gt;&gt;         <a href="mailto:imp-users-request@salilab.org" target="_blank">imp-users-request@salilab.org</a><br>
&gt;&gt;<br>
&gt;&gt; You can reach the person managing the list at<br>
&gt;&gt;         <a href="mailto:imp-users-owner@salilab.org" target="_blank">imp-users-owner@salilab.org</a><br>
&gt;&gt;<br>
&gt;&gt; When replying, please edit your Subject line so it is more specific<br>
&gt;&gt; than &quot;Re: Contents of IMP-users digest...&quot;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Today&#39;s Topics:<br>
&gt;&gt;<br>
&gt;&gt;    1. Re: Sampling and writing to pym/rmf (Barak Raveh)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ----------------------------------------------------------------------<br>
&gt;&gt;<br>
&gt;&gt; Message: 1<br>
&gt;&gt; Date: Tue, 1 Jul 2014 09:31:33 -0700<br>
&gt;&gt; From: Barak Raveh &lt;<a href="mailto:barak.raveh@gmail.com" target="_blank">barak.raveh@gmail.com</a>&gt;<br>
&gt;&gt; To: Help and discussion for users of IMP &lt;<a href="mailto:imp-users@salilab.org" target="_blank">imp-users@salilab.org</a>&gt;<br>
&gt;&gt; Subject: Re: [IMP-users] Sampling and writing to pym/rmf<br>
&gt;&gt; Message-ID:<br>
&gt;&gt;         &lt;CAHp+_UowiBwJozbwOfi8yFEVt7Z8o2tEZ=<br>
&gt;&gt; <a href="mailto:LvYPnJh-LjpC2cSA@mail.gmail.com" target="_blank">LvYPnJh-LjpC2cSA@mail.gmail.com</a>&gt;<br>
&gt;&gt; Content-Type: text/plain; charset=&quot;utf-8&quot;<div><br>
&gt;&gt;<br>
&gt;&gt; Hi Josh, from a very superficial look, your code to write the RMF files<br>
&gt;&gt; seems fine - do you get an output RMF file? Could you load it in Chimera?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Jul 1, 2014 at 2:40 AM, Josh Bullock &lt;<a href="mailto:jma.bullock@gmail.com" target="_blank">jma.bullock@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; &gt; Hello,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I&#39;m relatively new to all this so please let me know if i&#39;m making any<br>
&gt;&gt; &gt; obvious errors ...<br>
&gt;&gt; &gt;<br></div><div>
&gt;&gt; &gt; Essentially all i&#39;m trying to do is generate an ensemble of models made<br>
&gt;&gt; &gt; from four subunits - constrained by MS connectivity restraints. The<br>
&gt;&gt; models<br>
&gt;&gt; &gt; get scored but nothing seems to write to the pymol file. Ideally i&#39;d<br>
&gt;&gt; like<br>
&gt;&gt; &gt; to write to an .rmf but i haven&#39;t worked that one out either ...<br>
&gt;&gt; &gt;<br></div><div><div>
&gt;&gt; &gt; Is this a reasonable way to go about my problem ?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Many thanks,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Josh<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; -------------------------------------------<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; import IMP<br>
&gt;&gt; &gt; import IMP.atom<br>
&gt;&gt; &gt; import IMP.rmf<br>
&gt;&gt; &gt; import inspect<br>
&gt;&gt; &gt; import IMP.container<br>
&gt;&gt; &gt; import IMP.display<br>
&gt;&gt; &gt; import IMP.statistics<br>
&gt;&gt; &gt; #import IMP.example<br>
&gt;&gt; &gt; import sys, math, os, optparse<br>
&gt;&gt; &gt; import RMF<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; from optparse import OptionParser<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; # Convert the arguments into strings and number<br>
&gt;&gt; &gt; Firstpdb = str(sys.argv[1])<br>
&gt;&gt; &gt; Secondpdb = str(sys.argv[2])<br>
&gt;&gt; &gt; Thirdpdb = str(sys.argv[3])<br>
&gt;&gt; &gt; Fourthpdb = str(sys.argv[4])<br>
&gt;&gt; &gt; models = float(sys.argv[5])<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; #*****************************************<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; # the spring constant to use, it doesnt really matter<br>
&gt;&gt; &gt; k=100<br>
&gt;&gt; &gt; # the target resolution for the representation, this is used to specify<br>
&gt;&gt; &gt; how detailed<br>
&gt;&gt; &gt; # the representation used should be<br>
&gt;&gt; &gt; resolution=300<br>
&gt;&gt; &gt; # the box to perform everything<br>
&gt;&gt; &gt; bb=IMP.algebra.BoundingBox3D(IMP.algebra.Vector3D(0,0,0),<br>
&gt;&gt; &gt;                              IMP.algebra.Vector3D(300, 300, 300))<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; # this function creates the molecular hierarchies for the various<br>
&gt;&gt; involved<br>
&gt;&gt; &gt; proteins<br>
&gt;&gt; &gt; def create_representation():<br>
&gt;&gt; &gt;     m= IMP.Model()<br>
&gt;&gt; &gt;     all=IMP.atom.Hierarchy.setup_particle(IMP.Particle(m))<br>
&gt;&gt; &gt;     all.set_name(&quot;the universe&quot;)<br>
&gt;&gt; &gt;     # create a protein, represented as a set of connected balls of<br>
&gt;&gt; &gt; appropriate<br>
&gt;&gt; &gt;     # radii and number, chose by the resolution parameter and the<br>
&gt;&gt; number of<br>
&gt;&gt; &gt;     # amino acids.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     def create_protein_from_pdbs(name, files):<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         def create_from_pdb(file):<br>
&gt;&gt; &gt;             sls=IMP.SetLogState(IMP.NONE)<br>
&gt;&gt; &gt;             datadir = os.getcwd()<br>
&gt;&gt; &gt;             print datadir<br>
&gt;&gt; &gt;     t=IMP.atom.read_pdb( datadir+&#39;/&#39; + file, m,<br>
&gt;&gt; &gt;                                  IMP.atom.ATOMPDBSelector())<br>
&gt;&gt; &gt;             del sls<br>
&gt;&gt; &gt;             #IMP.atom.show_molecular_hierarchy(t)<br>
&gt;&gt; &gt;             c=IMP.atom.Chain(IMP.atom.get_by_type(t,<br>
&gt;&gt; &gt; IMP.atom.CHAIN_TYPE)[0])<br>
&gt;&gt; &gt;             if c.get_number_of_children()==0:<br>
&gt;&gt; &gt;                 IMP.atom.show_molecular_hierarchy(t)<br>
&gt;&gt; &gt;             # there is no reason to use all atoms, just approximate the<br>
&gt;&gt; &gt; pdb shape instead<br>
&gt;&gt; &gt;             s=IMP.atom.create_simplified_along_backbone(c,<br>
&gt;&gt; &gt;<br>
&gt;&gt; resolution/300.0)<br>
&gt;&gt; &gt;             IMP.atom.destroy(t)<br>
&gt;&gt; &gt;             # make the simplified structure rigid<br>
&gt;&gt; &gt;             rb=IMP.atom.create_rigid_body(s)<br>
&gt;&gt; &gt; #            rb=IMP.atom.create_rigid_body(c)<br>
&gt;&gt; &gt;             rb.set_coordinates_are_optimized(True)<br>
&gt;&gt; &gt;             return s<br>
&gt;&gt; &gt; #            return c<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         h= create_from_pdb(files[0])<br>
&gt;&gt; &gt;         h.set_name(name)<br>
&gt;&gt; &gt;         all.add_child(h)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     create_protein_from_pdbs(&quot;A&quot;, [Firstpdb])<br>
&gt;&gt; &gt;     create_protein_from_pdbs(&quot;B&quot;, [Secondpdb])<br>
&gt;&gt; &gt;     create_protein_from_pdbs(&quot;C&quot;, [Thirdpdb])<br>
&gt;&gt; &gt;     create_protein_from_pdbs(&quot;D&quot;, [Fourthpdb])<br>
&gt;&gt; &gt;     #create_protein_from_pdbs(&quot;C&quot;, [&quot;rpt3_imp.pdb&quot;])<br>
&gt;&gt; &gt;     return (m, all)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; # create the needed restraints and add them to the model<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; def create_restraints(m, all):<br>
&gt;&gt; &gt;     def add_connectivity_restraint(s):<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         tr= IMP.core.TableRefiner()<br>
&gt;&gt; &gt;         rps=[]<br>
&gt;&gt; &gt;         for sc in s:<br>
&gt;&gt; &gt;             ps= sc.get_selected_particles()<br>
&gt;&gt; &gt;             rps.append(ps[0])<br>
&gt;&gt; &gt;             tr.add_particle(ps[0], ps)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         # duplicate the IMP.atom.create_connectivity_restraint<br>
&gt;&gt; &gt; functionality<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         score=<br>
&gt;&gt; &gt;<br>
&gt;&gt; IMP.core.KClosePairsPairScore(IMP.core.HarmonicSphereDistancePairScore(0,1),tr)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         r= IMP.core.MSConnectivityRestraint(m,score)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         iA = r.add_type([rps[0]])<br>
&gt;&gt; &gt;         iB = r.add_type([rps[1]])<br>
&gt;&gt; &gt;         iC = r.add_type([rps[2]])<br>
&gt;&gt; &gt;         iD = r.add_type([rps[3]])<br>
&gt;&gt; &gt;         n1 = r.add_composite([iA, iB, iC, iD])<br>
&gt;&gt; &gt;         n2 = r.add_composite([iA, iB], n1)<br>
&gt;&gt; &gt;         n3 = r.add_composite([iC, iD], n1)<br>
&gt;&gt; &gt;         n4 = r.add_composite([iB, iC, iD], n1)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;         m.add_restraint(r)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     evr=IMP.atom.create_excluded_volume_restraint([all])<br>
&gt;&gt; &gt;     m.add_restraint(evr)<br>
&gt;&gt; &gt;     # a Selection allows for natural specification of what the<br>
&gt;&gt; restraints<br>
&gt;&gt; &gt; act on<br>
&gt;&gt; &gt;     S= IMP.atom.Selection<br>
&gt;&gt; &gt;     sA=S(hierarchy=all, molecule=&quot;A&quot;)<br>
&gt;&gt; &gt;     sB=S(hierarchy=all, molecule=&quot;B&quot;)<br>
&gt;&gt; &gt;     sC=S(hierarchy=all, molecule=&quot;C&quot;)<br>
&gt;&gt; &gt;     sD=S(hierarchy=all, molecule=&quot;D&quot;)<br>
&gt;&gt; &gt;     add_connectivity_restraint([sA, sB, sC, sD])<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; # find acceptable conformations of the model<br>
&gt;&gt; &gt; def get_conformations(m):<br>
&gt;&gt; &gt;     sampler= IMP.core.MCCGSampler(m)<br>
&gt;&gt; &gt;     sampler.set_bounding_box(bb)<br>
&gt;&gt; &gt;     # magic numbers, experiment with them and make them large enough for<br>
&gt;&gt; &gt; things to work<br>
&gt;&gt; &gt;     sampler.set_number_of_conjugate_gradient_steps(100)<br>
&gt;&gt; &gt;     sampler.set_number_of_monte_carlo_steps(20)<br>
&gt;&gt; &gt;     sampler.set_number_of_attempts(models)<br>
&gt;&gt; &gt;     # We don&#39;t care to see the output from the sampler<br>
&gt;&gt; &gt;     sampler.set_log_level(IMP.SILENT)<br>
&gt;&gt; &gt;     # return the IMP.ConfigurationSet storing all the found<br>
&gt;&gt; configurations<br>
&gt;&gt; &gt; that<br>
&gt;&gt; &gt;     # meet the various restraint maximum scores.<br>
&gt;&gt; &gt;     cs= sampler.create_sample()<br>
&gt;&gt; &gt;     return cs<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; # cluster the conformations and write them to a file<br>
&gt;&gt; &gt; def analyze_conformations(cs, all, gs):<br>
&gt;&gt; &gt;     # we want to cluster the configurations to make them easier to<br>
&gt;&gt; &gt; understand<br>
&gt;&gt; &gt;     # in the case, the clustering is pretty meaningless<br>
&gt;&gt; &gt;     embed= IMP.statistics.ConfigurationSetXYZEmbedding(cs,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;  IMP.container.ListSingletonContainer(IMP.atom.get_leaves(all)), True)<br>
&gt;&gt; &gt;     cluster= IMP.statistics.create_lloyds_kmeans(embed, 10, 10000)<br>
&gt;&gt; &gt;     # dump each cluster center to a file so it can be viewed.<br>
&gt;&gt; &gt;     for i in range(cluster.get_number_of_clusters()):<br>
&gt;&gt; &gt;         center= cluster.get_cluster_center(i)<br>
&gt;&gt; &gt;         cs.load_configuration(i)<br>
&gt;&gt; &gt;         w= IMP.display.PymolWriter(&quot;cluster.%d.pym&quot;%i)<br>
&gt;&gt; &gt;         for g in gs:<br>
&gt;&gt; &gt;             w.add_geometry(g)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; #******************************************************************************************<br>
&gt;&gt; &gt; # now do the actual work<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; (m,all)= create_representation()<br>
&gt;&gt; &gt; IMP.atom.show_molecular_hierarchy(all)<br>
&gt;&gt; &gt; create_restraints(m, all)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; # in order to display the results, we need something that maps the<br>
&gt;&gt; &gt; particles onto<br>
&gt;&gt; &gt; # geometric objets. The IMP.display.Geometry objects do this mapping.<br>
&gt;&gt; &gt; # IMP.display.XYZRGeometry map an IMP.core.XYZR particle onto a sphere<br>
&gt;&gt; &gt; gs=[]<br>
&gt;&gt; &gt; for i in range(all.get_number_of_children()):<br>
&gt;&gt; &gt;     color= IMP.display.get_display_color(i)<br>
&gt;&gt; &gt;     n= all.get_child(i)<br>
&gt;&gt; &gt;     name= n.get_name()<br>
&gt;&gt; &gt;     g= IMP.atom.HierarchyGeometry(n)<br>
&gt;&gt; &gt;     g.set_color(color)<br>
&gt;&gt; &gt;     gs.append(g)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; cs= get_conformations(m)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; print &quot;found&quot;, cs.get_number_of_configurations(), &quot;solutions&quot;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ListScores = []<br>
&gt;&gt; &gt; for i in range(0, cs.get_number_of_configurations()):<br>
&gt;&gt; &gt;         cs.load_configuration(i)<br>
&gt;&gt; &gt;         # print the configuration<br>
&gt;&gt; &gt;         print &quot;solution number: &quot;,i,&quot;scored :&quot;, m.evaluate(False)<br>
&gt;&gt; &gt;         ListScores.append(m.evaluate(False))<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; f1 = open(&quot;out_scores.csv&quot;, &quot;w&quot;)<br>
&gt;&gt; &gt; f1.write(&quot;\n&quot;.join(map(lambda x: str(x), ListScores)))<br>
&gt;&gt; &gt; f1.close()<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; # for each of the configuration, dump it to a file to view in pymol<br>
&gt;&gt; &gt; for i in range(0, cs.get_number_of_configurations()):<br>
&gt;&gt; &gt;     JOSH = cs.load_configuration(i)<br>
&gt;&gt; &gt;     S= IMP.atom.Selection<br>
&gt;&gt; &gt;     h= IMP.atom.Hierarchy.get_children(cs)<br>
&gt;&gt; &gt;     tfn = IMP.create_temporary_file_name(&quot;josh%d&quot;%i, &quot;.rmf&quot;)<br>
&gt;&gt; &gt;     rh = RMF.create_rmf_file(tfn)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     # add the hierarchy to the file<br>
&gt;&gt; &gt;     IMP.rmf.add_hierarchies(rh, h)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     # add the current configuration to the file as frame 0<br>
&gt;&gt; &gt;     IMP.rmf.save_frame(rh)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     for g in gs:<br>
&gt;&gt; &gt;         w.add_geometry(g)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; analyze_conformations(cs, all, gs)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br></div></div><div>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; IMP-users mailing list<br>
&gt;&gt; &gt; <a href="mailto:IMP-users@salilab.org" target="_blank">IMP-users@salilab.org</a><br>
&gt;&gt; &gt; <a href="https://salilab.org/mailman/listinfo/imp-users" target="_blank">https://salilab.org/mailman/listinfo/imp-users</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br></div>
&gt;&gt; --<br>
&gt;&gt; Barak<br>
&gt;&gt; -------------- next part --------------<br>
&gt;&gt; An HTML attachment was scrubbed...<br>
&gt;&gt; URL: &lt;<br>
&gt;&gt; <a href="http://salilab.org/archives/imp-users/attachments/20140701/7b0e5f9f/attachment.html" target="_blank">http://salilab.org/archives/imp-users/attachments/20140701/7b0e5f9f/attachment.html</a><br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------<div><br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; IMP-users mailing list<br>
&gt;&gt; <a href="mailto:IMP-users@salilab.org" target="_blank">IMP-users@salilab.org</a><br>
&gt;&gt; <a href="https://salilab.org/mailman/listinfo/imp-users" target="_blank">https://salilab.org/mailman/listinfo/imp-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br></div>
&gt;&gt; End of IMP-users Digest, Vol 38, Issue 2<br>
&gt;&gt; ****************************************<div><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; IMP-users mailing list<br>
&gt; <a href="mailto:IMP-users@salilab.org" target="_blank">IMP-users@salilab.org</a><br>
&gt; <a href="https://salilab.org/mailman/listinfo/imp-users" target="_blank">https://salilab.org/mailman/listinfo/imp-users</a><br>
&gt;<br>
&gt;<br>
<br>
<br></div>
--<br>
Barak<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://salilab.org/archives/imp-users/attachments/20140702/081e70ca/attachment.html" target="_blank">http://salilab.org/archives/imp-users/attachments/20140702/081e70ca/attachment.html</a>&gt;<br>
<br>
------------------------------<div><br>
<br>
_______________________________________________<br>
IMP-users mailing list<br>
<a href="mailto:IMP-users@salilab.org" target="_blank">IMP-users@salilab.org</a><br>
<a href="https://salilab.org/mailman/listinfo/imp-users" target="_blank">https://salilab.org/mailman/listinfo/imp-users</a><br>
<br>
<br></div>
End of IMP-users Digest, Vol 38, Issue 4<br>
****************************************<br>
</blockquote></div><br></div></div>
<br>_______________________________________________<br>
IMP-users mailing list<br>
<a href="mailto:IMP-users@salilab.org" target="_blank">IMP-users@salilab.org</a><br>
<a href="https://salilab.org/mailman/listinfo/imp-users" target="_blank">https://salilab.org/mailman/listinfo/imp-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Barak
</div></div></div></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Barak
</div>