def test_shannon_entropy_dna(self):
        msa = TabularMSA([DNA('A'),
                          DNA('G')])
        actual = msa.conservation(metric='inverse_shannon_uncertainty')
        expected = np.array([1. - scipy.stats.entropy([0.5, 0.5], base=4)])
        npt.assert_array_equal(actual, expected)

        msa = TabularMSA([DNA('A'),
                          DNA('G'),
                          DNA('C'),
                          DNA('G')])
        actual = msa.conservation(metric='inverse_shannon_uncertainty')
        expected = np.array([1. - scipy.stats.entropy([0.5, 0.25, 0.25],
                                                      base=4)])
        npt.assert_array_equal(actual, expected)

        msa = TabularMSA([DNA('AAC'),
                          DNA('GAC')])
        actual = msa.conservation(metric='inverse_shannon_uncertainty')
        expected = np.array([1. - scipy.stats.entropy([0.5, 0.5], base=4),
                             1. - scipy.stats.entropy([1.0], base=4),
                             1. - scipy.stats.entropy([1.0], base=4)])
        npt.assert_array_equal(actual, expected)

        msa = TabularMSA([DNA('AACT'),
                          DNA('GACA')])
        actual = msa.conservation(metric='inverse_shannon_uncertainty')
        expected = np.array([1. - scipy.stats.entropy([0.5, 0.5], base=4),
                             scipy.stats.entropy([1.0], base=4) - 1.,
                             1. - scipy.stats.entropy([1.0], base=4),
                             1. - scipy.stats.entropy([0.5, 0.5], base=4)])
        npt.assert_array_equal(actual, expected)
dataset/ETHPy150Open biocore/scikit-bio/skbio/alignment/tests/test_tabular_msa.py/TestConservation.test_shannon_entropy_dna/swapped operands of `-`