Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
pr = BaseVariantMatcher._read_intervals(
intervals=intervals, interval_attrs=['gene_id'])
pr = BaseVariantMatcher._read_intervals(gtf_path=gtf_file)
assert pr.Chromosome.tolist() == ['chr1'] * 5
assert pr.Start.tolist() == [200, 200, 200, 1049, 3029]
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
pr = BaseVariantMatcher._read_intervals(bed_path=example_intervals_bed)
assert pr.Chromosome.tolist() == ['chr1'] * 4
assert pr.Start.tolist() == [2, 2, 2, 602]
assert pr.End.tolist() == [1000, 5000, 1002, 604]
# assert len(pr.intervals.tolist()) == 4
pr = BaseVariantMatcher._read_intervals(pranges=pranges)
assert pr.Chromosome.tolist() == ['chr1'] * 5
assert pr.Start.tolist() == [200, 200, 200, 1049, 3029]
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
pr = BaseVariantMatcher._read_intervals(intervals=intervals)
assert pr.df.Chromosome.tolist() == ['chr1', 'chr1']
assert pr.df.Start.tolist() == [1, 23]
assert pr.df.End.tolist() == [10, 30]
assert pr.df.Strand.tolist() == ['+', '-']
assert len(pr.intervals.tolist()) == 2
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
pr = BaseVariantMatcher._read_intervals(bed_path=example_intervals_bed)
assert pr.Chromosome.tolist() == ['chr1'] * 4
assert pr.Start.tolist() == [2, 2, 2, 602]
assert pr.End.tolist() == [1000, 5000, 1002, 604]
# assert len(pr.intervals.tolist()) == 4
pr = BaseVariantMatcher._read_intervals(pranges=pranges)
assert pr.Chromosome.tolist() == ['chr1'] * 5
assert pr.Start.tolist() == [200, 200, 200, 1049, 3029]
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
pr = BaseVariantMatcher._read_intervals(intervals=intervals)
assert pr.df.Chromosome.tolist() == ['chr1', 'chr1']
assert pr.df.Start.tolist() == [1, 23]
assert pr.df.End.tolist() == [10, 30]
assert pr.df.Strand.tolist() == ['+', '-']
assert len(pr.intervals.tolist()) == 2
def test_BaseVariantMatcher__read_intervals():
pranges = pyranges.read_gtf(gtf_file)
with pytest.raises(ValueError):
pr = BaseVariantMatcher._read_intervals(
pranges=pranges, gtf_path=gtf_file)
with pytest.raises(ValueError):
pr = BaseVariantMatcher._read_intervals(
intervals=intervals, interval_attrs=['gene_id'])
pr = BaseVariantMatcher._read_intervals(gtf_path=gtf_file)
assert pr.Chromosome.tolist() == ['chr1'] * 5
assert pr.Start.tolist() == [200, 200, 200, 1049, 3029]
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
pr = BaseVariantMatcher._read_intervals(bed_path=example_intervals_bed)
assert pr.Chromosome.tolist() == ['chr1'] * 4
assert pr.Start.tolist() == [2, 2, 2, 602]
assert pr.End.tolist() == [1000, 5000, 1002, 604]
# assert len(pr.intervals.tolist()) == 4
pr = BaseVariantMatcher._read_intervals(pranges=pranges)
assert pr.Chromosome.tolist() == ['chr1'] * 5
def test_BaseVariantMatcher__read_intervals():
pranges = pyranges.read_gtf(gtf_file)
with pytest.raises(ValueError):
pr = BaseVariantMatcher._read_intervals(
pranges=pranges, gtf_path=gtf_file)
with pytest.raises(ValueError):
pr = BaseVariantMatcher._read_intervals(
intervals=intervals, interval_attrs=['gene_id'])
pr = BaseVariantMatcher._read_intervals(gtf_path=gtf_file)
assert pr.Chromosome.tolist() == ['chr1'] * 5
assert pr.Start.tolist() == [200, 200, 200, 1049, 3029]
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
pr = BaseVariantMatcher._read_intervals(bed_path=example_intervals_bed)
assert pr.Chromosome.tolist() == ['chr1'] * 4
assert pr.Start.tolist() == [2, 2, 2, 602]
assert pr.End.tolist() == [1000, 5000, 1002, 604]
def test_BaseVariantMatcher__read_intervals():
pranges = pyranges.read_gtf(gtf_file)
with pytest.raises(ValueError):
pr = BaseVariantMatcher._read_intervals(
pranges=pranges, gtf_path=gtf_file)
with pytest.raises(ValueError):
pr = BaseVariantMatcher._read_intervals(
intervals=intervals, interval_attrs=['gene_id'])
pr = BaseVariantMatcher._read_intervals(gtf_path=gtf_file)
assert pr.Chromosome.tolist() == ['chr1'] * 5
assert pr.Start.tolist() == [200, 200, 200, 1049, 3029]
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
pr = BaseVariantMatcher._read_intervals(bed_path=example_intervals_bed)
assert pr.Chromosome.tolist() == ['chr1'] * 4
assert pr.Start.tolist() == [2, 2, 2, 602]
assert pr.End.tolist() == [1000, 5000, 1002, 604]
# assert len(pr.intervals.tolist()) == 4
pr = BaseVariantMatcher._read_intervals(pranges=pranges)
assert pr.Chromosome.tolist() == ['chr1'] * 5
assert pr.Start.tolist() == [200, 200, 200, 1049, 3029]
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
with pytest.raises(ValueError):
pr = BaseVariantMatcher._read_intervals(
pranges=pranges, gtf_path=gtf_file)
with pytest.raises(ValueError):
pr = BaseVariantMatcher._read_intervals(
intervals=intervals, interval_attrs=['gene_id'])
pr = BaseVariantMatcher._read_intervals(gtf_path=gtf_file)
assert pr.Chromosome.tolist() == ['chr1'] * 5
assert pr.Start.tolist() == [200, 200, 200, 1049, 3029]
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
pr = BaseVariantMatcher._read_intervals(bed_path=example_intervals_bed)
assert pr.Chromosome.tolist() == ['chr1'] * 4
assert pr.Start.tolist() == [2, 2, 2, 602]
assert pr.End.tolist() == [1000, 5000, 1002, 604]
# assert len(pr.intervals.tolist()) == 4
pr = BaseVariantMatcher._read_intervals(pranges=pranges)
assert pr.Chromosome.tolist() == ['chr1'] * 5
assert pr.Start.tolist() == [200, 200, 200, 1049, 3029]
assert pr.End.tolist() == [4230, 4230, 402, 1340, 4230]
# assert len(pr.intervals.tolist()) == 5
pr = BaseVariantMatcher._read_intervals(intervals=intervals)
assert pr.df.Chromosome.tolist() == ['chr1', 'chr1']
assert pr.df.Start.tolist() == [1, 23]
assert pr.df.End.tolist() == [10, 30]
assert pr.df.Strand.tolist() == ['+', '-']