Did I find the right examples for you? yes no

All Samples(22)  |  Call(20)  |  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_gapped_to_ungapped_simple(self):
        """gapped_to_ungapped: should work for simple case"""
        s = RnaSequence(self.gapped)
        p = self.simple_g
        obs_seq, obs_pairs = gapped_to_ungapped(s,p)
        s = RnaSequence(self.gapped)
        p = Pairs(self.out_order_g)
        obs_seq, obs_pairs = gapped_to_ungapped(s,p)
        self.assertEqual(obs_seq, self.ungapped)
        self.assertEqualItems(obs_pairs, self.out_order)
        s = RnaSequence(self.gapped)
        p = Pairs(self.duplicates_g)
        obs_seq, obs_pairs = gapped_to_ungapped(s,p)
        self.assertEqual(obs_seq, self.ungapped)
        self.assertEqualItems(obs_pairs, self.duplicates)
        s = RnaSequence(self.gapped)
        p = Pairs(self.pseudo_g)
        obs_seq, obs_pairs = gapped_to_ungapped(s,p)
        self.assertEqual(obs_seq, self.ungapped)
        self.assertEqualItems(obs_pairs, self.pseudo)

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_gapped_to_ungapped_simple(self):
        """gapped_to_ungapped: should work for simple case"""
        s = RnaSequence(self.gapped)
        p = self.simple_g
        obs_seq, obs_pairs = gapped_to_ungapped(s,p)
        s = RnaSequence(self.gapped)
        p = Pairs(self.out_order_g)
        obs_seq, obs_pairs = gapped_to_ungapped(s,p)
        self.assertEqual(obs_seq, self.ungapped)
        self.assertEqualItems(obs_pairs, self.out_order)
        s = RnaSequence(self.gapped)
        p = Pairs(self.duplicates_g)
        obs_seq, obs_pairs = gapped_to_ungapped(s,p)
        self.assertEqual(obs_seq, self.ungapped)
        self.assertEqualItems(obs_pairs, self.duplicates)
        s = RnaSequence(self.gapped)
        p = Pairs(self.pseudo_g)
        obs_seq, obs_pairs = gapped_to_ungapped(s,p)
        self.assertEqual(obs_seq, self.ungapped)
        self.assertEqualItems(obs_pairs, self.pseudo)