22 This is a PDB numbering based region class. Its primary purpose is to make dealing with regions/selections through the GUI and code more intuitive.
23 It will eventually replace the loop_string in loops_as_strings in the main GUIinput class.
24 Region is inclusive - Though, Lets think about this.
25 Might eventually make it's way into C++ Rosetta in a similar form.
28 def __init__(self, chain, start=None, end=None):
30 What you give determines the region_type.
31 Give only a chain, and the region is a chain.
32 Give chain and start, and the region is a C-Terminal tail
33 Give chain and end, and the region is a N-Terminal tail
34 These designations are mainly for cutpoint + Foldtree related things.
35 **Please use self.check_if_region_exists(pose) before using the region.
38 assert type(chain) == str
52 self.
region =
":"+repr(end)+
":"+chain.upper()
54 self.
region = repr(start)+
":"+
":"+chain.upper()
56 self.
region = repr(start)+
":"+repr(end)+
":"+chain.upper()
63 Checks if the region exists for the given Pose.
66 if not rosetta.core.pose.has_chain(self.
chain, pose):
67 print "Chain not found in PDB"
73 except PyRosettaException:
84 if not self.
loop:
return
90 movemap.set_bb(i,
True)
91 movemap.set_chi(i,
True)
96 Gets the region string.
102 Redundant. Gets region string.
108 Returns the loops string with full residue numbers instead of blank ::
138 for resnum
in range(1, pose.total_residue()+1):
139 chain = pose.pdb_info().
chain(resnum)
140 if chain == self.
chain:
145 return pose.pdb_info().pdb2pose(self.
chain, self.
start)
152 resnum = pose.total_residue()
154 chain = pose.pdb_info().
chain(resnum)
156 if chain == self.
chain:
162 return pose.pdb_info().pdb2pose(self.
chain, self.
end)
178 c = rosetta.core.pose.get_chain_id_from_chain(self.
chain, pose)
179 return pose.chain_sequence(c)
181 sequence = pose.sequence()
186 This class is analogous to the Loops class in Rosetta.
188 Like the Region class, may eventually be ported to C++.
198 loops = loops+
" "+str(region)
228 self.regions.append(region_object)
232 for region
in regions:
233 if region.get_region()==region_string:
234 self.regions.remove(region)
246 if region.get_region_type()==type:
247 regions.append(region)
252 if len(array_of_types)>1:
253 for type
in array_of_types:
255 if region.get_region_type()==type:
264 if region.get_chain()==chain:
265 regions.append(region)
281 Create a movemap where bb and sc are on from the regions in the region object.
287 for i
in range(1, pose.total_residue()+1):
288 movemap.set_bb(i,
True)
289 movemap.set_chi(i,
True)
292 if include_only_regions:
295 for region
in regions:
297 start = region.get_rosetta_start(pose)
298 end = region.get_rosetta_end(pose)
299 for i
in range(start, end+1):
300 movemap.set_bb(i,
True)
301 movemap.set_chi(i,
True)
306 Create a packer task for repacking.
310 packer_task.restrict_to_repacking()
314 packer_task.temporarily_fix_everything()
318 if include_only_regions:
321 for region
in regions:
324 start = region.get_rosetta_start(pose)
325 end = region.get_rosetta_end(pose)
326 print "Rosetta start: "+repr(start)
327 print "Rosetta end: "+repr(end)
328 for i
in range(start, end+1):
329 packer_task.temporarily_set_pack_residue(i,
True)
335 Returns a basic tf - no design, no neighbors. Only regions set.
339 tf.push_back(InitializeFromCommandline())
341 tf.push_back(RestrictToRepacking())
342 mmop = RestrictToMoveMapChiOperation(self.
get_movemap(pose))
349 Must have used set_Loop_for_region for the Region object to use.
354 loops.add_loop(region.get_loop())
Fstring::size_type len(Fstring const &s)
Length.