Пример #1
0
    def test___neq(self, location_with_region_name, location):
        from outrigger.region import Region

        r1 = Region(location_with_region_name)
        r2 = Region(location)

        assert r1.__neq__(r2)
Пример #2
0
    def test___eq(self, location_with_region_name):
        from outrigger.region import Region

        r1 = Region(location_with_region_name)
        r2 = Region(location_with_region_name)

        assert r1 == r2
Пример #3
0
    def test___neq(self, location_with_region_name, location):
        from outrigger.region import Region

        r1 = Region(location_with_region_name)
        r2 = Region(location)

        assert r1.__neq__(r2)
Пример #4
0
    def test_overlaps_false_different_chrom(self, location):
        from outrigger.region import Region

        r1 = Region(location)
        r2 = Region('chr2:400-500:-')

        assert not r1.overlaps(r2)
        assert not r2.overlaps(r1)
Пример #5
0
    def test_overlaps_true(self, location_with_region_name, location):
        from outrigger.region import Region

        r1 = Region(location_with_region_name)
        r2 = Region(location)

        assert r1.overlaps(r2)
        assert r2.overlaps(r1)
Пример #6
0
    def test___str_with_region_name(self, location_with_region_name):
        from outrigger.region import Region

        r = Region(location_with_region_name)

        true = 'outrigger.Region ({0})'.format(location_with_region_name)
        assert str(r) == true
Пример #7
0
    def test___str(self, location):
        from outrigger.region import Region

        r = Region(location)

        true = 'outrigger.Region ({0})'.format(location)
        assert str(r) == true
Пример #8
0
    def test__stop(self, location):
        from outrigger.region import Region

        r = Region(location)

        true__stop = -r.stop if r.strand == '-' else r.stop
        assert r._stop == true__stop
Пример #9
0
    def test___init_region_name(self, location_with_region_name):
        from outrigger.region import Region

        r = Region(location_with_region_name)
        assert r.region == 'junction'
        assert r.chrom == 'chr1'
        assert r.start == 100
        assert r.stop == 200
        assert r.strand == '+'
        assert r.name == location_with_region_name
Пример #10
0
    def _get_junction23(row):
        """Make incompatible junction between exons2 and 3 for MXE

        Parameters
        ----------
        row : pandas.Series
            A row containing "junction13" and "junction24" names in the index,
            which contain outrigger.Region values
        """
        junction13 = row['junction13']
        junction24 = row['junction24']
        if junction13.strand == "+":
            return Region(region='junction', chrom=junction13.chrom,
                          start=junction24.start, stop=junction13.stop,
                          strand=junction13.strand)
        if junction13.strand == "-":
            return Region(region='junction', chrom=junction13.chrom,
                          start=junction13.start, stop=junction24.stop,
                          strand=junction13.strand)
Пример #11
0
    def test___init(self, location):
        from outrigger.region import Region

        r = Region(location)

        assert r.region is None
        assert r.chrom == 'chr1'
        assert r.start == 100
        assert r.stop == 200
        assert r.strand == location[-1]
        assert r.name == location
Пример #12
0
    def test_overlaps_false_different_chrom(self, location):
        from outrigger.region import Region

        r1 = Region(location)
        r2 = Region('chr2:400-500:-')

        assert not r1.overlaps(r2)
        assert not r2.overlaps(r1)
Пример #13
0
    def test_overlaps_true(self, location_with_region_name, location):
        from outrigger.region import Region

        r1 = Region(location_with_region_name)
        r2 = Region(location)

        assert r1.overlaps(r2)
        assert r2.overlaps(r1)
Пример #14
0
    def test___eq_not_region(self, location_with_region_name):
        from outrigger.region import Region

        r1 = Region(location_with_region_name)

        assert not r1 == location_with_region_name
Пример #15
0
    def test___len(self, location):
        from outrigger.region import Region

        r = Region(location)

        assert len(r) == 101
Пример #16
0
    def test___init_start_larger_than_stop(self):
        from outrigger.region import Region

        Region('chr1:200-100:+')