Did I find the right examples for you? yes no

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

src/c/o/cogent-1.5.3/cogent/core/moltype.py   cogent(Download)
    AlphabetError, _make_complement_array
from cogent.util.misc import FunctionWrapper, add_lowercase, iterable, if_
from cogent.util.transform import allchars, keep_chars
from cogent.data.molecular_weight import DnaMW, RnaMW, ProteinMW
from cogent.core.sequence import Sequence as DefaultSequence, RnaSequence, \
        strict_gap = "".join(set(self.GapString) - set(self.Degenerates))
        self.stripDegenerate = FunctionWrapper(
            keep_chars(strict_gap+''.join(self.Alphabet)))
        self.stripBad = FunctionWrapper(keep_chars(''.join(self.All)))
        to_keep = set(self.Alphabet) ^ set(self.Degenerates) - set(self.Gaps)
        self.stripBadAndGaps = FunctionWrapper(keep_chars(''.join(to_keep)))

src/p/y/pycogent-HEAD/cogent/core/moltype.py   pycogent(Download)
    AlphabetError, _make_complement_array
from cogent.util.misc import FunctionWrapper, add_lowercase, iterable, if_
from cogent.util.transform import allchars, keep_chars
from cogent.data.molecular_weight import DnaMW, RnaMW, ProteinMW
from cogent.core.sequence import Sequence as DefaultSequence, RnaSequence, \
        strict_gap = "".join(set(self.GapString) - set(self.Degenerates))
        self.stripDegenerate = FunctionWrapper(
            keep_chars(strict_gap+''.join(self.Alphabet)))
        self.stripBad = FunctionWrapper(keep_chars(''.join(self.All)))
        to_keep = set(self.Alphabet) ^ set(self.Degenerates) - set(self.Gaps)
        self.stripBadAndGaps = FunctionWrapper(keep_chars(''.join(to_keep)))

src/c/o/cogent-1.5.3/cogent/core/sequence.py   cogent(Download)
from __future__ import division
from annotation import Map, Feature, _Annotatable
from cogent.util.transform import keep_chars, for_seq, per_shortest, \
    per_longest
from cogent.util.misc import DistanceFromMatrix

src/p/y/pycogent-HEAD/cogent/core/sequence.py   pycogent(Download)
from __future__ import division
from annotation import Map, Feature, _Annotatable
from cogent.util.transform import keep_chars, for_seq, per_shortest, \
    per_longest
from cogent.util.misc import DistanceFromMatrix

src/c/o/cogent-1.5.3/cogent/parse/stockholm.py   cogent(Download)
from cogent.core.info import Info
from cogent.struct.rna2d import WussStructure
from cogent.util.transform import trans_all,keep_chars
from cogent.core.alignment import Alignment, DataError, SequenceCollection
from collections import defaultdict

src/c/o/cogent-1.5.3/cogent/parse/rfam.py   cogent(Download)
from cogent.core.info import Info
from cogent.struct.rna2d import WussStructure
from cogent.util.transform import trans_all,keep_chars
from cogent.core.alignment import Alignment, DataError, SequenceCollection
 

src/p/y/pycogent-HEAD/cogent/parse/stockholm.py   pycogent(Download)
from cogent.core.info import Info
from cogent.struct.rna2d import WussStructure
from cogent.util.transform import trans_all,keep_chars
from cogent.core.alignment import Alignment, DataError, SequenceCollection
from collections import defaultdict

src/p/y/pycogent-HEAD/cogent/parse/rfam.py   pycogent(Download)
from cogent.core.info import Info
from cogent.struct.rna2d import WussStructure
from cogent.util.transform import trans_all,keep_chars
from cogent.core.alignment import Alignment, DataError, SequenceCollection
 

src/c/o/cogent-1.5.3/tests/test_util/test_transform.py   cogent(Download)
from cogent.util.unit_test import TestCase, main
from cogent.util.misc import identity
from cogent.util.transform import apply_each, bools, bool_each, \
    conjoin, all, both,\
    disjoin, any, either, negate, none, neither, compose, compose_many, \
    def test_keep_chars(self):
        """keep_chars returns a string containing only chars in keep"""
        f = keep_chars('ab c3*[')
        self.assertEqual(f(''),'') #empty
        self.assertRaises(AttributeError,f,None) #None
 
        # case insensitive
        f = keep_chars('AbC',False)
        self.assertEqual(f('abcdef'),'abc')
        self.assertEqual(f('ABCDEF'),'ABC')

src/p/y/pycogent-HEAD/tests/test_util/test_transform.py   pycogent(Download)
from cogent.util.unit_test import TestCase, main
from cogent.util.misc import identity
from cogent.util.transform import apply_each, bools, bool_each, \
    conjoin, all, both,\
    disjoin, any, either, negate, none, neither, compose, compose_many, \
    def test_keep_chars(self):
        """keep_chars returns a string containing only chars in keep"""
        f = keep_chars('ab c3*[')
        self.assertEqual(f(''),'') #empty
        self.assertRaises(AttributeError,f,None) #None
 
        # case insensitive
        f = keep_chars('AbC',False)
        self.assertEqual(f('abcdef'),'abc')
        self.assertEqual(f('ABCDEF'),'ABC')