mutate_residue doesn’t mutate

Member Site Forums PyRosetta PyRosetta – General mutate_residue doesn’t mutate

Viewing 3 reply threads
  • Author
    • #2166


        In my version of PyRosetta, which I downloaded in december 2014, the mutate_residue function doesn’t mutate the sequence of the Pose…

        Here is the relevant part of my code:

        for j in sequence:
        mutate_residue(pose,resn,j, pack_scorefxn=score_fxn)

        When I do this, pose doesn’t change even though its whole sequence should be replaced.

        I decided to do something else then:

        for j in sequence:
        mutator = MutateResidue( resn , j )
        mutator.apply( decoy )

        This time it doesn’t work because the amino acids are not recognized :
        ERROR: unrecognized residue name ‘A’
        ERROR:: Exit from: src/core/chemical/ line: 397

        So I switch to 3 letter code, ‘ALA’ and now it works fine even though the doc says that the one letter code should be given.

        In the end I get what I want with this hack but I’d like to know if you observe the same with your version of PyRosetta.
        Also, there is a mistake in the script which looks for rosetta_database whereas the directory is just ‘database’.


      • #10883

          Hi D,
          How exactly does your code access residue from Pose object? If it uses function like pose.residue and then change returned object then this will not work because returned object is ‘const’ in C++ world. So it really should not be changed. Please try using ‘pose.replace_residue’ function instead.


        • #10886

            This is from Evan Baugh who wrote the original function:

            “Sometime after I added this to PyRosetta, someone created the MutateResidue Mover (yes, it is a Mover despite the name), this is what you should actually use to make a canonical point mutation, my method uses the packer directly and in some rare cases (like…definitely <1% of the time) the packer will not be able to find a sidechain of the new aa that is lower in energy than the old sidechain, in this case, no change will occur"

            That said, we will change the functionality to force the mutation as it should be sometime this week. I will update this post when it is pushed to the developer version.


          • #10888

              Allright, thanks a lot Jared.


            • #10885

                Hi Sergey,

                actually I don’t access explicitely to any residue. I use mutate_residue from the toolbox.
                Here is what the help says:

                Help on function mutate_residue in module toolbox:

                mutate_residue(pose, mutant_position, mutant_aa, pack_radius=0.0, pack_scorefxn=”)
                Replace the residue at in with and
                repack any residues within angstroms of the mutating
                residue’s center (nbr_atom) using

                Note: is the single letter name for the desired ResidueType

                mutate_residue(pose, 30, “A”)

                Doesn’t it look like it should do the job ?
                When I run this function, it does something. It looks like it mutates residues and repack, as it should.
                But then, when I write my pose to a pdb it hasn’t changed…


              • #11511

                  Hello Jared!

                  Has any changes been done regarding this mutation since the last year? I’m trying to mutate to a aa with higher energy on purpose to show that the scoring will get worse, but I have the same problem as the thread starter. 



                • #11556

                    From what I can tell, the current version of PyRosetta still has the issues discussed with mutate_residue(). Use the MutateResidueMover instead.

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