sure. here is a minimal-ish version
 
import IMP
import RMF
import IMP.atom
import IMP.rmf
import IMP.pmi
import IMP.pmi.topology
import IMP.pmi.dof
import IMP.pmi.macros
import IMP.pmi.restraints
import IMP.pmi.restraints.saxs
import IMP.pmi.restraints.basic
import IMP.pmi.representation
import IMP.pmi.tools
import IMP.pmi.samplers
import IMP.pmi.output
import IMP.pmi.macros
import IMP.pmi.topology
 
seqs = IMP.pmi.topology.Sequences('data/seq.fasta')

mdl = IMP.Model()
s = IMP.pmi.topology.System(mdl)
st = s.create_state()

mols = []

prot = st.create_molecule("prot1",sequence=seqs["prot"],chain_id="A")
atomic = prot.add_structure(('data/prot.pdb'),chain_id=" ")

prot.add_representation(atomic,resolutions=[1])

mols.append(prot)

root_hier = s.build()

dof = IMP.pmi.dof.DegreesOfFreedom(mdl)
for mol in mols:
    dof.create_rigid_body(mol,nonrigid_parts=mol.get_non_atomic_residues())
                       
###################### RESTRAINTS #####################

output_objects = [] # keep a list of functions that need to be reported
rmf_restraints = []

##SAXS setup

saxs1 = IMP.pmi.restraints.saxs.SAXSRestraint(root_hier,"SAXS.dat")
saxs1.add_to_model()
output_objects.append(saxs1)
rmf_restraints.append(saxs1)

###################### SAMPLING #####################

rex=IMP.pmi.macros.ReplicaExchange0(mdl,
                                    root_hier=root_hier,                         
                                    crosslink_restraints=[],                    
                                    monte_carlo_sample_objects=dof.get_movers(), 
                                    global_output_directory='multiscale_output/',
                                    output_objects=output_objects,
                                    monte_carlo_steps=10,
                                    number_of_best_scoring_models=10,     
                                    number_of_frames=50000)                  
rex.execute_macro()

On 1 December 2016 at 15:56, Dina Schneidman <duhovka@gmail.com> wrote:
it looks fine to me. I can look at your file, but the problem is probably not there.
Can you try to minimize your code to a small unit test that fails?

On Wed, Nov 30, 2016 at 8:51 PM, Josh Bullock <jma.bullock@gmail.com> wrote:
foxs works fine.

test_saxs_restraint.py gives assertion errors:
 
FAIL: test_SAXSRestraint (__main__.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_saxs_restraint.py", line 41, in test_SAXSRestraint
    self.assertAlmostEqual(saxs_rest.evaluate(), 0.107, delta = 0.01)
AssertionError: 21.697142074172216 != 0.107 within 0.01 delta

======================================================================
FAIL: test_SAXSRestraint_residue (__main__.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_saxs_restraint.py", line 51, in test_SAXSRestraint_residue
    self.assertAlmostEqual(saxs_rest2.evaluate(), 0.491, delta = 0.01)
AssertionError: 21.832825619163884 != 0.491 within 0.01 delta

----------------------------------------------------------------------
Ran 2 tests in 0.149s

FAILED (failures=2)

 but i assume this is because the values being asserted apply to multi_A.pdb.dat.

i can send over the .dat file if that's helpful ?

thanks,

On 30 November 2016 at 14:44, Dina Schneidman <duhovka@gmail.com> wrote:
try to use your experimental profile in the SAXSRestraint test, modules/pmi/test/test_saxs_restraint.py instead of "multi_A.pdb.dat" and see if you get the same error message from the test.
you can also try foxs (with any protein and this profile) to see if your profile file format is ok.

On Wed, Nov 30, 2016 at 3:38 PM, Josh Bullock <jma.bullock@gmail.com> wrote:
okay thanks for the advice.

Just trying to get SAXSRestraint working now ...

I get the following error:
Profile  is not sampled for q = 0.0054794, q_max = 0.5
You can remove points with q > 0.5 from the experimental profile or recompute the profile with higher max_q

I'm slightly confused as 0.0054795 < 0.5, and also there are no values in my .dat file above 0.5. Finally, there doesn't seem to be a way to alter the max_q through the pmi module, would i have to go through the C++ ?

Thanks,

josh

_______________________________________________
IMP-users mailing list
IMP-users@salilab.org
https://salilab.org/mailman/listinfo/imp-users



_______________________________________________
IMP-users mailing list
IMP-users@salilab.org
https://salilab.org/mailman/listinfo/imp-users



_______________________________________________
IMP-users mailing list
IMP-users@salilab.org
https://salilab.org/mailman/listinfo/imp-users



_______________________________________________
IMP-users mailing list
IMP-users@salilab.org
https://salilab.org/mailman/listinfo/imp-users