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)
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
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)
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)
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
def test___str(self, location): from outrigger.region import Region r = Region(location) true = 'outrigger.Region ({0})'.format(location) assert str(r) == true
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
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
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)
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
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
def test___len(self, location): from outrigger.region import Region r = Region(location) assert len(r) == 101
def test___init_start_larger_than_stop(self): from outrigger.region import Region Region('chr1:200-100:+')