Beispiel #1
0
	def _accumulateCodonFrequencies(self, seq, codon_freq, nucleotide_freq):
		codons = cai.split(seq)
		for codon in codons:
			try:
				codon_freq[codon]+=1.0
			except KeyError,ke:
				pass
Beispiel #2
0
def getSYN(seq, syn_scores):
	scores = []
	for to_codon in cai.split(seq):
		try:
			scores.append(syn_scores[to_codon])
		except KeyError:
			continue
	if len(scores) > 0:
		res = sum(scores)/len(scores)
	else:
		res = None
	return res
Beispiel #3
0
	def getSYangNielsen(self, seq):
		scores = [self.codon_syn_scores[to_codon] for to_codon in cai.split(seq)]
		return sum(scores)/len(scores)