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()
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 <" target="_blank">> 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 <" target="_blank">> wrote:try to use your experimental profile in the SAXSRestraint test, modules/pmi/test/test_saxs_resyou can also try foxs (with any protein and this profile) to see if your profile file format is ok.traint.py instead of "multi_A.pdb.dat" and see if you get the same error message from the test. On Wed, Nov 30, 2016 at 3:38 PM, Josh Bullock <" target="_blank">> wrote:______________________________joshThanks,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++ ?I get the following error:okay thanks for the advice.Just trying to get SAXSRestraint working now ...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_________________
IMP-users mailing list
" target="_blank">
https://salilab.org/mailman/listinfo/imp-users
_______________________________________________
IMP-users mailing list
" target="_blank">
https://salilab.org/mailman/listinfo/imp-users
_______________________________________________
IMP-users mailing list
" target="_blank">
https://salilab.org/mailman/listinfo/imp-users
_______________________________________________
IMP-users mailing list
">
https://salilab.org/mailman/listinfo/imp-users