Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# cogent.maths.stats.cai.util.cu.copy

All Samples(14)  |  Call(14)  |  Derive(0)  |  Import(0)

def test_cai_1(self):
"""cai_1 should produce expected results"""
ref_freqs = cu.copy()
ref_freqs.update({'AGA':4, 'AGG':2, 'CCC':4, 'CCA':1, 'UGG':1})
#tests with arithmetic mean
gene_freqs={'AGA':5,'CCA':5}
self.assertEqual(cai_1(ref_freqs, gene_freqs, average=arithmetic_mean), 0.625)
ref_freqs_2 = cu.copy()
ref_freqs_2.update({'AGA':4, 'AGG':2, 'CCC':5, 'CCA':1, 'UGG':1})
ref_freqs_2.update({'UUU':2,'UUC':1})
self.assertFloatEqual(cai_1(ref_freqs, gene_freqs, average=geometric_mean), \
(1**5 * 0.25**5)**0.1)
ref_freqs_2 = cu.copy()
ref_freqs_2.update({'AGA':4, 'AGG':2, 'CCC':5, 'CCA':1, 'UGG':1})
ref_freqs_2.update({'UUU':2,'UUC':1})
def test_cai_2(self):
"""cai_2 should produce expected results"""
ref_freqs = cu.copy()
ref_freqs.update({'AGA':4, 'AGG':2, 'CCC':5, 'CCA':1, 'UGG':1})
#tests with arithmetic mean
self.assertEqual(obs, expect)
#test that results match example on Gang Wu's CAI calculator page
ref_freqs = cu.copy()
ref_freqs.update({'UUU':78743, 'UUC':56591, 'UUA':51320, 'UUG':45581, \
'CUU':42704, 'CUC':35873, 'CUA':15275, 'CUG':168885})

def test_cai_1(self):
"""cai_1 should produce expected results"""
ref_freqs = cu.copy()
ref_freqs.update({'AGA':4, 'AGG':2, 'CCC':4, 'CCA':1, 'UGG':1})
#tests with arithmetic mean
gene_freqs={'AGA':5,'CCA':5}
self.assertEqual(cai_1(ref_freqs, gene_freqs, average=arithmetic_mean), 0.625)
ref_freqs_2 = cu.copy()
ref_freqs_2.update({'AGA':4, 'AGG':2, 'CCC':5, 'CCA':1, 'UGG':1})
ref_freqs_2.update({'UUU':2,'UUC':1})
self.assertFloatEqual(cai_1(ref_freqs, gene_freqs, average=geometric_mean), \
(1**5 * 0.25**5)**0.1)
ref_freqs_2 = cu.copy()
ref_freqs_2.update({'AGA':4, 'AGG':2, 'CCC':5, 'CCA':1, 'UGG':1})
ref_freqs_2.update({'UUU':2,'UUC':1})
def test_cai_2(self):
"""cai_2 should produce expected results"""
ref_freqs = cu.copy()
ref_freqs.update({'AGA':4, 'AGG':2, 'CCC':5, 'CCA':1, 'UGG':1})
#tests with arithmetic mean
self.assertEqual(obs, expect)
#test that results match example on Gang Wu's CAI calculator page
ref_freqs = cu.copy()
ref_freqs.update({'UUU':78743, 'UUC':56591, 'UUA':51320, 'UUG':45581, \
'CUU':42704, 'CUC':35873, 'CUA':15275, 'CUG':168885})