-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconvert_rascal.py
More file actions
30 lines (21 loc) · 1007 Bytes
/
convert_rascal.py
File metadata and controls
30 lines (21 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import pathlib
from pprint import pp
import RATapi as RAT
# convert R1 project to Project class
def convert_rascal():
project_path = pathlib.Path(__file__).parent / "R1monolayerVolumeModel.mat"
project = RAT.utils.convert.r1_to_project_class(project_path)
# change values if you like, including ones not supported by R1
project.parameters["Head Thickness"].prior_type = "gaussian"
project.parameters["Theta"].mu = 2.0
project.parameters["Area per molecule"].sigma = 50.0
# convert DSPC standard layers example to a struct and save as file
lipid_bilayer_project = RAT.examples.DSPC_standard_layers()[0]
RAT.utils.convert.project_class_to_r1(lipid_bilayer_project, filename="lipid_bilayer.mat")
# convert and return as a Python dictionary
struct = RAT.utils.convert.project_class_to_r1(lipid_bilayer_project, return_struct=True)
return project, struct
if __name__ == "__main__":
project, struct = convert_rascal()
print(project)
pp(struct)