Show how to add bonds to a file.
6 def copy_to_residues(pin, pout, rcf, rf, pcf, pf, acf, af, ccf, cf, bf, prev):
10 rpout.set_residue_type(rpin.get_residue_type())
11 rpout.set_residue_index(rpin.get_residue_index())
14 ca = pin.get_children()[0]
15 for c
in pin.get_children():
17 if acf.get_is(c)
and c.get_name().find(
"CA") != -1:
19 mass += pcf.get(c).get_mass()
22 ppout.set_coordinates(pca.get_coordinates())
26 bd = bf.get(pout.add_child(
"bond", RMF.BOND))
27 bd.set_bonded_0(prev.get_id().get_index())
28 bd.set_bonded_1(pout.get_id().get_index())
32 cf.get(pout).set_chain_id(ccf.get(pin).get_chain_id())
34 for inch
in pin.get_children():
35 if inch.get_type() == RMF.REPRESENTATION:
36 outch = pout.add_child(inch.get_name(), inch.get_type())
37 prev = copy_to_residues(
54 outpath = RMF._get_temporary_file_path(
"3U7W-residues.rmf")
56 out.add_frame(
"nothing", RMF.FRAME)
57 print(
"file is", outpath)
58 bf = RMF.BondFactory(out)
60 rcf = RMF.ResidueFactory(fh)
61 rf = RMF.ResidueFactory(out)
62 pcf = RMF.ParticleFactory(fh)
63 pf = RMF.ParticleFactory(out)
64 acf = RMF.AtomFactory(fh)
65 af = RMF.AtomFactory(out)
66 ccf = RMF.ChainFactory(fh)
67 cf = RMF.ChainFactory(out)
68 bf = RMF.BondFactory(out)