molfile to params polymer python errors

Member Site Forums Rosetta 3 Rosetta 3 – Applications molfile to params polymer python errors

Viewing 3 reply threads
  • Author
    Posts
    • #3054
      Anonymous

        I am trying to generate parameters for a non-cannonical amino acid using the molfile_to_params_polymer.py script using python 2.7.5.python molfile_to_params_polymer.py –clobber –polymer –no-pdb –name OCT -k OCT.kin OCT.mol

        Edit: this is where I found the python script that is giving the errors.  /path/rosetta_demos/public/design_with_ncaa/scripts/python/apps/public/molfile_to_params_polymer.py

        I get the error:

        Traceback (most recent call last):

          File “test_molfile_to_params_polymer.py”, line 1995, in <module>

            sys.exit(main(sys.argv[1:]))

          File “test_molfile_to_params_polymer.py”, line 1919, in main

            m = molfiles[0]

        TypeError: ‘generator’ object has no attribute ‘__getitem__’

        I tried to change line 1919 to 

            m = next(molfiles)

        or 

           m = list(molfiles)[0]

        then get the error: 

        Traceback (most recent call last):

          File “test_molfile_to_params_polymer.py”, line 1995, in <module>

            sys.exit(main(sys.argv[1:]))

          File “test_molfile_to_params_polymer.py”, line 1953, in main

            polymer_assign_pdb_like_atom_names_to_sidechain( m.atoms, m.bonds, options.peptoid )

          File “test_molfile_to_params_polymer.py”, line 1697, in polymer_assign_pdb_like_atom_names_to_sidechain

            a.pdb_greek_dist = greek_alphabet[all_all_dist[ca_index]]

        TypeError: list indices must be integers, not float

         

        Does anyone have advice?

         

        Thank you

      • #14522
        Anonymous

          Without any inputs, it’s hard to say for sure, but most issues with the `pdb_greek_dist` indicate that you are running the script on a very long side chain. The script tries to assign PDB-style greek letters to the atoms (e.g. “c-alpha”, “c-beta”, etc.); there are only so many Greek letters. The script determines the “greek distance” by computing the shortest path between each atom and the alpha-carbon. Everything that is 1 bond away from the CA is a beta, 2 bonds is a gamma, 3 bonds is a delta… The longest canonical side-chain is ARG with has heavey atom swith a greek distance of 7. I suspect that heavy-atoms in your side chain are bonds away the an the number of letters in the greek alphabet.

          You can hack around this by modifing the script to make that array longer by padding it with whatever characters you like.

          • #14523
            Anonymous

              Thank you for your response! Yes the side chain is very long, it is actually a covalent cofactor, with 87 atoms. I have attached the molfile and the python script with discussed changes below. 

              I changed greek_alphabet to be of length 87 and got the same error. Here is the output prior to error:

            • #14525
              Anonymous

                It looks like the distance matrices are the length of my atom list, however the infinite values are only able to be replaced with integers from 1-7. To get rid of the float error, I changed 1e100 to 100 and it works…. I hope this is not giving me improper parameters though. 

                Nevertheless, with this parameter file, I have tried to run 

                /soft/pkg/rosetta/3.5/rosetta_source/bin/fixbb.linuxgccrelease -s 2fad.pdb -use_input_sc -nstruct 1 -database /soft/pkg/rosetta/3.5/rosetta_database -ex1 -ex2 -overwrite -minimize_sidechains -extra_res_fa OCT.params -resfile ncaa_resfile.txt

                core.init: Mini-Rosetta version Split from developer trunk at 53488 from http://www.rosettacommons.org

                core.init: command: /soft/pkg/rosetta/3.5/rosetta_source/bin/fixbb.linuxgccrelease -s 2fad.pdb -use_input_sc -nstruct 1 -database /soft/pkg/rosetta/3.5/rosetta_database -ex1 -ex2 -overwrite -minimize_sidechains -extra_res_fa OCT.params -resfile ncaa_resfile.txt

                core.init: ‘RNG device’ seed mode, using ‘/dev/urandom’, seed=2125895624 seed_offset=0 real_seed=2125895624

                core.init.random: RandomGenerator:init: Normal mode, seed=2125895624 RG_type=mt19937

                core.scoring.ScoreFunctionFactory: SCOREFUNCTION: standard

                core.scoring.ScoreFunctionFactory: SCOREFUNCTION PATCH: score12

                core.scoring.etable: Starting energy table calculation

                core.scoring.etable: smooth_etable: changing atr/rep split to bottom of energy well

                core.scoring.etable: smooth_etable: spline smoothing lj etables (maxdis = 6)

                core.scoring.etable: smooth_etable: spline smoothing solvation etables (max_dis = 6)

                core.scoring.etable: Finished calculating energy tables.

                basic.io.database: Database file opened: scoring/score_functions/PairEPotential/pdb_pair_stats_fine

                basic.io.database: Database file opened: scoring/score_functions/hbonds/standard_params/HBPoly1D.csv

                basic.io.database: Database file opened: scoring/score_functions/hbonds/standard_params/HBFadeIntervals.csv

                basic.io.database: Database file opened: scoring/score_functions/hbonds/standard_params/HBEval.csv

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/env_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/cbeta_den.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/pair_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/cenpack_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/env_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/cbeta_den.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/pair_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/cenpack_log.txt

                basic.io.database: Database file opened: scoring/score_functions/MembranePotential/CEN6_mem_env_log.txt

                basic.io.database: Database file opened: scoring/score_functions/MembranePotential/CEN10_mem_env_log.txt

                basic.io.database: Database file opened: scoring/score_functions/MembranePotential/memcbeta_den.txt

                basic.io.database: Database file opened: scoring/score_functions/MembranePotential/mem_pair_log.txt

                basic.io.database: Database file opened: scoring/score_functions/P_AA_pp/P_AA

                basic.io.database: Database file opened: scoring/score_functions/P_AA_pp/P_AA_n

                basic.io.database: Database file opened: scoring/score_functions/P_AA_pp/P_AA_pp

                basic.io.database: Database file opened: scoring/score_functions/rama/Rama_smooth_dyn.dat_ss_6.4

                protocols.jd2.PDBJobInputter: Instantiate PDBJobInputter

                protocols.jd2.PDBJobInputter: PDBJobInputter::fill_jobs

                protocols.jd2.PDBJobInputter: pushing 2fad.pdb nstruct index 1

                protocols.evaluation.ChiWellRmsdEvaluatorCreator: Evaluation Creator active … 

                protocols.jd2.PDBJobInputter: PDBJobInputter::pose_from_job

                protocols.jd2.PDBJobInputter: filling pose from PDB 2fad.pdb

                 

                ERROR: unrecognized mm_atom_type_name OS

                ERROR:: Exit from: src/core/chemical/MMAtomTypeSet.hh line: 79

                 

                changing OS to X, I get the same error regarding CT, changing this to X I get 

                …..

                protocols.jd2.PDBJobInputter: PDBJobInputter::pose_from_job

                protocols.jd2.PDBJobInputter: filling pose from PDB 2fad.pdb

                Segmentation fault (core dumped)

                using 

                /soft/pkg/rosetta/3.5/rosetta_source/bin/fixbb.linuxgccrelease -s 2fad.pdb -use_input_sc -nstruct 1 -database /soft/pkg/rosetta/3.5/rosetta_database -ex1 -ex2 -overwrite -minimize_sidechains -extra_res_cen OCT.params -resfile ncaa_resfile.txt

                core.init: Mini-Rosetta version Split from developer trunk at 53488 from http://www.rosettacommons.org

                core.init: command: /soft/pkg/rosetta/3.5/rosetta_source/bin/fixbb.linuxgccrelease -s 2fad.pdb -use_input_sc -nstruct 1 -database /soft/pkg/rosetta/3.5/rosetta_database -ex1 -ex2 -overwrite -minimize_sidechains -extra_res_cen OCT.params -resfile ncaa_resfile.txt

                core.init: ‘RNG device’ seed mode, using ‘/dev/urandom’, seed=1339095656 seed_offset=0 real_seed=1339095656

                core.init.random: RandomGenerator:init: Normal mode, seed=1339095656 RG_type=mt19937

                core.scoring.ScoreFunctionFactory: SCOREFUNCTION: standard

                core.scoring.ScoreFunctionFactory: SCOREFUNCTION PATCH: score12

                core.scoring.etable: Starting energy table calculation

                core.scoring.etable: smooth_etable: changing atr/rep split to bottom of energy well

                core.scoring.etable: smooth_etable: spline smoothing lj etables (maxdis = 6)

                core.scoring.etable: smooth_etable: spline smoothing solvation etables (max_dis = 6)

                core.scoring.etable: Finished calculating energy tables.

                basic.io.database: Database file opened: scoring/score_functions/PairEPotential/pdb_pair_stats_fine

                basic.io.database: Database file opened: scoring/score_functions/hbonds/standard_params/HBPoly1D.csv

                basic.io.database: Database file opened: scoring/score_functions/hbonds/standard_params/HBFadeIntervals.csv

                basic.io.database: Database file opened: scoring/score_functions/hbonds/standard_params/HBEval.csv

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/env_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/cbeta_den.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/pair_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/cenpack_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/env_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/cbeta_den.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/pair_log.txt

                basic.io.database: Database file opened: scoring/score_functions/EnvPairPotential/cenpack_log.txt

                basic.io.database: Database file opened: scoring/score_functions/MembranePotential/CEN6_mem_env_log.txt

                basic.io.database: Database file opened: scoring/score_functions/MembranePotential/CEN10_mem_env_log.txt

                basic.io.database: Database file opened: scoring/score_functions/MembranePotential/memcbeta_den.txt

                basic.io.database: Database file opened: scoring/score_functions/MembranePotential/mem_pair_log.txt

                basic.io.database: Database file opened: scoring/score_functions/P_AA_pp/P_AA

                basic.io.database: Database file opened: scoring/score_functions/P_AA_pp/P_AA_n

                basic.io.database: Database file opened: scoring/score_functions/P_AA_pp/P_AA_pp

                basic.io.database: Database file opened: scoring/score_functions/rama/Rama_smooth_dyn.dat_ss_6.4

                protocols.jd2.PDBJobInputter: Instantiate PDBJobInputter

                protocols.jd2.PDBJobInputter: PDBJobInputter::fill_jobs

                protocols.jd2.PDBJobInputter: pushing 2fad.pdb nstruct index 1

                protocols.evaluation.ChiWellRmsdEvaluatorCreator: Evaluation Creator active … 

                protocols.jd2.PDBJobInputter: PDBJobInputter::pose_from_job

                protocols.jd2.PDBJobInputter: filling pose from PDB 2fad.pdb

                core.chemical.ResidueTypeSet: Finished initializing fa_standard residue type set.  Created 6242 residue types

                core.pack.task: Packer task: initialize from command line() 

                core.pack.task: Packer task: initialize from command line() 

                core.pack.task.ResfileReader: Unable to add non-canonical amino acid OCT because it is not in the ResidueTypeSet for residue 36.

                ERROR:: Exit from: src/core/pack/task/ResfileReader.cc line: 1488

                my resfile contains:

                NATRO

                start

                36 A EMPTY

                36 A NC OCT

                 

            • #14527
              Anonymous

                You are using a pretty old version of Rosetta, but that shouod not be too much of an issue. Not sure hwy the OS is not recognised. If that atom is not involved in rotatable bond you care about, (i.e. not part of a chi angle) changing it to X should be okay.

                Couple things:

                A) molfile_to_params_polymer.py only produces Full Atom params files, so you need to use the full atom and not the centroid CL flag.


                -extra_res_fa OCT.params

                B) the score12 scorng function is not compatible with non-canonical side chains. You will need to use te MM_STD scoring function. I think it can be set as below but double check.


                -scoring:weights mm_std

              • #14528
                Anonymous

                  Renfrew, you have been such an amazing help. I loaded the newer version 3.9, just had to update a few paths. now using:

                  /PATH/rosetta/3.9/main/source/bin/fixbb.static.linuxgccrelease -s 2fad.pdb -use_input_sc -nstruct 1 -extra_res_fa OCT.params -resfile ncaa_resfile.txt -score:weights mm_std -database /PATH/rosetta/3.9/main/database -ex1 -ex2 -overwrite -minimize_sidechains

                  and the error is at least clearer (though not to me):

                  ERROR: Only the third ICOOR atom in a topology file should list itself as its own dihedral atom, from file OCT.params

                  (full output attached)

                  I’m not sure if my hacking the molfile_to_params_polymer.py (by adding extra letters to both greek_aplhabet dictionary and list, and changing m = molfile[0] to m = next(molfile) messed up the parameters.

                  But also, I tried to avoid creating a rotamer library, but the ligand is very large (phosphopantetheine) I think keeping it relatively fixed and treating the backone and rotamers as SER would be fine so I added ROTAMER_AA SER and BACKBONE_AA SER, but do you think this is causing issues?

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