示例#1
0
def test_save_tsv(matrix, tmpdir):
    output_file = tmpdir.join('expression.tsv').strpath
    matrix.save_tsv(output_file)

    recovered_matrix = ExpMatrix.load_tsv(output_file)

    assert recovered_matrix.equals(matrix)
示例#2
0
def test_run(expression_tsv_file, tmpdir, denoised_matrix):
    output_file = tmpdir.join('denoised_expression.tsv').strpath

    os.system('enhance.py -f %s -o %s' % (expression_tsv_file, output_file))

    denoised_matrix_test = ExpMatrix.load_tsv(output_file).astype(np.float32)

    assert np.allclose(denoised_matrix_test, denoised_matrix, atol=1e-4)
示例#3
0
文件: conftest.py 项目: nvqui97/monet
def denoised_matrix():
    expression_file = resource_filename(
        'monet', 'data/test/pbmc_100_denoised_expression.npz')
    return ExpMatrix.load_npz(expression_file)
示例#4
0
def test_load_tsv(expression_tsv_file):

    matrix = ExpMatrix.load_tsv(expression_tsv_file)
    assert matrix.values.dtype == np.uint32
    assert matrix.num_genes == 14384
    assert matrix.num_cells == 100
示例#5
0
def matrix(expression_npz_file):
    matrix = ExpMatrix.load_npz(expression_npz_file)
    return matrix