Adding energies of residues doesnt add up to energy of the entire protein

Member Site Forums PyRosetta PyRosetta – General Adding energies of residues doesnt add up to energy of the entire protein

Viewing 1 reply thread
  • Author
    Posts
    • #668
      Anonymous

        Hi All,

        – does anyone know how to quickly calculate the overall energy of a residue in PyRosetta

        – I wrote a script that adds up the weighted energies of each residue in a protein. The final answer does not make sense with the entire protein. The output and the script is below. Am I doing something completely stupid here? Or is this a bug? It would be really nice to know. Thanks in advance. Please help!

        OUTPUT


        Total residues in pose: 564
        Total energy from score function is: -519.506146364
        Total energy from adding up individual residues is: -119.228484011


        Scores Weight Raw Score Wghtd.Score


        fa_atr 0.800 -2760.102 -2208.082
        fa_rep 0.440 1205.667 530.493
        fa_sol 0.650 1598.518 1039.037
        fa_intra_rep 0.004 1772.882 7.092
        pro_close 1.000 30.887 30.887
        fa_pair 0.490 -106.526 -52.198
        hbond_sr_bb 1.170 -210.895 -246.747
        hbond_lr_bb 1.170 -131.223 -153.531
        hbond_bb_sc 1.170 -28.362 -33.184
        hbond_sc 1.100 -14.410 -15.851
        dslf_ss_dst 1.000 0.000 0.000
        dslf_cs_ang 1.000 0.000 0.000
        dslf_ss_dih 1.000 0.000 0.000
        dslf_ca_dih 1.000 0.000 0.000
        fa_dun 0.560 1455.995 815.357
        p_aa_pp 0.640 -208.687 -133.560
        ref 1.000 -99.220 -99.220


        Total weighted score: -519.506

        INPUT SCRIPT


        1 #i/usr/struct/bin/python-2.6
        2
        3 from rosetta import *
        4 rosetta.init()
        5
        6 import os
        7
        8 ####### INPUT ###########
        9 startname = “../1sr8/1sr8-01.clean.pdb”
        10 p = Pose(startname)
        11 #########################
        12
        13 scorefxn = create_score_function(‘standard’)
        14 totalenergy = 0.0000
        15 totenergy = scorefxn(p)
        16 totres = p.total_residue()
        17 print(‘Total residues in pose: ‘ + str(totres))
        18
        19 for i in range(1,totres+1):
        20
        21 resenergy = 0.0000
        22
        23 resenergy = resenergy + 0.800*float(p.energies().residue_total_energies(i)[fa_atr])
        24 resenergy = resenergy + 0.440*float(p.energies().residue_total_energies(i)[fa_rep])
        25 resenergy = resenergy + 0.650*float(p.energies().residue_total_energies(i)[fa_sol])
        26 resenergy = resenergy + 0.004*float(p.energies().residue_total_energies(i)[fa_intra_rep])
        27 resenergy = resenergy + 1.000*float(p.energies().residue_total_energies(i)[pro_close])
        28 resenergy = resenergy + 0.490*float(p.energies().residue_total_energies(i)[fa_pair])
        29 resenergy = resenergy + 1.170*float(p.energies().residue_total_energies(i)[hbond_sr_bb])
        30 resenergy = resenergy + 1.170*float(p.energies().residue_total_energies(i)[hbond_lr_bb])
        31 resenergy = resenergy + 1.170*float(p.energies().residue_total_energies(i)[hbond_bb_sc])
        32 resenergy = resenergy + 1.100*float(p.energies().residue_total_energies(i)[hbond_sc])
        33 resenergy = resenergy + 1.000*float(p.energies().residue_total_energies(i)[dslf_ss_dst])
        34 resenergy = resenergy + 1.000*float(p.energies().residue_total_energies(i)[dslf_cs_ang])
        35 resenergy = resenergy + 1.000*float(p.energies().residue_total_energies(i)[dslf_ss_dih])
        36 resenergy = resenergy + 1.000*float(p.energies().residue_total_energies(i)[dslf_ca_dih])
        37 resenergy = resenergy + 0.560*float(p.energies().residue_total_energies(i)[fa_dun])
        38 resenergy = resenergy + 0.640*float(p.energies().residue_total_energies(i)[p_aa_pp])
        39 resenergy = resenergy + 1.000*float(p.energies().residue_total_energies(i)[ref])
        40
        41 totalenergy = totalenergy + resenergy
        42
        43 print(‘Total energy from score function is: ‘ + str(totenergy))
        44 print(‘Total energy from adding up individual residues is: ‘ + str(totalenergy))
        45
        46 scorefxn.show(p)

        Thanks alot for reading

        Tanmay

      • #4617
        Anonymous

          I didn’t read your script, but off the top of my head the problem is likely to be in the hydrogen bonding energies. Check them out specifically.

          Rosetta doesn’t store some of the hydrogen bond energies on a per-residue basis unless specifically ordered to do so. Because of how the hydrogen bond set is generated (and the fact that some bond types preclude other bond types), it requires two passes through the set of residues to find the bonds and then store the energies per-residue. So, the code only stores per-structure unless you ask otherwise. I don’t know the python command to alter this; look in the scorefunction EnergyMethodOptions and see if that gets you anywhere.

          If this is the cause, you’ll see that the whole-protein energies for the hydrogen bonding terms are nonzero, but all per-residue energies for those terms are 0.

          On second thought, a difference of 400 energy units is huge for this issue, so you may have a second issue. Try iterating through the active weights in the scorefunction instead of manually summing terms – maybe you missed a term? You could also have a typo in your weights.

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