Hi,
I would like to apply BackrubMover not to the whole protein as it is by default but the fragment of the protein (not contiguous in sequence). How can I specify this in PyRosetta?
Could you please write me the example command.
Thanks!!!
AOK
Post Situation:
The command line option to do this is -pivot_residues. http://www.rosettacommons.org/manuals/archive/rosetta3.4_user_guide/d1/d...
The BackrubMover class has a function set_pivot_residues which takes a vector1 containing the residue numbers at which you wish to allow sampling.
Thanks a lot. This is what I supposed but I had a problem with passing residue numbers to Vector1. Could you please write me explicitly how to do this.
I tried
backrubmover.set_pivot_residues(Vector1([2,3,4,5,6,7]))
but I got an error:
backrubmover.set_pivot_residues(Vector1([2,3,4,5,6,7]))
Boost.Python.ArgumentError: Python argument types in
BackrubMover.set_pivot_residues(BackrubMover, vector1_int)
did not match C++ signature:
set_pivot_residues(protocols::moves::BackrubMover {lvalue}, utility::vector1 > pivot_residues)
Thanks again for your help!
You can't construct a vector in C++ with arbitrary arguments that way, the way you make lists or tuples in python.
I don't know how C++ vector1s are explicitly constructed in python, but you can build them with push_back.
my_vector.push_back(2)
my_vector.push_back(3)
my_vector.push_back(4)
my_vector.push_back(5)
...
backrubmover.set_pivot_residues(my_vector)
I've asked someone else to comment on constructing empty templated C++ objects in python.
Regarding the the building vector1 in PyRosetta (http://www.pyrosetta.org/faq):
2. How do I construct Vector1 objects?
Vector1 is exposed in newer versions of PyRosetta and lives in rosetta.Vector1. Specific Vector1 objects live in rosetta.utility.vector1_(data type).
For example:
print rosetta.Vector1( [ 1 , 2 , 3 ] )
print rosetta.Vector1( [ 1.0 , 2.0 , 3.0 ] )
print rosetta.Vector1( [ True , False , True ] )
print rosetta.Vector1( [ 'a' , 'b' , 'c' ] )
v = rosetta.utility.vector1_SSize()
v.append( 1 )
print v
Thanks a lot for your help!!!
I am doing:
my_vector = rosetta.utility.vector1_Size()
my_vector.append(2)
my_vector.append(3)
...
backrubmover.set_pivot_residues(my_vector)
and it works.
Thanks!