# Motif Graft Mover error

2 posts / 0 new
Motif Graft Mover error
#1

hello everyone,

I was using a script i wrote last year regarding motif grafting, but it no longer works, i suspect a pyrosetta update issue.

anyway, i am looking through the errors and it seemed the pyrosetta.rosetta.protocols.motif_grafting.movers.MotifGraftMover's init_parameters() have some additional arguments that is must have.

my code is as follows:

mover.init_parameters(    receptor,     # context_structure
motif,         # motif_structure
1.0,         # RMSD_tolerance
2.0,         # NC_points_RMSD_tolerance
5,             # clash_score_cutoff
1,             ## min_fragment_size                        ??? what value?
'0:0',         # combinatory_fragment_size_delta
'0:0',         # max_fragment_replacement_size_delta
'ALA',         # clash_test_residue
hotspots,     # hotspots
True,         # full_motif_bb_alignment
False,         # allow_independent_alignment_per_fragment
True,         # graft_only_hotspots_by_replacement
False,         # only_allow_if_N_point_match_aa_identity
False,         # only_allow_if_C_point_match_aa_identity
True,         # revert_graft_to_native_sequence
False,        # allow_repeat_same_graft_output
1.0,        ## output_cluster_tolerance                    ??? what value?
GEO)        ## output_filter                            ??? how to pass a filter or multiple filters?
mover.apply(pose)


min_fragment_size, output_cluster_tolerance, output_filter were not there in the past, now they are a requirement.

I am looking through rosetta's motif graft mover but these arguments are not addressed.

my biggest issue is with the filters. what filters should i use, and how to pass them here? because any filter i use [such as the pyrosetta.rosetta.protocols.score_filters.ScoreTypeFilter()] gives me back a: Segmentation fault (core dumped)

can anyone help me fix this issue and get the mover working? anu recent papers that explain the best parameters with the new updated pyrosetta?

---------------UPDATE-------------------

I have been trying to read about this protocol but I have not found any papers that details nor explains the moving parts. This is my most recent attempt:

from pyrosetta import *
from pyrosetta.toolbox import *
init()

def Graft(receptor, motif, scaffold):
#Setup motif and its hotspots
motifpose = pose_from_pdb(motif)
spots = list()
for resi in range(motifpose.total_residue()): spots.append(str(resi + 1))
hotspots = ':'.join(spots)
#Setup scaffold
scaffoldpose = pose_from_pdb(scaffold)
#Setup score function
scorefxn = get_fa_scorefxn()
#Setup filters
#	SCO = pyrosetta.rosetta.protocols.simple_filters.ShapeComplementarityFilter()
#	DDG = pyrosetta.rosetta.protocols.simple_ddg.DdgFilter()
#	BUH = pyrosetta.rosetta.protocols.simple_filters.BuriedUnsatHbondFilter()
FLTR = pyrosetta.rosetta.protocols.filters.Filter()

#Setup grafting mover
graft = pyrosetta.rosetta.protocols.motif_grafting.movers.MotifGraftMover()
graft.init_parameters(	receptor, 	# context_structure
motif, 		# motif_structure
1.0, 		# RMSD_tolerance
2.0, 		# NC_points_RMSD_tolerance
5, 			# clash_score_cutoff
1, 			## min_fragment_size
'0:0', 		# combinatory_fragment_size_delta
'0:0', 		# max_fragment_replacement_size_delta
'ALA', 		# clash_test_residue
hotspots, 	# hotspots
True, 		# full_motif_bb_alignment
False, 		# allow_independent_alignment_per_fragment
True, 		# graft_only_hotspots_by_replacement
False, 		# only_allow_if_N_point_match_aa_identity
False, 		# only_allow_if_C_point_match_aa_identity
True, 		# revert_graft_to_native_sequence
False,		# allow_repeat_same_graft_output
1.0,		## output_cluster_tolerance
FLTR)		## output_filter
graft.apply(scaffoldpose)
scaffold.dump_pdb('grafted.pdb')

Graft('receptor.pdb', 'motif.pdb', 'scaffold.pdb')

I get this error:

Traceback (most recent call last):
File "graft.py", line 45, in <module>
Graft('receptor.pdb', 'motif.pdb', 'scaffold.pdb')
File "graft.py", line 42, in Graft
graft.apply(scaffoldpose)
RuntimeError: Tried to call pure virtual function "Filter::apply"

What does this error mean? I tried searching for it, but there is no explanation with regard to pyrosetta.

I am running the same tutorial as the meiler lab, that way i know that the motif successfully grafts on the provided scaffold.

Can someone help me?

---------------UPDATE-------------------

I managed to find an old release of pyrosetta in my backups (PyRosetta 4 release 173), i confirm that the above script works perfectly with this release, so this means that the issue is with the update after this release.

Mainly the issue is with adding the filter (pyrosetta.rosetta.protocols.filters.Filter) and making it an obligation for the mover to work, thus I am unable to figure out which filter to add and how to add it to make the mover work, I get the following error:

RuntimeError: Tried to call pure virtual function "Filter::apply"

Is there is away to make this filter work? please someone help me understand how to use it.

Category:
Post Situation:
Tue, 2019-03-26 13:25
ac.research

The issue you run into with the Filter is that the Filter base class can't really exist -- there's nothing to filter on, so it's ill-defined.

The C++ level interface to that function actually takes a "null pointer" to represent a not having a filter. (Though not every location supports such a "no filter" option.) On the PyRosetta level, this is represented by passing the None object.

The other thing I might recommend is to use the XML interface to initialize the mover. Often times the XML interface for mover setup is better tested than the direct code initialization. See https://github.com/RosettaCommons/pyrosettascripts_demo/blob/master/data_generation/ddG_pssm.ipynb for an example of how to use the XML interface. (You would just need to adjust the tags for the mover you're interested in initializing.)

Thu, 2019-05-09 15:56
rmoretti