예제 #1
0
def test_sample_idx_wrong_length():
    with assert_raises_message(
            ValueError,
            "sample_idx (10) must be the same length as data ({})".format(
                data.shape[0]),
    ):
        build_graph(data, graphtype="mnn", sample_idx=np.arange(10))
예제 #2
0
def test_sample_idx_and_precomputed():
    build_graph(
        squareform(pdist(data)),
        n_pca=None,
        sample_idx=np.arange(10),
        precomputed="distance",
        decay=10,
    )
예제 #3
0
def test_sample_idx_and_precomputed():
    with assert_raises_message(
            ValueError,
            "MNNGraph does not support precomputed values. Use `graphtype='exact'` and `sample_idx=None` or `precomputed=None`",
    ):
        build_graph(data,
                    n_pca=None,
                    sample_idx=np.arange(10),
                    precomputed="distance")
예제 #4
0
def test_build_exact_with_sample_idx():
    with assert_raises_message(
            ValueError,
            "TraditionalGraph does not support batch correction. Use `graphtype='mnn'` or `sample_idx=None`",
    ):
        build_graph(data,
                    graphtype="exact",
                    sample_idx=np.arange(len(data)),
                    decay=10)
예제 #5
0
def test_sample_idx_wrong_length():
    build_graph(data, graphtype="mnn", sample_idx=np.arange(10))
예제 #6
0
def test_sample_idx_and_precomputed():
    build_graph(data, n_pca=None, sample_idx=np.arange(10), precomputed="distance")
예제 #7
0
def test_build_knn_with_sample_idx():
    with assert_raises_message(
            ValueError,
            "kNNGraph does not support batch correction. Use `graphtype='mnn'` or `sample_idx=None`",
    ):
        build_graph(data, graphtype="knn", sample_idx=np.arange(len(data)))
예제 #8
0
def test_build_knn_with_sample_idx():
    build_graph(data, graphtype='knn', sample_idx=np.arange(len(data)))
예제 #9
0
def test_build_exact_with_sample_idx():
    build_graph(data,
                graphtype='exact',
                sample_idx=np.arange(len(data)),
                decay=10)