2 """This script shows how to create a system with multiple copies of the same molecule.
3 We also create some crosslinks which take into account the ambiguity.
4 The key to ambiguity is using the same molecule name for ambiguous copies.
5 That way when you perform Selection it automatically finds all relevant molecules.
29 st1 = s.create_state()
30 st2 = s.create_state()
35 m1A = st1.create_molecule(
'ProtA',sequence,chain_id=
'A')
36 m1A.add_representation(m1A,resolutions=[1])
37 m1B = m1A.create_clone(chain_id=
'B')
41 m1C = st1.create_molecule(
'ProtC',sequence,chain_id=
'C')
42 m1C.add_representation(m1C,resolutions=[1])
45 m2A = st2.create_molecule(
'ProtA',sequence,chain_id=
'A')
46 m2A.add_representation(m2A,resolutions=[1])
47 m2C = st2.create_molecule(
'ProtC',sequence,chain_id=
'C')
48 m2C.add_representation(m2C,resolutions=[1])
57 for mol
in (m1A,m1B,m1C,m2A,m2C):
58 dof.create_flexible_beads(mol,
60 dof.create_super_rigid_body(mol)
69 lines =
'''id,mol1,res1,mol2,res2,score
72 tf = tempfile.NamedTemporaryFile(delete=
False, mode=
'w')
78 kw.set_unique_id_key(
"id")
79 kw.set_protein1_key(
"mol1")
80 kw.set_protein2_key(
"mol2")
81 kw.set_residue1_key(
"res1")
82 kw.set_residue2_key(
"res2")
83 kw.set_id_score_key(
"score")
84 xldb = IMP.pmi.io.crosslink.CrossLinkDataBase(kw)
85 xldb.create_set_from_file(tf.name)
91 CrossLinkDataBase=xldb,
97 output_objects.append(xlr)
98 rmf_restraints.append(xlr)
99 dof.get_nuisances_from_restraint(xlr)
103 for mol
in (m1A,m1B,m1C,m2A,m2C):
106 output_objects.append(cr)
107 rmf_restraints.append(cr)
112 output_objects.append(evr1)
115 output_objects.append(evr2)
132 crosslink_restraints=rmf_restraints,
133 monte_carlo_sample_objects=dof.get_movers(),
134 global_output_directory=
'ambiguity_output/',
135 output_objects=output_objects,
136 monte_carlo_steps=10,