I have been trying to insert residues into a PDB and then relaxing with Rosetta using rosettascripts. Currenlty I have managed a way to replace specified residues with another direct subsitution, but can;t figure out how to directly add more residues. I'm attempting another method by manually adding "dummy" residues into the pdb and then having rosetta replace those with the desired reisdue. Would it be something accomplished using a resfile instead of a Rosettascripts function?
<ScoreFunction name="sfxn" weights="ref2015"/>
<Index name="res1" resnums="1"/>
<Index name="res2" resnums="47"/>
<Index name="res3" resnums="13"/>
<OperateOnResidueSubset name="repack" selector="seqfixed">
<Action residue_selector="res1" aas="C"/>
<Action residue_selector="res2" aas="C"/>
<Action residue_selector="res3" aas="C"/>
<SetIGType name="linmemig" lin_mem_ig="true"/>
This is the script I use to directly sub in residues in place of another.
One issue you're potentially going to run into is that when you insert residues, you'll have to remodel the backbone to make sure they're smoothly connected. That's why there isn't necessarily an "easy" way to do it -- there's more complex protocols which include info about how to fix the backbone.
I'd take a look at the insertion movers list to see various options. Another option I might look into is the RemodelMover which is an XML interface over the RosettaRemodel application (see here and here), which should be able to handle insertions, deletions and mutations.