Did I find the right examples for you? yes no

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

src/c/o/cogent-1.5.3/tests/test_core/test_core_standalone.py   cogent(Download)
    def test_get_motifprobs(self):
        """calculation of motif probs"""
        seqs = {'seq1': 'ACGTANGT', 'seq2': '-CGTACGT', 'seq3': 'ACGTACGT'}
        aln = LoadSeqs(data = seqs, moltype=DNA)
        mprobs = aln.getMotifProbs(allow_gap=False)
        expected = {'A':5/22, 'T':6/22, 'C':5/22, 'G':6/22}
        self.assertEqual(mprobs, expected)
        mprobs = aln.getMotifProbs(allow_gap=True)
        expected = {'A':5/23, 'T':6/23, 'C':5/23, 'G':6/23, '-':1/23}
        self.assertEqual(mprobs, expected)
        mprobs = aln.getMotifProbs(allow_gap=False, include_ambiguity=True)
        expected = {'A':5.25/23, 'T':6.25/23, 'C':5.25/23, 'G':6.25/23}
        self.assertEqual(mprobs, expected)
        mprobs = aln.getMotifProbs(allow_gap=True, include_ambiguity=True)
        seqs = {'seq1': 'ACGAANGA', 'seq2': '-CGAACGA', 'seq3': 'ACGAACGA'}
        aln = LoadSeqs(data = seqs, moltype=DNA)
        mprobs = aln.getMotifProbs(exclude_unobserved=True)
        expected = {'A':11/22, 'C':5/22, 'G':6/22}
        self.assertEqual(mprobs, expected)

src/p/y/pycogent-HEAD/tests/test_core/test_core_standalone.py   pycogent(Download)
    def test_get_motifprobs(self):
        """calculation of motif probs"""
        seqs = {'seq1': 'ACGTANGT', 'seq2': '-CGTACGT', 'seq3': 'ACGTACGT'}
        aln = LoadSeqs(data = seqs, moltype=DNA)
        mprobs = aln.getMotifProbs(allow_gap=False)
        expected = {'A':5/22, 'T':6/22, 'C':5/22, 'G':6/22}
        self.assertEqual(mprobs, expected)
        mprobs = aln.getMotifProbs(allow_gap=True)
        expected = {'A':5/23, 'T':6/23, 'C':5/23, 'G':6/23, '-':1/23}
        self.assertEqual(mprobs, expected)
        mprobs = aln.getMotifProbs(allow_gap=False, include_ambiguity=True)
        expected = {'A':5.25/23, 'T':6.25/23, 'C':5.25/23, 'G':6.25/23}
        self.assertEqual(mprobs, expected)
        mprobs = aln.getMotifProbs(allow_gap=True, include_ambiguity=True)
        seqs = {'seq1': 'ACGAANGA', 'seq2': '-CGAACGA', 'seq3': 'ACGAACGA'}
        aln = LoadSeqs(data = seqs, moltype=DNA)
        mprobs = aln.getMotifProbs(exclude_unobserved=True)
        expected = {'A':11/22, 'C':5/22, 'G':6/22}
        self.assertEqual(mprobs, expected)