def test_subset_Pos_working(self): res = BedFileParser.search_position(self.df, chrom="chr1", start=1, end=2500) expected = pd.DataFrame(columns=["chrom", "start", "end", "name", "strand"], data=[["1", 3, 2442, "genex", "-"]]) if res.equals(expected): self.assertTrue("Positional subset working") else: self.assertFalse("Positional subset working")
def test_subset_Chr_working(self): res = BedFileParser.search_position(self.df, chrom="chr1") expected = pd.DataFrame(columns=["chrom", "start", "end", "name", "strand"], data=[["1", 1, 2999, "gene1", "+"], ["1", 3, 2442, "genex", "-"]]) if res.equals(expected): self.assertTrue("Chromosome subset working") else: self.assertFalse("Chromosome subset not working")
def test_subset_coord(self): self.assertRaises(BedFileParser.IncorrectCoord, lambda: BedFileParser.search_position(self.df, chrom="chr1", start=3000, end=1))
def test_subset_chr(self): self.assertRaises(BedFileParser.IncorrectChr, lambda: BedFileParser.search_position(self.df, chrom="1"))