# Python2 script in Rosetta3.13

2 posts / 0 new
Python2 script in Rosetta3.13
#1
Good morning,

I am trying to use Rosetta (v3.13) for  drug screening analysis and I
found a specific script in the Rosetta3.13 package (also in other
versions) which has some python2 code that hampers its use in the
current python3.

The script is:
rosetta_bin_linux_2021.16.61629_bundle/main/source/scripts/python/public/batch_molfile_to_params.py

Python2 code:

1) Lines 110, 114, 117: print without brackets

2) Lines 40, 116: "is not" instead of "!="

3) Line 103: ".next()" method on itertools.product (should iterate over

Also, in line 89 the function "get_disallowed_ligands" iterates over the
folders in "main/database/chemical/residue_type_sets" and works with the
files in them. However, in this "residue_type_sets" folder there is also
a file "how_to_add_new_residue_types.txt" which yields an error, as the
"get_disallowed_ligands" function tries to use it as a folder. Moving
the "how_to" file to a previous folder solves the problem.

Thank you for your attention, I hope this helps.

Best regards,

Dani
Category:
Post Situation:
Wed, 2021-09-15 04:05
ddhoyo

This does not answer your question... but I had similar strong issues with molfile_to_params.py being Python2. I updated it to Python3, but it was in violation of Rosetta licence, so I took it down and rewrote my own and tailored for my use, i.e. as Python3 module called within a script or notebook: https://github.com/matteoferla/rdkit_to_params (pip install rdkit-to-params). It optionally (but majorly) relies on RDKit, the most used Python package for CompChemistry (pip install rdkit-pypi).

Wed, 2021-09-15 06:04
matteoferla