I have a python code backward.py
that reads multiple inputs and options and then output one file. What this script does is turning a coarse grained structure(in gro file) in molecular dynamics simulation to an all atom structure using some sort of mapping algorithm.
backward.py: https://github.com/Tsjerk/MartiniTools/blob/master/backward.py
gro file format is like:
14839
1MET BB 1 4.173 3.275 1.812 -0.0069 -0.3280 -0.2983
1MET SC1 2 4.360 3.461 1.580 0.0581 -0.0052 -0.4273
2ALA BB 3 4.285 3.091 1.885 -0.1281 -0.1166 -0.0674
3SER BB 4 4.514 2.881 1.673 -0.2956 -0.3708 0.0155
3SER SC1 5 4.536 3.017 1.449 -0.1433 -0.1251 -0.0305
4GLU BB 6 4.862 2.935 1.836 0.0310 -0.1089 0.0899
4GLU SC1 7 5.152 2.907 1.567 -0.0071 -0.1857 -0.1227
To run it, the command looks like:
python backward.py -f PRO-PHE-PHE_unwrapped3.gro -o PRO-PHE-PHE_aa.gro -from martini -to charmm36 -p prophephe_aa.top
However, it can only deal with one frame(one structure) but not a trajectory that consists of many time continuous frames. Now, I write another python code that splits a trajectory into those individual frames and calls the backward.py to transfer them to atomistic structures and then merge them back into one file as a trjectory. I need to use backward.py in this script. But, I found that I cannot directly use import backward
in my code as it gives error without including those options.
In the second python script, What should be the proper way to use the backward.py in the same manner as it is used alone.