Exemple #1
0
def test_loader():
    paths = get_test_data()
    out_file = 'test_loader.h5'

    mzml_to_hdf(paths['basic'], out_file_name=out_file)

    check_file(out_file)
Exemple #2
0
def setup():
    global fid
    paths = get_test_data()
    out_file = 'test_query.h5'

    mzml_to_hdf(paths['basic'], out_file_name=out_file)
    fid = tables.open_file('test_query.h5')
Exemple #3
0
def test_loader():
    paths = get_test_data()
    out_file = 'test_loader.h5'

    mzml_to_hdf(paths['basic'], out_file_name=out_file)

    check_file(out_file)
Exemple #4
0
def setup():
    global fid
    paths = get_test_data()
    out_file = 'test_query.h5'

    mzml_to_hdf(paths['basic'], out_file_name=out_file)
    fid = tables.open_file('test_query.h5')
Exemple #5
0
def test_xcms():
    path = get_test_data()['basic']
    xset = get_xmcs_set([path])
    xset = group(xset)
    df = peak_table(xset)
    assert 'mz' in df.columns
    assert 'rtmin' in df.columns
    assert df.shape == (279, 13)
Exemple #6
0
def test_invalid_file():
    paths = get_test_data()
    out_file = 'test_invalid.h5'

    assert_raises(TypeError,
                  mzml_to_hdf,
                  paths['wrong_fmt'],
                  out_file_name=out_file)
Exemple #7
0
def test_loader_main():
    paths = get_test_data()
    out_file = 'test_loader_main.h5'

    sys.argv = ['dummy', '--input', paths['basic'],
                '--output', out_file,
                '--debug']
    main()
    check_file(out_file)
Exemple #8
0
def test_loader_main():
    paths = get_test_data()
    out_file = 'test_loader_main.h5'

    sys.argv = ['dummy', '--input', paths['basic'],
                '--output', out_file,
                '--debug']
    main()
    check_file(out_file)
Exemple #9
0
def test_ms_ms():
    paths = get_test_data()
    file2 = 'ms_ms.h5'

    mzml_to_hdf(paths['ms_ms'], out_file_name=file2)

    fid = tables.open_file(file2)

    table = fid.root.ms2_pos

    assert table.nrows == 604775, table.nrows
Exemple #10
0
def test_ms_ms():
    paths = get_test_data()
    file2 = 'ms_ms.h5'

    mzml_to_hdf(paths['ms_ms'], out_file_name=file2)

    fid = tables.open_file(file2)

    table = fid.root.ms2_pos

    assert table.nrows == 604775, table.nrows
def test_load_lcms_files():
    paths = get_test_data().values()
    runs = mo.load_lcms_files(paths)
    for run in runs:
        assert run.mzml_file
        assert run.hdf5_file
        assert run.creation_time
        assert run.description
        assert run.name
        assert run.last_modified
        assert run.username
        assert run.unique_id
        assert mo.retrieve('lcmsrun', unique_id=run.unique_id)
Exemple #12
0
def test_load_lcms_files():
    paths = get_test_data().values()
    runs = mo.load_lcms_files(paths)
    for run in runs:
        assert run.mzml_file
        assert run.hdf5_file
        assert run.creation_time
        assert run.description
        assert run.name
        assert run.last_modified
        assert run.username
        assert run.unique_id
        assert mo.retrieve('lcmsrun', unique_id=run.unique_id)
Exemple #13
0
def test_32_64():
    paths = get_test_data()
    fname = 'mix32_64.h5'

    mzml_to_hdf(paths['mix32_64'], out_file_name=fname)

    fid = tables.open_file(fname)
    print(fid)
    table = fid.root.ms1_pos

    assert table.nrows == 1041183, table.nrows

    table2 = fid.root.ms1_neg

    assert table2.nrows == 762699, table2.nrows
Exemple #14
0
def test_32_64():
    paths = get_test_data()
    fname = 'mix32_64.h5'

    mzml_to_hdf(paths['mix32_64'], out_file_name=fname)

    fid = tables.open_file(fname)
    print(fid)
    table = fid.root.ms1_pos

    assert table.nrows == 1041183, table.nrows

    table2 = fid.root.ms1_neg

    assert table2.nrows == 762699, table2.nrows
Exemple #15
0
def test_invalid_file():
    paths = get_test_data()
    out_file = 'test_invalid.h5'

    assert_raises(TypeError, mzml_to_hdf, paths['wrong_fmt'],
                  out_file_name=out_file)
Exemple #16
0
def prep():
    path = get_test_data()['basic']
    if os.path.exists(path.replace('.mzML', '_finfo.json')):
        os.remove(path.replace('.mzML', '_finfo.json'))
    return path
Exemple #17
0
def prep():
    path = get_test_data()['basic']
    if os.path.exists(path.replace('.mzML', '_finfo.json')):
        os.remove(path.replace('.mzML', '_finfo.json'))
    return path