3d-dart/server/plugins/QueryPDB.py
def _BackboneTrace(self,chainid):
				
		"""Calculate same-strand C5' to C5' distance"""		
		
		print("    * Indentify segments for chain %s" % chainid)
		print "    * Calculating same-strand C5' to C5' distance to extract segments from structure. Segment indentified"
		print "      when C5'-C5' distance is larger than dynamic average + standard deviation + 1 = cutoff"
		print "      Distance  Residue  Residue+1  Cutoff"
		
		query = Xpath(self.pdbxml)
		query.Evaluate(query={1:{'element':'chain','attr':{'ID':chainid}},2:{'element':'resid','attr':None},3:{'element':'atom','attr':{'ID':"C5'"}}})
		
		for resid in query.nodeselection[2]:
		 	query.getAttr(node=resid,selection='nr',export='string')
		residues = query.result
		query.ClearResult()
		
		for atom in query.nodeselection[3]:
			query.getAttr(node=atom,selection=['corx','cory','corz'])
		atoms = query.result
		query.ClearResult()
		
		chain = []
		self.chainlib[chainid] = []
		for residue in range(len(residues)):
			try:
				distance = CalculateDistance(atoms[residue],atoms[residue+1])
				cutoff = self._CalcCutoff(distance)
				print("      %1.4f %6i %6i %15.4f" % (distance,(residues[residue]),(residues[residue+1]),cutoff)) 
				if distance < cutoff:
					chain.append(residues[residue])
				else:
					chain.append(residues[residue])
					self.chainlib[chainid].append(chain)
					self.cutoff = []
					chain = []
			except:
				chain.append(residues[residue])
				self.chainlib[chainid].append(chain)
			
		if len(self.chainlib[chainid]) == 0:
			print "    * ERROR: no segments indentified, stopping"
			sys.exit(0)
		else:
			print("    * Identified %i segment(s):" % len(self.chainlib[chainid]))	
			for chain in range(len(self.chainlib[chainid])):
				print("      Segment %i range: %i to %i" % (chain+1,min(self.chainlib[chainid][chain]),max(self.chainlib[chainid][chain])))
Calculate same-strand C5' to C5' distance
Calculate same-strand C5' to C5' distance
Calculate same - strand C5 ' to C5 ' distance
def _BackboneTrace(self,chainid):
		print("    * Indentify segments for chain %s" % chainid)
		print "    * Calculating same-strand C5' to C5' distance to extract segments from structure. Segment indentified"
		print "      when C5'-C5' distance is larger than dynamic average + standard deviation + 1 = cutoff"
		print "      Distance  Residue  Residue+1  Cutoff"
		query = Xpath(self.pdbxml)
		query.Evaluate(query={1:{'element':'chain','attr':{'ID':chainid}},2:{'element':'resid','attr':None},3:{'element':'atom','attr':{'ID':"C5'"}}})
		for resid in query.nodeselection[2]:
		 	query.getAttr(node=resid,selection='nr',export='string')
		residues = query.result
		query.ClearResult()
		for atom in query.nodeselection[3]:
			query.getAttr(node=atom,selection=['corx','cory','corz'])
		atoms = query.result
		query.ClearResult()
		chain = []
		self.chainlib[chainid] = []
		for residue in range(len(residues)):
			try:
				distance = CalculateDistance(atoms[residue],atoms[residue+1])
				cutoff = self._CalcCutoff(distance)
				print("      %1.4f %6i %6i %15.4f" % (distance,(residues[residue]),(residues[residue+1]),cutoff)) 
				if distance < cutoff:
					chain.append(residues[residue])
				else:
					chain.append(residues[residue])
					self.chainlib[chainid].append(chain)
					self.cutoff = []
					chain = []
			except:
				chain.append(residues[residue])
				self.chainlib[chainid].append(chain)
		if len(self.chainlib[chainid]) == 0:
			print "    * ERROR: no segments indentified, stopping"
			sys.exit(0)
		else:
			print("    * Identified %i segment(s):" % len(self.chainlib[chainid]))	
			for chain in range(len(self.chainlib[chainid])):
				print("      Segment %i range: %i to %i" % (chain+1,min(self.chainlib[chainid][chain]),max(self.chainlib[chainid][chain])))
def _BackboneTrace ( self , chainid ) : print ( "    * Indentify segments for chain %s" % chainid ) print "    * Calculating same-strand C5' to C5' distance to extract segments from structure. Segment indentified" print "      when C5'-C5' distance is larger than dynamic average + standard deviation + 1 = cutoff" print "      Distance  Residue  Residue+1  Cutoff" query = Xpath ( self . pdbxml ) query . Evaluate ( query = { 1 : { 'element' : 'chain' , 'attr' : { 'ID' : chainid } } , 2 : { 'element' : 'resid' , 'attr' : None } , 3 : { 'element' : 'atom' , 'attr' : { 'ID' : "C5'" } } } ) for resid in query . nodeselection [ 2 ] : query . getAttr ( node = resid , selection = 'nr' , export = 'string' ) residues = query . result query . ClearResult ( ) for atom in query . nodeselection [ 3 ] : query . getAttr ( node = atom , selection = [ 'corx' , 'cory' , 'corz' ] ) atoms = query . result query . ClearResult ( ) chain = [ ] self . chainlib [ chainid ] = [ ] for residue in range ( len ( residues ) ) : try : distance = CalculateDistance ( atoms [ residue ] , atoms [ residue + 1 ] ) cutoff = self . _CalcCutoff ( distance ) print ( "      %1.4f %6i %6i %15.4f" % ( distance , ( residues [ residue ] ) , ( residues [ residue + 1 ] ) , cutoff ) ) if distance < cutoff : chain . append ( residues [ residue ] ) else : chain . append ( residues [ residue ] ) self . chainlib [ chainid ] . append ( chain ) self . cutoff = [ ] chain = [ ] except : chain . append ( residues [ residue ] ) self . chainlib [ chainid ] . append ( chain ) if len ( self . chainlib [ chainid ] ) == 0 : print "    * ERROR: no segments indentified, stopping" sys . exit ( 0 ) else : print ( "    * Identified %i segment(s):" % len ( self . chainlib [ chainid ] ) ) for chain in range ( len ( self . chainlib [ chainid ] ) ) : print ( "      Segment %i range: %i to %i" % ( chain + 1 , min ( self . chainlib [ chainid ] [ chain ] ) , max ( self . chainlib [ chainid ] [ chain ] ) ) )
Calculate same-strand C5' to C5' distance
Calculate same - strand C5 ' to C5 ' distance
"""Calculate same-strand C5' to C5' distance"""
self
chainid