You are here

Pose is full atom and mover expects centroid, how do I handle it the best?

5 posts / 0 new
Last post
Pose is full atom and mover expects centroid, how do I handle it the best?

I'm trying to use pyrosetta.rosetta.protocols.quantum_annealing.ExternalPackerResultLoader for a project of side-chain packing small peptides with a fixed backbone. I've gotten as far as building the Mover: instantiate the mover, giving it rebuild info and the string with selected rotamers.

The problem I run into comes when I try to apply it to the starting pose; I get a warning: [ WARNING ] Number of atoms in pose and silent file disagree! Attempting to continue ... [ WARNING ]    (in residue ALA:NtermProteinFull at 1 and atm_seqpos of 1  natoms_pose=7  natoms_struct=12  tag="empty") [ WARNING ] Likely explanations: [ WARNING ] 	1. You are trying to extract, with residue type set A, a silent file created with residue type set B. [ WARNING ] 	2. You have specified a database with -database that is out of sync with your chosen executable. [ WARNING ] 	3. You have used different environment flags (e.g. -restore_talaris_behavior/-restore_pre_talaris_behavior) than the silent file was generated with. [ WARNING ] 	4. The database has been updated since your silent file was made, meaning the definition of this RT has drifted.


I've narrowed it down to explanation 1: the pose is full atom, and the mover, when applied, changes the pose to centroid representation.

The question is now how to best handle it:

1. Change the pose to centroid, apply the mover, then back to full atom to compare. But according to this tutorial: "Converting from full atom to centroid and back will not give you back the same structure, as sidechain building in Rosetta is not deterministic." Would it work anyways in this case?

2. Is there a way of changing the mover's silent file type to full atom? (I tried googling to no avail)

3. I'm comparing the final pose from the external packer with a pose packed by pyrosetta that is full atom. Is it the best idea to change just everything into centroid and score it that way?

Or is there another better way?

Post Situation: 
Thu, 2022-01-27 05:55

I don't know about that mover but I can say Centroid is without sidechains. There's a residue-specific chonky beta carbon as opposed to a sidechain and one hydrogen. You are saying: "I'm trying to use pyrosetta.rosetta.protocols.quantum_annealing.ExternalPackerResultLoader for a project of side-chain packing small peptides with a fixed backbone " [emphasis added]"
You can apply switch a pose to centroid via `pyrosetta.rosetta.protocols.simple_moves.SwitchResidueTypeSetMover('centroid')` and then recover the sidechains via `pyrosetta.rosetta.protocols.simple_moves.ReturnSidechainMover` when you switch it back to full atom, sure, but saving the silent file in centroid mode utterly defeats the purpose of your experiment as don;t care about the fixed backbone, but care about your sidechains —so no to #1 and #3.

If this mover is one that accepts other movers (havent checked), then all your movers should return a full-atom pose... if so, maybe one isn't and that is the root of the problem.

Googling often returns blanks with PyRosetta as it does not catch code well and the scripts you are looking for are in the SI of paywalled papers. A nice way to find more about a mover, beyond the Rosetta scripts page and the PyRosetta Sphinx docs is looking at the tests in the Rosetta download, these are Rosetta scripts though, and the raw code of the mover as going from C++ doxigen to Python docstrings to Sphinx as the former standard is a bit rubbish. And if you are sure you aren't doing anything beginner-level wrong, then email the author can help!


Fri, 2022-01-28 06:28

Thank you for your answer!

I tried with SwitchResidueTypeSetMover, just to double-check, but it does seem like I should not even be in centroid territory.

    centroid = SwitchResidueTypeSetMover("centroid")
    full_atom = SwitchResidueTypeSetMover("fa_standard")

and I get the old error anyway (so changing to centroid representation did not make the error go away) plus a new error:

core.util.switchresiduetypeset: [ WARNING ] When switching to a fa_standard ResidueTypeSet:  Pose already contains fa_standard ResidueTypes.


Which really confuses me. Maybe my assumption of the underlying problem was wrong, but now I really don't understand what is wrong. Can a pose be both centroid and fully atomic at the same time? The mover still changes the pose to a centroid representation.


(I tried with external_packer.set_type('fa_standard'). It did not help. Maybe this is the wrong type of type.)


Thinking about the other three suggested errors focusing on the database being out of sync: When is the silent file built? Is it already built when I instantiate the mover or after?

Unfortunately, my knowledge of C++ is scarce, and I'm sorry to say so is my knowledge of Rosetta, so I don't know if it is a beginner-level error.

Wed, 2022-02-02 10:47

It is a warning, not an error, but yes, your external_packer is converting your centroid pose to full atom.

I have a notebook called centroid and I see some lines that may be handy, e.g.

assert pose.is_centroid()
assert not pose.is_fullatom()

# -------------------------------------------------------------

import nglview as nv  # assuming in Jupyter not Colab

view = nv.show_rosetta(pose)

A centroid pose has odd sidechains.

If you have ligands in Rosetta or with PyRosetta initialisation they require a params file argument for the fa and for the cen. In PyRosetta they will require their residue type to added to the residue type set of the pose.

Most movers and protocols don't use silent files and when they do they can make it at whatever point was felt best suited, but generally Options are read at the start.

Thu, 2022-02-03 10:39

I emailed the author of the function and got the solution:

"Just pass the flag "-in:file:fullatom" to let Rosetta know that the stored structure should be treated as an all-atom structure and not as a centroid structure.  I'll add that to my list of things to fix in the ExternalPackerResultLoader; it should assume that the structure is all-atom."

The warnings disappeared!

Tue, 2022-02-08 07:23