In this example a pdb is converted into a multiresolution model, somewhat painfully.
18 chains = IMP.atom.get_by_type(h, IMP.atom.CHAIN_TYPE)
24 def recursive_approximation(res):
25 print(
"approximating", res)
30 me = recursive_approximation(res[0:lr // 4])\
31 + recursive_approximation(res[lr // 4: lr // 2])\
32 + recursive_approximation(res[lr // 2: 3 * lr // 4])\
33 + recursive_approximation(res[3 * lr // 4: lr])
48 res = IMP.atom.get_by_type(h, IMP.atom.RESIDUE_TYPE)
54 me = recursive_approximation(res[0:lr // 4])\
55 + recursive_approximation(res[lr // 4: lr // 2])\
56 + recursive_approximation(res[lr // 2: 3 * lr // 4])\
57 + recursive_approximation(res[3 * lr // 4: lr])
63 rmf = RMF.create_rmf_file(fn)