@vitessce/zarr 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{deflate-4cf9f098.js → deflate-e4df5be8.js} +1 -1
- package/dist/{index-2a8972b1.js → index-aef6c8fd.js} +767 -1051
- package/dist/index.js +1 -1
- package/dist/{jpeg-e220efb2.js → jpeg-608a0f2a.js} +1 -1
- package/dist/{lerc-12b63f0c.js → lerc-9d769a30.js} +1 -1
- package/dist/{lzw-68593c7a.js → lzw-8a6eb694.js} +1 -1
- package/dist/{packbits-c500b823.js → packbits-e34e4553.js} +1 -1
- package/dist/{raw-d95d6509.js → raw-431129e7.js} +1 -1
- package/dist/{webimage-7938b145.js → webimage-c5617d00.js} +1 -1
- package/dist-tsc/AnnDataSource.test.js +7 -6
- package/dist-tsc/MuDataSource.test.js +5 -4
- package/dist-tsc/anndata-loaders/ObsEmbeddingAnndataLoader.test.js +4 -3
- package/dist-tsc/anndata-loaders/ObsFeatureMatrixAnndataLoader.test.js +22 -21
- package/package.json +8 -8
- package/src/AnnDataSource.test.js +7 -6
- package/src/MuDataSource.test.js +5 -4
- package/src/anndata-loaders/ObsEmbeddingAnndataLoader.test.js +4 -3
- package/src/anndata-loaders/ObsFeatureMatrixAnndataLoader.test.js +22 -21
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
|
|
2
|
-
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-
|
|
2
|
+
import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-aef6c8fd.js";
|
|
3
3
|
import "@vitessce/vit-s";
|
|
4
4
|
import "react";
|
|
5
5
|
const LercParameters = {
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
1
2
|
import AnnDataSource from './AnnDataSource.js';
|
|
2
3
|
describe('sources/AnnDataSource', () => {
|
|
3
4
|
describe('AnnData v0.7', () => {
|
|
4
5
|
it('getJson returns json', async () => {
|
|
5
6
|
const dataSource = new AnnDataSource({
|
|
6
|
-
url: 'http://localhost:
|
|
7
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr',
|
|
7
8
|
});
|
|
8
9
|
const zGroup = await dataSource.getJson('.zgroup');
|
|
9
10
|
expect(zGroup.zarr_format).toEqual(2);
|
|
10
11
|
});
|
|
11
12
|
it('loadObsColumns returns ids for location in store', async () => {
|
|
12
13
|
const dataSource = new AnnDataSource({
|
|
13
|
-
url: 'http://localhost:
|
|
14
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr',
|
|
14
15
|
});
|
|
15
16
|
const ids = await dataSource.loadObsColumns(['obs/leiden']);
|
|
16
17
|
expect(ids).toEqual([['1', '1', '2']]);
|
|
17
18
|
});
|
|
18
19
|
it('loadObsIndex returns names', async () => {
|
|
19
20
|
const dataSource = new AnnDataSource({
|
|
20
|
-
url: 'http://localhost:
|
|
21
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr',
|
|
21
22
|
});
|
|
22
23
|
const names = await dataSource.loadObsIndex();
|
|
23
24
|
expect(names).toEqual(['CTG', 'GCA', 'CTG']);
|
|
@@ -26,21 +27,21 @@ describe('sources/AnnDataSource', () => {
|
|
|
26
27
|
describe('AnnData v0.8', () => {
|
|
27
28
|
it('getJson returns json', async () => {
|
|
28
29
|
const dataSource = new AnnDataSource({
|
|
29
|
-
url: 'http://localhost:
|
|
30
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr',
|
|
30
31
|
});
|
|
31
32
|
const zGroup = await dataSource.getJson('.zgroup');
|
|
32
33
|
expect(zGroup.zarr_format).toEqual(2);
|
|
33
34
|
});
|
|
34
35
|
it('loadObsColumns returns ids for location in store', async () => {
|
|
35
36
|
const dataSource = new AnnDataSource({
|
|
36
|
-
url: 'http://localhost:
|
|
37
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr',
|
|
37
38
|
});
|
|
38
39
|
const ids = await dataSource.loadObsColumns(['obs/leiden']);
|
|
39
40
|
expect(ids).toEqual([['1', '1', '2']]);
|
|
40
41
|
});
|
|
41
42
|
it('loadObsIndex returns names', async () => {
|
|
42
43
|
const dataSource = new AnnDataSource({
|
|
43
|
-
url: 'http://localhost:
|
|
44
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr',
|
|
44
45
|
});
|
|
45
46
|
const names = await dataSource.loadObsIndex();
|
|
46
47
|
expect(names).toEqual(['CTG', 'GCA', 'CTG']);
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
1
2
|
import { range } from 'lodash-es';
|
|
2
3
|
import MuDataSource, { getObsPath, getVarPath } from './MuDataSource.js';
|
|
3
4
|
describe('sources/MuDataSource', () => {
|
|
4
5
|
it('loadObsColumns returns ids for location in store, with joint-modality path', async () => {
|
|
5
6
|
const dataSource = new MuDataSource({
|
|
6
|
-
url: 'http://localhost:
|
|
7
|
+
url: 'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr',
|
|
7
8
|
});
|
|
8
9
|
const ids = await dataSource.loadObsColumns(['obs/leiden']);
|
|
9
10
|
expect(ids).toEqual([['3', '2', '3', '1', '1']]);
|
|
10
11
|
});
|
|
11
12
|
it('loadObsColumns returns ids for location in store, with modality-specific path', async () => {
|
|
12
13
|
const dataSource = new MuDataSource({
|
|
13
|
-
url: 'http://localhost:
|
|
14
|
+
url: 'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr',
|
|
14
15
|
});
|
|
15
16
|
const ids = await dataSource.loadObsColumns(['mod/rna/obs/leiden']);
|
|
16
17
|
expect(ids).toEqual([['1', '1', '2', '2']]);
|
|
17
18
|
});
|
|
18
19
|
it('loadVarIndex supports modality-specific paths', async () => {
|
|
19
20
|
const dataSource = new MuDataSource({
|
|
20
|
-
url: 'http://localhost:
|
|
21
|
+
url: 'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr',
|
|
21
22
|
});
|
|
22
23
|
const names = await dataSource.loadVarIndex('mod/atac/X');
|
|
23
24
|
expect(names).toEqual(range(15).map(i => `peak_${i}`));
|
|
24
25
|
});
|
|
25
26
|
it('loadObsIndex returns names', async () => {
|
|
26
27
|
const dataSource = new MuDataSource({
|
|
27
|
-
url: 'http://localhost:
|
|
28
|
+
url: 'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr',
|
|
28
29
|
});
|
|
29
30
|
const names = await dataSource.loadObsIndex('mod/atac/X');
|
|
30
31
|
expect(names).toEqual(['CTG', 'GCA', 'CTT', 'GGG']);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable func-names */
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
2
3
|
import { LoaderResult } from '@vitessce/vit-s';
|
|
3
4
|
import ObsEmbeddingAnndataLoader from './ObsEmbeddingAnndataLoader.js';
|
|
4
5
|
import AnnDataSource from '../AnnDataSource.js';
|
|
@@ -33,7 +34,7 @@ const createMudataLoader = (url) => {
|
|
|
33
34
|
};
|
|
34
35
|
describe('loaders/ObsEmbeddingAnndataLoader for AnnData', () => {
|
|
35
36
|
it('load returns obsIndex and obsEmbedding', async () => {
|
|
36
|
-
const loader = createAnndataLoader('http://localhost:
|
|
37
|
+
const loader = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr');
|
|
37
38
|
const result = await loader.load();
|
|
38
39
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
39
40
|
const payload = result.data;
|
|
@@ -44,7 +45,7 @@ describe('loaders/ObsEmbeddingAnndataLoader for AnnData', () => {
|
|
|
44
45
|
expect(Array.from(payload.obsEmbedding.data[1])).toEqual([-1, 0, 1]);
|
|
45
46
|
});
|
|
46
47
|
it('load returns obsIndex and obsEmbedding for MuData', async () => {
|
|
47
|
-
const loader = createMudataLoader('http://localhost:
|
|
48
|
+
const loader = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr');
|
|
48
49
|
const result = await loader.load();
|
|
49
50
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
50
51
|
const payload = result.data;
|
|
@@ -55,7 +56,7 @@ describe('loaders/ObsEmbeddingAnndataLoader for AnnData', () => {
|
|
|
55
56
|
expect(Array.from(payload.obsEmbedding.data[1])).toEqual([-1, 0, 1, 2]);
|
|
56
57
|
});
|
|
57
58
|
it('load returns obsIndex and obsEmbedding for updated MuData', async () => {
|
|
58
|
-
const loader = createMudataLoader('http://localhost:
|
|
59
|
+
const loader = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense-updated.zarr');
|
|
59
60
|
const result = await loader.load();
|
|
60
61
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
61
62
|
const payload = result.data;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable func-names */
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
2
3
|
import ObsFeatureMatrixAnndataLoader from './ObsFeatureMatrixAnndataLoader.js';
|
|
3
4
|
import AnnDataSource from '../AnnDataSource.js';
|
|
4
5
|
import MuDataSource from '../MuDataSource.js';
|
|
@@ -27,27 +28,27 @@ const createMudataLoader = (url) => {
|
|
|
27
28
|
describe('loaders/ObsFeatureMatrixAnndataLoader', () => {
|
|
28
29
|
describe('AnnData v0.7', () => {
|
|
29
30
|
it('loadFilteredGeneNames returns gene names', async () => {
|
|
30
|
-
const loader = createAnndataLoader('http://localhost:
|
|
31
|
+
const loader = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr');
|
|
31
32
|
const names = await loader.loadFilteredGeneNames();
|
|
32
33
|
expect(names).toEqual(Array.from({ length: 15 }).map((_, i) => `gene_${i}`));
|
|
33
34
|
});
|
|
34
35
|
it('loadGeneSelection matches across storage methods', async () => {
|
|
35
36
|
const selection = { selection: ['gene_1', 'gene_5'] };
|
|
36
|
-
const loaderCsr = createAnndataLoader('http://localhost:
|
|
37
|
+
const loaderCsr = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-csr.zarr');
|
|
37
38
|
const csrSelection = await loaderCsr.loadGeneSelection(selection);
|
|
38
|
-
const loaderDense = createAnndataLoader('http://localhost:
|
|
39
|
+
const loaderDense = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr');
|
|
39
40
|
const denseSelection = await loaderDense.loadGeneSelection(selection);
|
|
40
|
-
const loaderCsc = createAnndataLoader('http://localhost:
|
|
41
|
+
const loaderCsc = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-csc.zarr');
|
|
41
42
|
const cscSelection = await loaderCsc.loadGeneSelection(selection);
|
|
42
43
|
expect(cscSelection).toEqual(denseSelection);
|
|
43
44
|
expect(csrSelection).toEqual(denseSelection);
|
|
44
45
|
});
|
|
45
46
|
it('loadCellXGene matches across storage methods', async () => {
|
|
46
|
-
const loaderCsr = createAnndataLoader('http://localhost:
|
|
47
|
+
const loaderCsr = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-csr.zarr');
|
|
47
48
|
const csrMatrix = await loaderCsr.loadCellXGene();
|
|
48
|
-
const loaderDense = createAnndataLoader('http://localhost:
|
|
49
|
+
const loaderDense = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr');
|
|
49
50
|
const denseMatrix = await loaderDense.loadCellXGene();
|
|
50
|
-
const loaderCsc = createAnndataLoader('http://localhost:
|
|
51
|
+
const loaderCsc = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-csc.zarr');
|
|
51
52
|
const cscMatrix = await loaderCsc.loadCellXGene();
|
|
52
53
|
expect(cscMatrix).toEqual(denseMatrix);
|
|
53
54
|
expect(csrMatrix).toEqual(denseMatrix);
|
|
@@ -55,27 +56,27 @@ describe('loaders/ObsFeatureMatrixAnndataLoader', () => {
|
|
|
55
56
|
});
|
|
56
57
|
describe('AnnData v0.8', () => {
|
|
57
58
|
it('loadFilteredGeneNames returns gene names', async () => {
|
|
58
|
-
const loader = createAnndataLoader('http://localhost:
|
|
59
|
+
const loader = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr');
|
|
59
60
|
const names = await loader.loadFilteredGeneNames();
|
|
60
61
|
expect(names).toEqual(Array.from({ length: 15 }).map((_, i) => `gene_${i}`));
|
|
61
62
|
});
|
|
62
63
|
it('loadGeneSelection matches across storage methods', async () => {
|
|
63
64
|
const selection = { selection: ['gene_1', 'gene_5'] };
|
|
64
|
-
const loaderCsr = createAnndataLoader('http://localhost:
|
|
65
|
+
const loaderCsr = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-csr.adata.zarr');
|
|
65
66
|
const csrSelection = await loaderCsr.loadGeneSelection(selection);
|
|
66
|
-
const loaderDense = createAnndataLoader('http://localhost:
|
|
67
|
+
const loaderDense = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr');
|
|
67
68
|
const denseSelection = await loaderDense.loadGeneSelection(selection);
|
|
68
|
-
const loaderCsc = createAnndataLoader('http://localhost:
|
|
69
|
+
const loaderCsc = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-csc.zarr');
|
|
69
70
|
const cscSelection = await loaderCsc.loadGeneSelection(selection);
|
|
70
71
|
expect(cscSelection).toEqual(denseSelection);
|
|
71
72
|
expect(csrSelection).toEqual(denseSelection);
|
|
72
73
|
});
|
|
73
74
|
it('loadCellXGene matches across storage methods', async () => {
|
|
74
|
-
const loaderCsr = createAnndataLoader('http://localhost:
|
|
75
|
+
const loaderCsr = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-csr.adata.zarr');
|
|
75
76
|
const csrMatrix = await loaderCsr.loadCellXGene();
|
|
76
|
-
const loaderDense = createAnndataLoader('http://localhost:
|
|
77
|
+
const loaderDense = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr');
|
|
77
78
|
const denseMatrix = await loaderDense.loadCellXGene();
|
|
78
|
-
const loaderCsc = createAnndataLoader('http://localhost:
|
|
79
|
+
const loaderCsc = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-csc.zarr');
|
|
79
80
|
const cscMatrix = await loaderCsc.loadCellXGene();
|
|
80
81
|
expect(cscMatrix).toEqual(denseMatrix);
|
|
81
82
|
expect(csrMatrix).toEqual(denseMatrix);
|
|
@@ -83,27 +84,27 @@ describe('loaders/ObsFeatureMatrixAnndataLoader', () => {
|
|
|
83
84
|
});
|
|
84
85
|
describe('MuData v0.2', () => {
|
|
85
86
|
it('loadFilteredGeneNames returns gene names', async () => {
|
|
86
|
-
const loader = createMudataLoader('http://localhost:
|
|
87
|
+
const loader = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr');
|
|
87
88
|
const names = await loader.loadFilteredGeneNames();
|
|
88
89
|
expect(names).toEqual(Array.from({ length: 15 }).map((_, i) => `gene_${i}`));
|
|
89
90
|
});
|
|
90
91
|
it('loadGeneSelection matches across storage methods', async () => {
|
|
91
92
|
const selection = { selection: ['gene_1', 'gene_5'] };
|
|
92
|
-
const loaderCsr = createMudataLoader('http://localhost:
|
|
93
|
+
const loaderCsr = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-csr.zarr');
|
|
93
94
|
const csrSelection = await loaderCsr.loadGeneSelection(selection);
|
|
94
|
-
const loaderDense = createMudataLoader('http://localhost:
|
|
95
|
+
const loaderDense = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr');
|
|
95
96
|
const denseSelection = await loaderDense.loadGeneSelection(selection);
|
|
96
|
-
const loaderCsc = createMudataLoader('http://localhost:
|
|
97
|
+
const loaderCsc = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-csc.zarr');
|
|
97
98
|
const cscSelection = await loaderCsc.loadGeneSelection(selection);
|
|
98
99
|
expect(cscSelection).toEqual(denseSelection);
|
|
99
100
|
expect(csrSelection).toEqual(denseSelection);
|
|
100
101
|
});
|
|
101
102
|
it('loadCellXGene matches across storage methods', async () => {
|
|
102
|
-
const loaderCsr = createMudataLoader('http://localhost:
|
|
103
|
+
const loaderCsr = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-csr.zarr');
|
|
103
104
|
const csrMatrix = await loaderCsr.loadCellXGene();
|
|
104
|
-
const loaderDense = createMudataLoader('http://localhost:
|
|
105
|
+
const loaderDense = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr');
|
|
105
106
|
const denseMatrix = await loaderDense.loadCellXGene();
|
|
106
|
-
const loaderCsc = createMudataLoader('http://localhost:
|
|
107
|
+
const loaderCsc = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-csc.zarr');
|
|
107
108
|
const cscMatrix = await loaderCsc.loadCellXGene();
|
|
108
109
|
expect(cscMatrix).toEqual(denseMatrix);
|
|
109
110
|
expect(csrMatrix).toEqual(denseMatrix);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitessce/zarr",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"author": "Gehlenborg Lab",
|
|
5
5
|
"homepage": "http://vitessce.io",
|
|
6
6
|
"repository": {
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"d3-array": "^2.4.0",
|
|
20
20
|
"lodash-es": "^4.17.21",
|
|
21
21
|
"zarr": "0.5.1",
|
|
22
|
-
"@vitessce/constants-internal": "3.
|
|
23
|
-
"@vitessce/gl": "3.
|
|
24
|
-
"@vitessce/sets-utils": "3.
|
|
25
|
-
"@vitessce/spatial-utils": "3.
|
|
26
|
-
"@vitessce/utils": "3.
|
|
27
|
-
"@vitessce/vit-s": "3.
|
|
22
|
+
"@vitessce/constants-internal": "3.1.0",
|
|
23
|
+
"@vitessce/gl": "3.1.0",
|
|
24
|
+
"@vitessce/sets-utils": "3.1.0",
|
|
25
|
+
"@vitessce/spatial-utils": "3.1.0",
|
|
26
|
+
"@vitessce/utils": "3.1.0",
|
|
27
|
+
"@vitessce/vit-s": "3.1.0"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|
|
31
|
-
"test": "pnpm exec vitest --run
|
|
31
|
+
"test": "pnpm exec vitest --run"
|
|
32
32
|
},
|
|
33
33
|
"module": "dist/index.js",
|
|
34
34
|
"exports": {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
1
2
|
import AnnDataSource from './AnnDataSource.js';
|
|
2
3
|
|
|
3
4
|
describe('sources/AnnDataSource', () => {
|
|
4
5
|
describe('AnnData v0.7', () => {
|
|
5
6
|
it('getJson returns json', async () => {
|
|
6
7
|
const dataSource = new AnnDataSource({
|
|
7
|
-
url: 'http://localhost:
|
|
8
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr',
|
|
8
9
|
});
|
|
9
10
|
const zGroup = await dataSource.getJson('.zgroup');
|
|
10
11
|
expect(zGroup.zarr_format).toEqual(2);
|
|
@@ -12,7 +13,7 @@ describe('sources/AnnDataSource', () => {
|
|
|
12
13
|
|
|
13
14
|
it('loadObsColumns returns ids for location in store', async () => {
|
|
14
15
|
const dataSource = new AnnDataSource({
|
|
15
|
-
url: 'http://localhost:
|
|
16
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr',
|
|
16
17
|
});
|
|
17
18
|
const ids = await dataSource.loadObsColumns(['obs/leiden']);
|
|
18
19
|
expect(ids).toEqual([['1', '1', '2']]);
|
|
@@ -20,7 +21,7 @@ describe('sources/AnnDataSource', () => {
|
|
|
20
21
|
|
|
21
22
|
it('loadObsIndex returns names', async () => {
|
|
22
23
|
const dataSource = new AnnDataSource({
|
|
23
|
-
url: 'http://localhost:
|
|
24
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr',
|
|
24
25
|
});
|
|
25
26
|
const names = await dataSource.loadObsIndex();
|
|
26
27
|
expect(names).toEqual(['CTG', 'GCA', 'CTG']);
|
|
@@ -30,7 +31,7 @@ describe('sources/AnnDataSource', () => {
|
|
|
30
31
|
describe('AnnData v0.8', () => {
|
|
31
32
|
it('getJson returns json', async () => {
|
|
32
33
|
const dataSource = new AnnDataSource({
|
|
33
|
-
url: 'http://localhost:
|
|
34
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr',
|
|
34
35
|
});
|
|
35
36
|
const zGroup = await dataSource.getJson('.zgroup');
|
|
36
37
|
expect(zGroup.zarr_format).toEqual(2);
|
|
@@ -38,7 +39,7 @@ describe('sources/AnnDataSource', () => {
|
|
|
38
39
|
|
|
39
40
|
it('loadObsColumns returns ids for location in store', async () => {
|
|
40
41
|
const dataSource = new AnnDataSource({
|
|
41
|
-
url: 'http://localhost:
|
|
42
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr',
|
|
42
43
|
});
|
|
43
44
|
const ids = await dataSource.loadObsColumns(['obs/leiden']);
|
|
44
45
|
expect(ids).toEqual([['1', '1', '2']]);
|
|
@@ -46,7 +47,7 @@ describe('sources/AnnDataSource', () => {
|
|
|
46
47
|
|
|
47
48
|
it('loadObsIndex returns names', async () => {
|
|
48
49
|
const dataSource = new AnnDataSource({
|
|
49
|
-
url: 'http://localhost:
|
|
50
|
+
url: 'http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr',
|
|
50
51
|
});
|
|
51
52
|
const names = await dataSource.loadObsIndex();
|
|
52
53
|
expect(names).toEqual(['CTG', 'GCA', 'CTG']);
|
package/src/MuDataSource.test.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
1
2
|
import { range } from 'lodash-es';
|
|
2
3
|
import MuDataSource, { getObsPath, getVarPath } from './MuDataSource.js';
|
|
3
4
|
|
|
4
5
|
describe('sources/MuDataSource', () => {
|
|
5
6
|
it('loadObsColumns returns ids for location in store, with joint-modality path', async () => {
|
|
6
7
|
const dataSource = new MuDataSource({
|
|
7
|
-
url: 'http://localhost:
|
|
8
|
+
url: 'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr',
|
|
8
9
|
});
|
|
9
10
|
const ids = await dataSource.loadObsColumns(['obs/leiden']);
|
|
10
11
|
expect(ids).toEqual([['3', '2', '3', '1', '1']]);
|
|
@@ -12,7 +13,7 @@ describe('sources/MuDataSource', () => {
|
|
|
12
13
|
|
|
13
14
|
it('loadObsColumns returns ids for location in store, with modality-specific path', async () => {
|
|
14
15
|
const dataSource = new MuDataSource({
|
|
15
|
-
url: 'http://localhost:
|
|
16
|
+
url: 'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr',
|
|
16
17
|
});
|
|
17
18
|
const ids = await dataSource.loadObsColumns(['mod/rna/obs/leiden']);
|
|
18
19
|
expect(ids).toEqual([['1', '1', '2', '2']]);
|
|
@@ -20,7 +21,7 @@ describe('sources/MuDataSource', () => {
|
|
|
20
21
|
|
|
21
22
|
it('loadVarIndex supports modality-specific paths', async () => {
|
|
22
23
|
const dataSource = new MuDataSource({
|
|
23
|
-
url: 'http://localhost:
|
|
24
|
+
url: 'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr',
|
|
24
25
|
});
|
|
25
26
|
const names = await dataSource.loadVarIndex('mod/atac/X');
|
|
26
27
|
expect(names).toEqual(range(15).map(i => `peak_${i}`));
|
|
@@ -28,7 +29,7 @@ describe('sources/MuDataSource', () => {
|
|
|
28
29
|
|
|
29
30
|
it('loadObsIndex returns names', async () => {
|
|
30
31
|
const dataSource = new MuDataSource({
|
|
31
|
-
url: 'http://localhost:
|
|
32
|
+
url: 'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr',
|
|
32
33
|
});
|
|
33
34
|
const names = await dataSource.loadObsIndex('mod/atac/X');
|
|
34
35
|
expect(names).toEqual(['CTG', 'GCA', 'CTT', 'GGG']);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable func-names */
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
2
3
|
import { LoaderResult } from '@vitessce/vit-s';
|
|
3
4
|
import ObsEmbeddingAnndataLoader from './ObsEmbeddingAnndataLoader.js';
|
|
4
5
|
import AnnDataSource from '../AnnDataSource.js';
|
|
@@ -37,7 +38,7 @@ const createMudataLoader = (url) => {
|
|
|
37
38
|
describe('loaders/ObsEmbeddingAnndataLoader for AnnData', () => {
|
|
38
39
|
it('load returns obsIndex and obsEmbedding', async () => {
|
|
39
40
|
const loader = createAnndataLoader(
|
|
40
|
-
'http://localhost:
|
|
41
|
+
'http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr',
|
|
41
42
|
);
|
|
42
43
|
const result = await loader.load();
|
|
43
44
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
@@ -51,7 +52,7 @@ describe('loaders/ObsEmbeddingAnndataLoader for AnnData', () => {
|
|
|
51
52
|
|
|
52
53
|
it('load returns obsIndex and obsEmbedding for MuData', async () => {
|
|
53
54
|
const loader = createMudataLoader(
|
|
54
|
-
'http://localhost:
|
|
55
|
+
'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr',
|
|
55
56
|
);
|
|
56
57
|
const result = await loader.load();
|
|
57
58
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
@@ -65,7 +66,7 @@ describe('loaders/ObsEmbeddingAnndataLoader for AnnData', () => {
|
|
|
65
66
|
|
|
66
67
|
it('load returns obsIndex and obsEmbedding for updated MuData', async () => {
|
|
67
68
|
const loader = createMudataLoader(
|
|
68
|
-
'http://localhost:
|
|
69
|
+
'http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense-updated.zarr',
|
|
69
70
|
);
|
|
70
71
|
const result = await loader.load();
|
|
71
72
|
expect(result).toBeInstanceOf(LoaderResult);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* eslint-disable func-names */
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
2
3
|
import ObsFeatureMatrixAnndataLoader from './ObsFeatureMatrixAnndataLoader.js';
|
|
3
4
|
import AnnDataSource from '../AnnDataSource.js';
|
|
4
5
|
import MuDataSource from '../MuDataSource.js';
|
|
@@ -31,29 +32,29 @@ const createMudataLoader = (url) => {
|
|
|
31
32
|
describe('loaders/ObsFeatureMatrixAnndataLoader', () => {
|
|
32
33
|
describe('AnnData v0.7', () => {
|
|
33
34
|
it('loadFilteredGeneNames returns gene names', async () => {
|
|
34
|
-
const loader = createAnndataLoader('http://localhost:
|
|
35
|
+
const loader = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr');
|
|
35
36
|
const names = await loader.loadFilteredGeneNames();
|
|
36
37
|
expect(names).toEqual(Array.from({ length: 15 }).map((_, i) => `gene_${i}`));
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
it('loadGeneSelection matches across storage methods', async () => {
|
|
40
41
|
const selection = { selection: ['gene_1', 'gene_5'] };
|
|
41
|
-
const loaderCsr = createAnndataLoader('http://localhost:
|
|
42
|
+
const loaderCsr = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-csr.zarr');
|
|
42
43
|
const csrSelection = await loaderCsr.loadGeneSelection(selection);
|
|
43
|
-
const loaderDense = createAnndataLoader('http://localhost:
|
|
44
|
+
const loaderDense = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr');
|
|
44
45
|
const denseSelection = await loaderDense.loadGeneSelection(selection);
|
|
45
|
-
const loaderCsc = createAnndataLoader('http://localhost:
|
|
46
|
+
const loaderCsc = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-csc.zarr');
|
|
46
47
|
const cscSelection = await loaderCsc.loadGeneSelection(selection);
|
|
47
48
|
expect(cscSelection).toEqual(denseSelection);
|
|
48
49
|
expect(csrSelection).toEqual(denseSelection);
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
it('loadCellXGene matches across storage methods', async () => {
|
|
52
|
-
const loaderCsr = createAnndataLoader('http://localhost:
|
|
53
|
+
const loaderCsr = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-csr.zarr');
|
|
53
54
|
const csrMatrix = await loaderCsr.loadCellXGene();
|
|
54
|
-
const loaderDense = createAnndataLoader('http://localhost:
|
|
55
|
+
const loaderDense = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-dense.zarr');
|
|
55
56
|
const denseMatrix = await loaderDense.loadCellXGene();
|
|
56
|
-
const loaderCsc = createAnndataLoader('http://localhost:
|
|
57
|
+
const loaderCsc = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.7/anndata-csc.zarr');
|
|
57
58
|
const cscMatrix = await loaderCsc.loadCellXGene();
|
|
58
59
|
expect(cscMatrix).toEqual(denseMatrix);
|
|
59
60
|
expect(csrMatrix).toEqual(denseMatrix);
|
|
@@ -62,29 +63,29 @@ describe('loaders/ObsFeatureMatrixAnndataLoader', () => {
|
|
|
62
63
|
|
|
63
64
|
describe('AnnData v0.8', () => {
|
|
64
65
|
it('loadFilteredGeneNames returns gene names', async () => {
|
|
65
|
-
const loader = createAnndataLoader('http://localhost:
|
|
66
|
+
const loader = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr');
|
|
66
67
|
const names = await loader.loadFilteredGeneNames();
|
|
67
68
|
expect(names).toEqual(Array.from({ length: 15 }).map((_, i) => `gene_${i}`));
|
|
68
69
|
});
|
|
69
70
|
|
|
70
71
|
it('loadGeneSelection matches across storage methods', async () => {
|
|
71
72
|
const selection = { selection: ['gene_1', 'gene_5'] };
|
|
72
|
-
const loaderCsr = createAnndataLoader('http://localhost:
|
|
73
|
+
const loaderCsr = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-csr.adata.zarr');
|
|
73
74
|
const csrSelection = await loaderCsr.loadGeneSelection(selection);
|
|
74
|
-
const loaderDense = createAnndataLoader('http://localhost:
|
|
75
|
+
const loaderDense = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr');
|
|
75
76
|
const denseSelection = await loaderDense.loadGeneSelection(selection);
|
|
76
|
-
const loaderCsc = createAnndataLoader('http://localhost:
|
|
77
|
+
const loaderCsc = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-csc.zarr');
|
|
77
78
|
const cscSelection = await loaderCsc.loadGeneSelection(selection);
|
|
78
79
|
expect(cscSelection).toEqual(denseSelection);
|
|
79
80
|
expect(csrSelection).toEqual(denseSelection);
|
|
80
81
|
});
|
|
81
82
|
|
|
82
83
|
it('loadCellXGene matches across storage methods', async () => {
|
|
83
|
-
const loaderCsr = createAnndataLoader('http://localhost:
|
|
84
|
+
const loaderCsr = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-csr.adata.zarr');
|
|
84
85
|
const csrMatrix = await loaderCsr.loadCellXGene();
|
|
85
|
-
const loaderDense = createAnndataLoader('http://localhost:
|
|
86
|
+
const loaderDense = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-dense.zarr');
|
|
86
87
|
const denseMatrix = await loaderDense.loadCellXGene();
|
|
87
|
-
const loaderCsc = createAnndataLoader('http://localhost:
|
|
88
|
+
const loaderCsc = createAnndataLoader('http://localhost:4204/@fixtures/zarr/anndata-0.8/anndata-csc.zarr');
|
|
88
89
|
const cscMatrix = await loaderCsc.loadCellXGene();
|
|
89
90
|
expect(cscMatrix).toEqual(denseMatrix);
|
|
90
91
|
expect(csrMatrix).toEqual(denseMatrix);
|
|
@@ -93,29 +94,29 @@ describe('loaders/ObsFeatureMatrixAnndataLoader', () => {
|
|
|
93
94
|
|
|
94
95
|
describe('MuData v0.2', () => {
|
|
95
96
|
it('loadFilteredGeneNames returns gene names', async () => {
|
|
96
|
-
const loader = createMudataLoader('http://localhost:
|
|
97
|
+
const loader = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr');
|
|
97
98
|
const names = await loader.loadFilteredGeneNames();
|
|
98
99
|
expect(names).toEqual(Array.from({ length: 15 }).map((_, i) => `gene_${i}`));
|
|
99
100
|
});
|
|
100
101
|
|
|
101
102
|
it('loadGeneSelection matches across storage methods', async () => {
|
|
102
103
|
const selection = { selection: ['gene_1', 'gene_5'] };
|
|
103
|
-
const loaderCsr = createMudataLoader('http://localhost:
|
|
104
|
+
const loaderCsr = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-csr.zarr');
|
|
104
105
|
const csrSelection = await loaderCsr.loadGeneSelection(selection);
|
|
105
|
-
const loaderDense = createMudataLoader('http://localhost:
|
|
106
|
+
const loaderDense = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr');
|
|
106
107
|
const denseSelection = await loaderDense.loadGeneSelection(selection);
|
|
107
|
-
const loaderCsc = createMudataLoader('http://localhost:
|
|
108
|
+
const loaderCsc = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-csc.zarr');
|
|
108
109
|
const cscSelection = await loaderCsc.loadGeneSelection(selection);
|
|
109
110
|
expect(cscSelection).toEqual(denseSelection);
|
|
110
111
|
expect(csrSelection).toEqual(denseSelection);
|
|
111
112
|
});
|
|
112
113
|
|
|
113
114
|
it('loadCellXGene matches across storage methods', async () => {
|
|
114
|
-
const loaderCsr = createMudataLoader('http://localhost:
|
|
115
|
+
const loaderCsr = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-csr.zarr');
|
|
115
116
|
const csrMatrix = await loaderCsr.loadCellXGene();
|
|
116
|
-
const loaderDense = createMudataLoader('http://localhost:
|
|
117
|
+
const loaderDense = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-dense.zarr');
|
|
117
118
|
const denseMatrix = await loaderDense.loadCellXGene();
|
|
118
|
-
const loaderCsc = createMudataLoader('http://localhost:
|
|
119
|
+
const loaderCsc = createMudataLoader('http://localhost:4204/@fixtures/zarr/mudata-0.2/mudata-csc.zarr');
|
|
119
120
|
const cscMatrix = await loaderCsc.loadCellXGene();
|
|
120
121
|
expect(cscMatrix).toEqual(denseMatrix);
|
|
121
122
|
expect(csrMatrix).toEqual(denseMatrix);
|