示例#1
0
	def normalizePeptideRatios(self, norm_prot, target_log_mean=0.0):
		# DAD: implement
		target_peps = [self.peptide_data[k] for k in peptide_keys]
		acc = stats.LogAccumulator(store=False)
		for p in target_peps:
			acc.addAll([r for r in p.ratios])
		mean = acc.mean
		sd = acc.sd
		log_mean = math.log(mean)
		for p_key in self.peptide_data.keys():
			p = self.peptide_data[p_key]
			ratlist = p.heavy_light_ratio_list
			for xi in range(len(ratlist)):
				#ratlist[xi] = math.exp((math.log(ratlist[xi]) - (log_mean - target_log_mean))/(log_sd/target_log_sd))
				try:
					norm_log_ratio = (math.log(ratlist[xi]) - (log_mean - target_log_mean))/(log_sd/target_log_sd)
					ratlist[xi] = math.exp(norm_log_ratio)
				except OverflowError:
					print "overflow! --", p_key, xi, ratlist[xi], math.log(ratlist[xi]), norm_log_ratio
		return
示例#2
0
	def getNormalizedHeavyMediumRatioSummary(self):
		acc = stats.LogAccumulator(store=True)
		acc.addAll(self.heavy_medium_normalized_ratio_list)
		return acc.summary
示例#3
0
	def getNormalizedMediumLightRatioSummary(self):
		acc = stats.LogAccumulator(store=True)
		acc.addAll(self.medium_light_normalized_ratio_list)
		return acc.summary
示例#4
0
	def getHeavyLightRatioSummary(self):
		acc = stats.LogAccumulator(store=True)
		for pep in self.peptides:
			acc.addAll(pep.heavy_light_ratio_list)
		s = acc.summary
		return s
示例#5
0
	def getIntensityRatioSummary(self, ratio_string):
		acc = stats.LogAccumulator(store=True)
		acc.addAll(self.getIntensityRatios(ratio_string))
		return acc.summary
示例#6
0
	def getNormalizedHeavyLightRatioSummary(self):
		acc = stats.LogAccumulator(store=True)
		for pep in self.peptide_dict.values():
			acc.addAll(pep.heavy_light_normalized_ratio_list)
		return acc.summary
示例#7
0
	def getHeavyLightRatioSummary(self):
		acc = stats.LogAccumulator(store=True)
		acc.addAll(self.heavy_light_ratio_list)
		return acc.summary
示例#8
0
	def getMediumLightRatioSummary(self):
		acc = stats.LogAccumulator(store=True)
		for pep in self.peptides:
			acc.addAll(pep.medium_light_ratio_list)
		return acc.summary
示例#9
0
	def getHeavyMediumRatioSummary(self):
		acc = stats.LogAccumulator(store=True)
		for pep in self.peptides:
			acc.addAll(pep.heavy_medium_ratio_list)
		return acc.summary
示例#10
0
	def getIntensityRatioSummary(self, ratio_string):
		acc = stats.LogAccumulator(store=True)
		for pep in self.peptides:
			acc.addAll(pep.getIntensityRatios(ratio_string))
		return acc.summary