You are here

Best Way to Append/Insert Residue

4 posts / 0 new
Last post
Best Way to Append/Insert Residue


Hello everyone,

I am an undergraduate student researching with Pyrosetta for my lab this summer, and I am having difficulties appending/inserting residues into a pose. I would love some help.

I have tried using the grafting protocols (insert_pose_into_pose) but I just realized that there are methods such as append_polymer_residue_after_seqpos which seem to do what I want, perhaps more accurately.

My question is, essentially, if I have a pose with sequence "ABABA" and I want to insert an amino acid "C" after the third residue, how do I do this using the available pose methods?

I thank you greatly for any help you can offer

Post Situation: 
Tue, 2020-07-21 10:24

"ABABA" contains non-canonical amino acids which are not okay will a lot of loop grafting protocols... ;)

As you have seen insert_pose_into_pose will not do any alignments etc. and you have two disconnected poses. So append_polymer_residue_after_seqpos  is as you say the better way.

I wrote a blog post about adding missing loops so I am copypasting code from there.
So to add a residue you need to first create a residue from the residue type. This would allow you to use the append method:

chm = pyrosetta.rosetta.core.chemical.ChemicalManager.get_instance()
resiset = chm.residue_type_set( 'fa_standard' )
res_type = resiset.get_representative_type_name1(single_letter_name) #e.g. A
residue = pyrosetta.rosetta.core.conformation.ResidueFactory.create_residue(res_type)
pose.append_polymer_residue_after_seqpos(residue, previous + 1, True)

However, using the append method is not the end of it: i.e. this will not be placed patching a gap and in fact you need to remove the termini types and use a loop closure algorithm to close it.
If your ABABA sequence was already closed I am pretty sure you need to add a cut in the fold tree beforehand.
I keep mentioned loops because ABACBA has to be or become a loop, because if you want anything but a loop for ABACBA you will need to use remodel and add a lot of contraints...

Wed, 2020-07-22 06:33

Thank you for your help and prompt response! I checked out your blog and read through your code and that was very helpful as well.

As far as I have seen, I do not need to add a cut in the fold tree, and I can simply append "C" between two residues without issue(?). Am I wrong in this instance?

Moreover, I used the code from your blog and compared the score to the pose it was applied to with a control pose your code was not applied to and the scores were equal. Is this a fair way to assess if I need to "remove the termini types and use a loop closure algorithm to close it."

Apologies if this is a silly question, I am a new to the pyrosetta suite.



P.S. I am not actually using "ABA.." and "C," just thought that would be easier for illustrative purposes :)

Thu, 2020-07-23 08:16

Just checking the basics, the control pose was copied via `pose.clone()` or `pyrosetta.Pose(pose)` as opposed to variable assignment (`a = b`), right?

The best way to check is by visually inspecting it. If you look at your pose (saved & opened in PyMOL or  using pymolmover or nglview), you'll likely notice there is a OXT atom that appeared on the residue before the gap and the bb nitrogen has three protons after the gap, namely the gap is not really closed. In Pymol, the dotted line denoting a gap in Cartoon representation appears after longer bonds that what Pyrosetta considers for a discontinuity, so a lack of dottedness is not a sign of successful closure.

If you have a gap of exactly one amino acid and it seems to fit and your init had the extra argument `-use_truncated_termini true`, then yes, I'd guess you'd not need to do any loop closure assuming... This is awfully suspicious though. Although, it would make sense if the actual sequence was DP or DG —isoaspartate is a nuisance that happens to old protein under acidic conditions (and ammonium sulfate is pH 5).

Sat, 2020-07-25 03:52