rosettaScore.py has a typo, I think. Can I fix it in my own copy?

Member Site Forums Rosetta 3 Rosetta 3 – General rosettaScore.py has a typo, I think. Can I fix it in my own copy?

Viewing 3 reply threads
  • Author
    Posts
    • #2975
      Anonymous

        I’m using a protein_tools script that calls up the rosettaScore.py script.  In line 85 of rosettaScore.py, it says:

        print “theres some problem with this score line, possible corruption, skipping line”

        But I think it should be:

        print (“theres some problem with this score line, possible corruption, skipping line”)

        It won’t let me write over the script file, even though I think I have ownership of the software.  What can I do?

      • #14364
        Anonymous

          Update: I’ve been editing it, and now I’m stuck on protein_tools/rosettautil/protein/util trying to import “PSSM”, which it can’t find…

        • #14371
          Anonymous

            So the `print stuff` versus `print( stuff )` difference is a Python2 versus Python3 issue. — Most scripts in Rosetta are still written in Python2. We’re slowly converting over to Python3, but if you’re getting those sorts of issues, your best bet is to run those scripts with Python2, instead of manually converting to the Python3 syntax. (There’s a number of other Python2/Python3 differences, and something that’s not intended to work with Python3 is not necessarily going to work correctly, even if you change all the print statements.)

            That said, you should be able to edit your own copy of the script, if you have write permission to the directory. (If you have a shared installation of Rosetta, you probably won’t have write access to the directory.)

            Note that if you do copy the script to a new directory for your own version/as a backup, you’ll want to copy the full directory path. These scripts often rely on other scripts in the directory, and if you copy one script out of the directory (or change the hierarchy), this can mess up the autodetection behavior.

            Even if you preserve the hierarch, sometimes the scripts are finniky about the module search path. I think that’s what your PSSM problem is. The PSSM module is in the tools/protein_tools/rosettautil/protein/ directory, and apparently this doesn’t work right on your machine. One way around it is to edit the util.py to use a relative import.

            That is, change `import PSSM` to `from . import PSSM`  (This syntax should work with both Python2 and Python3)

             

          • #14375
            Anonymous

              Thank you, rmoretti.  I’m finding quite a few rabbit trails in the software setup of the computer lab I’m  using.  Python is brought in through anaconda, which results in a lot of redirection/misdirection.  I got stuck again on “the id ( ) is already used for a sibling of this entity.”  I ended up just using the clean_pdb script for the purpose of renumbering, which worked fine.

          Viewing 3 reply threads
          • You must be logged in to reply to this topic.