예제 #1
0
	def recalc_design_pos(self):
		res = [Residue(x[1],x[0],self.obj) for x in getres(self.obj+" and chain A")]
		re2 = []
		#first,last = 0,-1
		c0,r0,cN,rN = None,None,None,None
		while r0 is None:
			try: 
				c0,r0 = getres('%s within 1.0 of (%s and name ca)'%(self.pid,res[0].sel()))[0]
			except IndexError:
				#first += 1
				res = res[1:]
		while rN is None:
			try: 
				cN,rN = getres('%s within 1.0 of (%s and name ca)'%(self.pid,res[-1].sel()))[0]
			except IndexError:
				#last -= 1
				res = res[:-1]
		assert c0 is not None and r0 is not None and cN is not None and rN is not None 
		assert c0==cN # and first < 10 and last > -10
		c = c0
		try:
			for j,i in enumerate(range(r0,rN+1)):
				r2 = Residue(i,c,self.pid)
				re2.append(r2)
		except IndexError:
			raise Exception("BAD NATIVE")
		self.muts = [DesignPos(r,r2) for r,r2 in zip(res,re2) if r.isdiffenent(r2)]
		for m in self.muts: m.manager = self.manager
		self.mutmap = {}
		for m in self.muts: self.mutmap[m.rdes.resi] = m
		for m in self.mutmap.values(): assert m in self.muts			
예제 #2
0
	def toprimary(self):
		cs = [x[0] for x in getres('sele')]
		if not cs or any([x!=cs[0] for x in cs]): return
		c = cs[0]
		if c == "B": rot("all",Vec(1,0,0),  72)
		if c == "C": rot("all",Vec(1,0,0), 144)
		if c == "D": rot("all",Vec(1,0,0),-144)
		if c == "E": rot("all",Vec(1,0,0), -72)
		r = getres('sele')[0][1]
		cmd.select("chain A and resi %i"%r)