Ghost/Chemical_shift.py
def distance(self,exper_CS):
		'''This function finds the NRMSD between calculated and experimental curves'''
		
		
		distance={}
		ultimate_distance={}
		ultimate_diel={}
		residues=exper_CS.keys()
		residues.sort()
		for residue in residues:
			exper=self.preprocess(exper_CS[residue])
			maximum=max(exper)
			distance[residue]={}
			diel=self.diel_low
			while diel <= self.diel_high:
				delta=self.preprocess(self.delta_CS[residue][diel])
				dist=0.00
				for ph in range(len(self.ph_values)):
					dist+=(delta[ph]-exper[ph])**2
				distance[residue][diel]=sqrt(dist/len(self.ph_values))/maximum
				diel+=self.diel_increment
			
			ultimate_distance[residue]=min(distance[residue].values())
			diel=diel=self.diel_low
			while diel <= self.diel_high:
			#for diel in range(self.diel_low, self.diel_high+self.diel_increment, self.diel_increment):#
				if ultimate_distance[residue]==distance[residue][diel]:
					ultimate_diel[residue]=diel
					break
				else:
					diel+=self.diel_increment
		self.distance=distance
		self.ultimate_distance=ultimate_distance
		self.ultimate_diel=ultimate_diel
This function finds the NRMSD between calculated and experimental curves
This function finds the NRMSD between calculated and experimental curves
This function finds the NRMSD between calculated and experimental curves
def distance(self,exper_CS):
		distance={}
		ultimate_distance={}
		ultimate_diel={}
		residues=exper_CS.keys()
		residues.sort()
		for residue in residues:
			exper=self.preprocess(exper_CS[residue])
			maximum=max(exper)
			distance[residue]={}
			diel=self.diel_low
			while diel <= self.diel_high:
				delta=self.preprocess(self.delta_CS[residue][diel])
				dist=0.00
				for ph in range(len(self.ph_values)):
					dist+=(delta[ph]-exper[ph])**2
				distance[residue][diel]=sqrt(dist/len(self.ph_values))/maximum
				diel+=self.diel_increment
			ultimate_distance[residue]=min(distance[residue].values())
			diel=diel=self.diel_low
			while diel <= self.diel_high:
				if ultimate_distance[residue]==distance[residue][diel]:
					ultimate_diel[residue]=diel
					break
				else:
					diel+=self.diel_increment
		self.distance=distance
		self.ultimate_distance=ultimate_distance
		self.ultimate_diel=ultimate_diel
def distance ( self , exper_CS ) : distance = { } ultimate_distance = { } ultimate_diel = { } residues = exper_CS . keys ( ) residues . sort ( ) for residue in residues : exper = self . preprocess ( exper_CS [ residue ] ) maximum = max ( exper ) distance [ residue ] = { } diel = self . diel_low while diel <= self . diel_high : delta = self . preprocess ( self . delta_CS [ residue ] [ diel ] ) dist = 0.00 for ph in range ( len ( self . ph_values ) ) : dist += ( delta [ ph ] - exper [ ph ] ) ** 2 distance [ residue ] [ diel ] = sqrt ( dist / len ( self . ph_values ) ) / maximum diel += self . diel_increment ultimate_distance [ residue ] = min ( distance [ residue ] . values ( ) ) diel = diel = self . diel_low while diel <= self . diel_high : if ultimate_distance [ residue ] == distance [ residue ] [ diel ] : ultimate_diel [ residue ] = diel break else : diel += self . diel_increment self . distance = distance self . ultimate_distance = ultimate_distance self . ultimate_diel = ultimate_diel
This function finds the NRMSD between calculated and experimental curves
This function finds the NRMSD between calculated and experimental curves
'''This function finds the NRMSD between calculated and experimental curves''' #for diel in range(self.diel_low, self.diel_high+self.diel_increment, self.diel_increment):#
self
exper_CS