How to use the bioframe.select function in bioframe

To help you get started, we’ve selected a few bioframe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mirnylab / bioframe / tests / test_ops.py View on Github external
def test_select():
    df1 = pd.DataFrame(
        [["chrX", 3, 8], ["chr1", 4, 5], ["chrX", 1, 5]],
        columns=["chrom", "start", "end"],
    )

    region1 = "chr1:4-10"
    df_result = pd.DataFrame([["chr1", 4, 5]], columns=["chrom", "start", "end"])
    pd.testing.assert_frame_equal(
        df_result, bioframe.select(df1, region1).reset_index(drop=True)
    )

    region1 = "chrX"
    df_result = pd.DataFrame(
        [["chrX", 3, 8], ["chrX", 1, 5]], columns=["chrom", "start", "end"]
    )
    pd.testing.assert_frame_equal(
        df_result, bioframe.select(df1, region1).reset_index(drop=True)
    )

    region1 = "chrX:4-6"
    df_result = pd.DataFrame(
        [["chrX", 3, 8], ["chrX", 1, 5]], columns=["chrom", "start", "end"]
    )
    pd.testing.assert_frame_equal(
        df_result, bioframe.select(df1, region1).reset_index(drop=True)
github mirnylab / bioframe / tests / test_ops.py View on Github external
)

    region1 = "chrX"
    df_result = pd.DataFrame(
        [["chrX", 3, 8], ["chrX", 1, 5]], columns=["chrom", "start", "end"]
    )
    pd.testing.assert_frame_equal(
        df_result, bioframe.select(df1, region1).reset_index(drop=True)
    )

    region1 = "chrX:4-6"
    df_result = pd.DataFrame(
        [["chrX", 3, 8], ["chrX", 1, 5]], columns=["chrom", "start", "end"]
    )
    pd.testing.assert_frame_equal(
        df_result, bioframe.select(df1, region1).reset_index(drop=True)
    )
github mirnylab / bioframe / tests / test_ops.py View on Github external
[["chrX", 3, 8], ["chr1", 4, 5], ["chrX", 1, 5]],
        columns=["chrom", "start", "end"],
    )

    region1 = "chr1:4-10"
    df_result = pd.DataFrame([["chr1", 4, 5]], columns=["chrom", "start", "end"])
    pd.testing.assert_frame_equal(
        df_result, bioframe.select(df1, region1).reset_index(drop=True)
    )

    region1 = "chrX"
    df_result = pd.DataFrame(
        [["chrX", 3, 8], ["chrX", 1, 5]], columns=["chrom", "start", "end"]
    )
    pd.testing.assert_frame_equal(
        df_result, bioframe.select(df1, region1).reset_index(drop=True)
    )

    region1 = "chrX:4-6"
    df_result = pd.DataFrame(
        [["chrX", 3, 8], ["chrX", 1, 5]], columns=["chrom", "start", "end"]
    )
    pd.testing.assert_frame_equal(
        df_result, bioframe.select(df1, region1).reset_index(drop=True)
    )