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_slidingWindows(self):          
        """test slicing of sequences"""      
        alignment = LoadSeqs(data = {'seq1': 'ACGTACGT', 'seq2': 'ACGTACGT', 'seq3': 'ACGTACGT'})
        result = []
        for bit in alignment.slidingWindows(5,2):
        # specify a starting window position
        result = []
        for bit in alignment.slidingWindows(5,2, start=1):
            result+=[bit]
        self.assertEqual(result[0].todict(), {'seq3': 'CGTAC', 'seq2': 'CGTAC', 'seq1': 'CGTAC'})
        self.assertEqual(result[1].todict(), {'seq3': 'TACGT', 'seq2': 'TACGT', 'seq1': 'TACGT'})
 
        # specify a ending window position
        result = []
        for bit in alignment.slidingWindows(5, 1, start=1, end=3):
        # specify a ending window position
        result = []
        for bit in alignment.slidingWindows(5, 1, start=5):
            result+=[bit]
        self.assertEqual(result, [])
 
        result = []
        for bit in alignment.slidingWindows(5,1):

src/p/y/pycogent-HEAD/tests/test_core/test_core_standalone.py   pycogent(Download)
    def test_slidingWindows(self):          
        """test slicing of sequences"""      
        alignment = LoadSeqs(data = {'seq1': 'ACGTACGT', 'seq2': 'ACGTACGT', 'seq3': 'ACGTACGT'})
        result = []
        for bit in alignment.slidingWindows(5,2):
        # specify a starting window position
        result = []
        for bit in alignment.slidingWindows(5,2, start=1):
            result+=[bit]
        self.assertEqual(result[0].todict(), {'seq3': 'CGTAC', 'seq2': 'CGTAC', 'seq1': 'CGTAC'})
        self.assertEqual(result[1].todict(), {'seq3': 'TACGT', 'seq2': 'TACGT', 'seq1': 'TACGT'})
 
        # specify a ending window position
        result = []
        for bit in alignment.slidingWindows(5, 1, start=1, end=3):
        # specify a ending window position
        result = []
        for bit in alignment.slidingWindows(5, 1, start=5):
            result+=[bit]
        self.assertEqual(result, [])
 
        result = []
        for bit in alignment.slidingWindows(5,1):