How to use the pyranges.data.chipseq 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_unary.py View on Github external
@settings(
    max_examples=max_examples,
    deadline=deadline,
    suppress_health_check=HealthCheck.all())
@given(gr=df_data())  # pylint: disable=no-value-for-parameter
def test_init(gr, strand):

    c, s, e, strands = gr

    if strand:
        pr.PyRanges(chromosomes=c, starts=s, ends=e, strands=strands)
    else:
        pr.PyRanges(chromosomes=c, starts=s, ends=e)


chipseq = pr.data.chipseq()


@settings(
    max_examples=max_examples,
    deadline=deadline,
    suppress_health_check=HealthCheck.all())
@given(selector=selector())  # pylint: disable=no-value-for-parameter
def test_getitem(selector):

    # have these weird returns to avoid being flagged as unused code
    if len(selector) == 3:
        a, b, c = selector
        return chipseq[a, b, c]
    elif len(selector) == 2:
        a, b = selector
        return chipseq[a, b]
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
github biocore-ntnu / pyranges / pyranges / tostring2.py View on Github external
middle = int(n / 2)
        df.loc[middle, :] = "..."

    str_repr, hidden_columns = grow_string_representation(df, columns_dtypes)

    str_repr = add_text_to_str_repr(self, str_repr, hidden_columns, sort)

    return str_repr


if __name__ == "__main__":

    from pyranges.tostring2 import _get_stranded_f, _get_unstranded_f
    from pyranges.tostring2 import tostring
    import pyranges as pr
    gr = pr.data.chipseq()
    df = gr.df
    _get_stranded_f(gr, 2, "head")
    _get_unstranded_f(gr.unstrand(), 6, "tail")

    tostring(gr)