Ejemplo n.º 1
0
def test_spectral():
    outfile = NamedTemporaryFile(suffix='.txt', delete=False)

    outfile.close()
    args = "--matrix {} --numberOfClusters {} --clusterMethod {} \
        --outFileName {} -t {}".format(ROOT + 'test_matrix.mcool', 3,
                                       'spectral', outfile.name, 1).split()
    scHicCluster.main(args)
    assert are_files_equal(ROOT + "scHicCluster/cluster_spectral.txt",
                           outfile.name)
Ejemplo n.º 2
0
def test_kmeans_chromosomes():
    outfile = NamedTemporaryFile(suffix='.txt', delete=False)

    outfile.close()
    args = "--matrix {} --numberOfClusters {} --clusterMethod {} \
        --outFileName {} -t {} --chromosomes {}".format(
        ROOT + 'test_matrix.mcool', 3, 'kmeans', outfile.name, 1,
        "chr1 chr2").split()
    scHicCluster.main(args)
    assert are_files_equal(
        ROOT + "scHicCluster/cluster_kmeans_chromosomes.txt", outfile.name)
Ejemplo n.º 3
0
def test_help():
    args = "--help".split()
    with pytest.raises(SystemExit) as pytest_wrapped_e:
        scHicCluster.main(args)
    assert pytest_wrapped_e.type == SystemExit
    assert pytest_wrapped_e.value.code == 0