molfile_to_params.py ported to python 3.
This script generates a
.params file from a ligand given as a mol/sdf/mdl file or a mol2 file. The
.params file is the topology file for Rosetta and has to be specified with the flag
-in:file:extra_res_fa <file> (Rosetta Relax, Score etc.) and
-in:file:extra_res_cen <file> (required by Remodel).
So turns out that the version shipped with Rosetta is longer and has more functionality.
I am not the author, Ian W. Davis is. I just ported this code to the 2nd decade of 21st century. So any issues, loveletters and royalty checks go to the original author.
Original script is from http://www.pyrosetta.org/scripts.
There does not seem to be a version in python 3 of pyrosetta and I cannot figure out where the parts have gone that it calls. So I ported it and the three files it needs to python3.
Note that there were some additional changes required.
isinstance(f, io.IOBase)— why did they kill
sort(lambda a,b: cmp(a,b))to sort(key=lambda a: a) — cmp died with 2.
dot <= 0to
dt <= 0
The Rosetta version has a wee mod. It contains a method called
run making it more usable as a module.
import molfile_to_params molfile_to_params.run('xxx.mol2', name='XXX', amino_acid=True)
The key-arguments are the same as the ones for the parser and are written in full so the IDE can hint them.