Did I find the right examples for you? yes no

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

src/c/o/cogent-1.5.3/tests/test_struct/test_pairs_util.py   cogent(Download)
from cogent.core.alphabet import CharAlphabet
from cogent.struct.rna2d import Pairs
from cogent.struct.pairs_util import PairsAdjustmentError,\
    adjust_base, adjust_base_structures, adjust_pairs_from_mapping,\
    delete_gaps_from_pairs, insert_gaps_in_pairs, gapped_to_ungapped,\
    def test_all_metrics(self):
        """all_metrics: check against compare_ct.pm"""
        exp = {'SENSITIVITY':0.4, 'SELECTIVITY':0.5, 'AC':0.45,\
            'CC':0.42906394, 'MCC':0.42906394}
        obs = all_metrics(self.true, self.predicted, seqs=self.seq, min_dist=4)
        exp = {'SENSITIVITY':0.6666667, 'SELECTIVITY':0.6666667,\
            'AC':0.6666667, 'CC':0.57575758, 'MCC':0.57575758}
        obs = all_metrics(ref, pred, seqs=[seq], min_dist=4)
        self.assertEqualItems(obs.keys(), exp.keys())
        for k in exp:
        pred = Pairs()
        seqs = ['UACGUAGCUAGCUAGCUACG']
        obs = all_metrics(ref, pred, seqs=[seqs], min_dist=4)
        exp = {'SENSITIVITY':0, 'SELECTIVITY':0,\
            'AC':0, 'CC':0, 'MCC':0}
        pred = Pairs()
        seqs = ['UACGUAGCUAGCUAGCUACG']
        obs = all_metrics(ref, pred, seqs=[seqs], min_dist=4)
        exp = {'SENSITIVITY':1, 'SELECTIVITY':1,\
            'AC':1, 'CC':1, 'MCC':1}

src/p/y/pycogent-HEAD/tests/test_struct/test_pairs_util.py   pycogent(Download)
from cogent.core.alphabet import CharAlphabet
from cogent.struct.rna2d import Pairs
from cogent.struct.pairs_util import PairsAdjustmentError,\
    adjust_base, adjust_base_structures, adjust_pairs_from_mapping,\
    delete_gaps_from_pairs, insert_gaps_in_pairs, gapped_to_ungapped,\
    def test_all_metrics(self):
        """all_metrics: check against compare_ct.pm"""
        exp = {'SENSITIVITY':0.4, 'SELECTIVITY':0.5, 'AC':0.45,\
            'CC':0.42906394, 'MCC':0.42906394}
        obs = all_metrics(self.true, self.predicted, seqs=self.seq, min_dist=4)
        exp = {'SENSITIVITY':0.6666667, 'SELECTIVITY':0.6666667,\
            'AC':0.6666667, 'CC':0.57575758, 'MCC':0.57575758}
        obs = all_metrics(ref, pred, seqs=[seq], min_dist=4)
        self.assertEqualItems(obs.keys(), exp.keys())
        for k in exp:
        pred = Pairs()
        seqs = ['UACGUAGCUAGCUAGCUACG']
        obs = all_metrics(ref, pred, seqs=[seqs], min_dist=4)
        exp = {'SENSITIVITY':0, 'SELECTIVITY':0,\
            'AC':0, 'CC':0, 'MCC':0}
        pred = Pairs()
        seqs = ['UACGUAGCUAGCUAGCUACG']
        obs = all_metrics(ref, pred, seqs=[seqs], min_dist=4)
        exp = {'SENSITIVITY':1, 'SELECTIVITY':1,\
            'AC':1, 'CC':1, 'MCC':1}