How to use the pyranges.data.exons function in pyranges

To help you get started, we’ve selected a few pyranges 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 biocore-ntnu / pyranges / tests / test_stranded.py View on Github external
def test_stranded():
    cpg = pr.data.cpg()
    exons = pr.data.exons()

    j = cpg.join(exons)

    assert j.stranded

    j.Strand = "."

    assert not j.stranded

    j.Strand = np.random.choice("+ -".split(), size=len(j))

    assert j.stranded

    for _, df in j:
        assert len(df.Strand.drop_duplicates()) == 1
github biocore-ntnu / pyranges / tests / test_stranded.py View on Github external
def test_unstrand():

    exons = pr.data.exons()

    cpg = pr.data.cpg()
    print(exons)
    print(exons.columns)
    x = exons.unstrand()
    print(x.stranded)
    print(x)
    print(x.columns)
    for _, df in x:
        assert not df.index.duplicated().sum()

    # x = pr.PyRanges(x.df.reset_index(drop=True))
    cpg.join(x)
github biocore-ntnu / pyranges / tests / data / test_data.py View on Github external
def test_all_data():

    for f in [
            f1,
            f2,
            chipseq,
            chipseq_background,
            cpg,
            exons,
            aorta,
            aorta2,
            ensembl_gtf  #, control_bam
    ]:
        gr = f()
        print(gr)  # to avoid unused variable warning