Example #1
0
 def test_off_genotype_frequency_heterozygote_site(self):
     snp = SNP(chromosome='chr2', position=5000, genotype='GT', counts={'A': 3, 'C': 2, 'G': 25, 'T': 20})
     self.assertEqual(snp.off_genotype_frequency(), 0.1)
Example #2
0
 def test_off_genotype_frequency_at_non_genotyped_site_raises_exception(self):
     snp = SNP(chromosome='chr1', position=1000, genotype=None, counts={'A': 1, 'C': 2, 'G': 0, 'T': 1})
     with self.assertRaises(MissingGenotypeError):
         snp.off_genotype_frequency()
Example #3
0
 def test_off_genotype_frequency_homozygote_site(self):
     snp = SNP(chromosome='chr1', position=1000, genotype='AA', counts={'A': 95, 'C': 1, 'G': 3, 'T': 1})
     self.assertEqual(snp.off_genotype_frequency(), 0.05)