Individual Residue Energy

Member Site Forums PyRosetta PyRosetta – General Individual Residue Energy

Viewing 1 reply thread
  • Author
    Posts
    • #3698
      Anonymous

        Hi everyone,

        I’m trying to get the energies of individual residues in a pose and am encountering an error that I can’t seem to find much information on. Here is a sample of my script:


        from pyrosetta import *
        from pyrosetta.rosetta import *
        from pyrosetta.rosetta.core.scoring import *

        pyrosetta.init('-ignore_zero_occupancy false')

        pose = pose_from_pdb(pdb_file)

        sfxn = create_score_function('ref2015.wts')

        score = pose.energies().residue_total_energy(1)

        And here is the error I encounter:

        ERROR: Energies::residue_total_energy( int const seqpos ): variable seqpos is out of range!

        This error is confusing to me because it seems to say that the residue number I entered (in this example 1) is not in the pose, however when I try something like:

        aa = pose.aa(1)

        which also requires the seqpose input I don’t get an error, and there doesn’t seem to be anything strange with the PDB file. I’ve tried this with multiple PDB files and gotten the same error. Does any know what I am doing wrong, or if there is an alternate way to get individual residue energies?

        Thanks

        -Peik

         

      • #15750
        Anonymous

          The energies object is only populated after scoring. You create the scorefunction, but never apply it to the pose.

          Try adding the line `sfxn.score( pose )` on the line before you access the energies object. That should fill out the energies object.

          • #15751
            Anonymous

              Thanks for the quick response! I figured that out literally right after posting. 

        Viewing 1 reply thread
        • You must be logged in to reply to this topic.