Show how to create an RMF file that has references to external files. And how to read it back, sort of.
8 input_pdb = os.path.join(os.path.split(sys.argv[0])[0],
"simple.pdb")
9 rmf_name = RMF._get_temporary_file_path(
"externals.rmf")
10 output_pdb = RMF._get_temporary_file_path(
"simple.pdb")
11 print(
"file name is", rmf_name)
14 rmf.add_frame(
"root", RMF.FRAME)
17 open(output_pdb,
"w").write(open(input_pdb,
"r").read())
18 pdb_relpath = "./simple.pdb"
20 rpf = RMF.ReferenceFrameFactory(rmf)
21 ef = RMF.ExternalFactory(rmf)
23 c0 = rmf.get_root_node().add_child(
"copy0", RMF.REPRESENTATION)
27 external = c0.add_child(
"simple.pdb", RMF.REPRESENTATION)
29 ed.set_path(pdb_relpath)
32 c1 = rmf.get_root_node().add_child(
"copy1", RMF.REPRESENTATION)
36 c1.add_child(external)