def test_bigwigCompare():
    outfile = "/tmp/result.bg"
    args = "-b1 {} -b2 {} -o {} --ratio add --outFileFormat bedgraph".format(BIGWIG_A, BIGWIG_B, outfile).split()
    bwComp.main(args)
    resp = open(outfile, "r").readlines()
    expected = ["3R\t0\t50\t0.00\n", "3R\t50\t100\t1.00\n", "3R\t100\t150\t2.00\n", "3R\t150\t200\t3.0\n"]
    assert resp == expected, "{} != {}".format(resp, expected)
    unlink(outfile)
def test_bigwigCompare_skipnas():
    outfile = '/tmp/result.bg'
    args = "-b1 {} -b2 {} -o {} --ratio add --skipNAs " \
           "--outFileFormat bedgraph".format(BIGWIG_A, BIGWIG_B, outfile).split()
    bwComp.main(args)
    resp = open(outfile, 'r').readlines()
    expected = ['3R\t100\t150\t2.00\n', '3R\t150\t200\t3.0\n']
    assert resp == expected, "{} != {}".format(resp, expected)
    unlink(outfile)
def test_bigwigCompare():
    outfile = '/tmp/result.bg'
    args = "-b1 {} -b2 {} -o {} --ratio add --outFileFormat bedgraph".format(BIGWIG_A, BIGWIG_B, outfile).split()
    bwComp.main(args)
    _foo = open(outfile, 'r')
    resp = _foo.readlines()
    _foo.close()
    expected = ['3R\t0\t50\t0\n', '3R\t50\t100\t1\n', '3R\t100\t150\t2\n', '3R\t150\t200\t3\n']
    assert resp == expected, "{} != {}".format(resp, expected)
    unlink(outfile)
def test_bigwigCompare_skipZeroOverZero():
    outfile = '/tmp/result.bg"'
    args = "-b1 {} -b2 {} -o {} --skipZeroOverZero --pseudocount 1 3 --outFileFormat bedgraph".format(BIGWIG_A, BIGWIG_A, outfile).split()
    bwComp.main(args)
    _foo = open(outfile, 'r')
    resp = _foo.readlines()
    _foo.close()
    expected = ['3R\t100\t200\t-1\n']
    assert resp == expected, "{} != {}".format(resp, expected)
    unlink(outfile)
def test_bigwigCompare_skipZeroOverZero():
    outfile = '/tmp/result.bg"'
    args = "-b1 {} -b2 {} -o {} --skipZeroOverZero --pseudocount 1 3 --outFileFormat bedgraph".format(
        BIGWIG_A, BIGWIG_A, outfile).split()
    bwComp.main(args)
    _foo = open(outfile, 'r')
    resp = _foo.readlines()
    _foo.close()
    expected = ['3R\t100\t200\t-1\n']
    assert resp == expected, "{} != {}".format(resp, expected)
    unlink(outfile)
def test_bigwigCompare():
    outfile = '/tmp/result.bg'
    args = "-b1 {} -b2 {} -o {} --operation add --outFileFormat bedgraph".format(
        BIGWIG_A, BIGWIG_B, outfile).split()
    bwComp.main(args)
    _foo = open(outfile, 'r')
    resp = _foo.readlines()
    _foo.close()
    expected = [
        '3R\t0\t50\t0\n', '3R\t50\t100\t1\n', '3R\t100\t150\t2\n',
        '3R\t150\t200\t3\n'
    ]
    assert resp == expected, "{} != {}".format(resp, expected)
    unlink(outfile)