Show how to create an RMF file that has references to external files.
Show how to create an RMF file that has references to external files.And how to read it back, sort of.
import RMF
import os.path
import sys
input_pdb = os.path.join(os.path.split(sys.argv[0])[0], "simple.pdb")
rmf_name = RMF._get_temporary_file_path("externals.rmf")
output_pdb = RMF._get_temporary_file_path("simple.pdb")
print("file name is", rmf_name)
rmf.add_frame("root", RMF.FRAME)
open(output_pdb, "w").write(open(input_pdb, "r").read())
pdb_relpath = "./simple.pdb"
rpf = RMF.ReferenceFrameFactory(rmf)
ef = RMF.ExternalFactory(rmf)
c0 = rmf.get_root_node().add_child("copy0", RMF.REPRESENTATION)
rb0 = rpf.get(c0)
external = c0.add_child("simple.pdb", RMF.REPRESENTATION)
ed = ef.get(external)
ed.set_path(pdb_relpath)
c1 = rmf.get_root_node().add_child("copy1", RMF.REPRESENTATION)
rb1 = rpf.get(c1)
c1.add_child(external)
FileHandle create_rmf_file(std::string path)
Create an RMF from a file system path.