Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Given a set of regions in a seq it returns the complementary ones

        def get_complementary_segments(segments, seq_len):
    'Given a set of regions in a seq it returns the complementary ones'
    non_matched = []
    for segment in get_all_segments(segments, seq_len):
        if not segment[1]:
            non_matched.append(segment[0])
    return non_matched
        


src/s/e/seq_crumbs-HEAD/test/test_segment_utils.py   seq_crumbs(Download)
import unittest
 
from crumbs.utils.segments_utils import (get_longest_segment, get_all_segments,
                                         get_complementary_segments,
                                         get_longest_complementary_segment)
    def test_non_matched():
        'Given a list of segments we get the complementary matches'
        segments = get_complementary_segments([(0, 10), (15, 20)], 30)
        assert segments == [(11, 14), (21, 29)]