@jbrowse/plugin-trix 1.7.11 → 2.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.
Files changed (27) hide show
  1. package/dist/TrixTextSearchAdapter/TrixTextSearchAdapter.js +166 -185
  2. package/dist/TrixTextSearchAdapter/TrixTextSearchAdapter.js.map +1 -0
  3. package/dist/TrixTextSearchAdapter/configSchema.js +27 -46
  4. package/dist/TrixTextSearchAdapter/configSchema.js.map +1 -0
  5. package/dist/TrixTextSearchAdapter/index.js +10 -22
  6. package/dist/TrixTextSearchAdapter/index.js.map +1 -0
  7. package/dist/index.js +41 -66
  8. package/dist/index.js.map +1 -0
  9. package/esm/TrixTextSearchAdapter/TrixTextSearchAdapter.d.ts +14 -0
  10. package/esm/TrixTextSearchAdapter/TrixTextSearchAdapter.js +77 -0
  11. package/esm/TrixTextSearchAdapter/TrixTextSearchAdapter.js.map +1 -0
  12. package/esm/TrixTextSearchAdapter/configSchema.d.ts +2 -0
  13. package/esm/TrixTextSearchAdapter/configSchema.js +29 -0
  14. package/esm/TrixTextSearchAdapter/configSchema.js.map +1 -0
  15. package/esm/TrixTextSearchAdapter/index.d.ts +2 -0
  16. package/esm/TrixTextSearchAdapter/index.js +3 -0
  17. package/esm/TrixTextSearchAdapter/index.js.map +1 -0
  18. package/esm/index.d.ts +6 -0
  19. package/esm/index.js +18 -0
  20. package/esm/index.js.map +1 -0
  21. package/package.json +17 -10
  22. package/src/TrixTextSearchAdapter/TrixTextSearchAdapter.test.ts +7 -12
  23. package/src/TrixTextSearchAdapter/test_data/volvox.ix +194 -0
  24. package/src/TrixTextSearchAdapter/test_data/volvox.ixx +1 -0
  25. package/src/TrixTextSearchAdapter/test_data/volvox2_meta.json +1 -0
  26. package/src/TrixTextSearchAdapter/test_data/volvox_meta.json +163 -0
  27. package/dist/TrixTextSearchAdapter/TrixTextSearchAdapter.test.js +0 -76
@@ -0,0 +1,163 @@
1
+ {
2
+ "dateCreated": "2022-06-17T10:57:18.370Z",
3
+ "tracks": [
4
+ {
5
+ "trackId": "volvox_sv_test",
6
+ "attributesIndexed": ["Name", "ID", "Note"],
7
+ "excludedTypes": ["CDS", "exon"],
8
+ "adapterConf": {
9
+ "type": "VcfTabixAdapter",
10
+ "vcfGzLocation": {
11
+ "uri": "volvox.dup.vcf.gz",
12
+ "locationType": "UriLocation"
13
+ },
14
+ "index": {
15
+ "location": {
16
+ "uri": "volvox.dup.vcf.gz.tbi",
17
+ "locationType": "UriLocation"
18
+ }
19
+ }
20
+ }
21
+ },
22
+ {
23
+ "trackId": "volvox_sv_test_renamed",
24
+ "attributesIndexed": ["Name", "ID", "Note"],
25
+ "excludedTypes": ["CDS", "exon"],
26
+ "adapterConf": {
27
+ "type": "VcfTabixAdapter",
28
+ "vcfGzLocation": {
29
+ "uri": "volvox.dup.renamed.vcf.gz",
30
+ "locationType": "UriLocation"
31
+ },
32
+ "index": {
33
+ "location": {
34
+ "uri": "volvox.dup.renamed.vcf.gz.tbi",
35
+ "locationType": "UriLocation"
36
+ }
37
+ }
38
+ }
39
+ },
40
+ {
41
+ "trackId": "volvox_test_vcf",
42
+ "attributesIndexed": ["Name", "ID", "Note"],
43
+ "excludedTypes": ["CDS", "exon"],
44
+ "adapterConf": {
45
+ "type": "VcfTabixAdapter",
46
+ "vcfGzLocation": {
47
+ "uri": "volvox.test.vcf.gz",
48
+ "locationType": "UriLocation"
49
+ },
50
+ "index": {
51
+ "location": {
52
+ "uri": "volvox.test.vcf.gz.tbi",
53
+ "locationType": "UriLocation"
54
+ }
55
+ }
56
+ }
57
+ },
58
+ {
59
+ "trackId": "gff3tabix_genes",
60
+ "attributesIndexed": ["Name", "ID", "Note"],
61
+ "excludedTypes": ["CDS", "exon"],
62
+ "adapterConf": {
63
+ "type": "Gff3TabixAdapter",
64
+ "gffGzLocation": {
65
+ "uri": "volvox.sort.gff3.gz",
66
+ "locationType": "UriLocation"
67
+ },
68
+ "index": {
69
+ "location": {
70
+ "uri": "volvox.sort.gff3.gz.tbi",
71
+ "locationType": "UriLocation"
72
+ }
73
+ }
74
+ }
75
+ },
76
+ {
77
+ "trackId": "volvox_filtered_vcf",
78
+ "attributesIndexed": ["Name", "ID", "Note"],
79
+ "excludedTypes": ["CDS", "exon"],
80
+ "adapterConf": {
81
+ "type": "VcfTabixAdapter",
82
+ "vcfGzLocation": {
83
+ "uri": "volvox.filtered.vcf.gz",
84
+ "locationType": "UriLocation"
85
+ },
86
+ "index": {
87
+ "location": {
88
+ "uri": "volvox.filtered.vcf.gz.tbi",
89
+ "locationType": "UriLocation"
90
+ }
91
+ }
92
+ }
93
+ },
94
+ {
95
+ "trackId": "variant_colors",
96
+ "attributesIndexed": ["Name", "ID", "Note"],
97
+ "excludedTypes": ["CDS", "exon"],
98
+ "adapterConf": {
99
+ "type": "VcfTabixAdapter",
100
+ "vcfGzLocation": {
101
+ "uri": "volvox.filtered.vcf.gz",
102
+ "locationType": "UriLocation"
103
+ },
104
+ "index": {
105
+ "location": {
106
+ "uri": "volvox.filtered.vcf.gz.tbi",
107
+ "locationType": "UriLocation"
108
+ }
109
+ }
110
+ }
111
+ },
112
+ {
113
+ "trackId": "single_exon_gene",
114
+ "attributesIndexed": ["Name", "ID", "Note"],
115
+ "excludedTypes": ["CDS", "exon"],
116
+ "adapterConf": {
117
+ "type": "Gff3TabixAdapter",
118
+ "gffGzLocation": {
119
+ "uri": "single_exon_gene.sorted.gff.gz",
120
+ "locationType": "UriLocation"
121
+ },
122
+ "index": {
123
+ "location": {
124
+ "uri": "single_exon_gene.sorted.gff.gz.tbi",
125
+ "locationType": "UriLocation"
126
+ }
127
+ }
128
+ }
129
+ },
130
+ {
131
+ "trackId": "volvox.inv.vcf",
132
+ "attributesIndexed": ["Name", "ID", "Note"],
133
+ "excludedTypes": ["CDS", "exon"],
134
+ "adapterConf": {
135
+ "type": "VcfTabixAdapter",
136
+ "vcfGzLocation": {
137
+ "uri": "volvox.inv.vcf.gz",
138
+ "locationType": "UriLocation"
139
+ },
140
+ "index": {
141
+ "location": {
142
+ "uri": "volvox.inv.vcf.gz.tbi",
143
+ "locationType": "UriLocation"
144
+ },
145
+ "indexType": "TBI"
146
+ }
147
+ }
148
+ },
149
+ {
150
+ "trackId": "volvox.filtered.lowercase",
151
+ "attributesIndexed": ["Name", "ID", "Note"],
152
+ "excludedTypes": ["CDS", "exon"],
153
+ "adapterConf": {
154
+ "type": "VcfAdapter",
155
+ "vcfLocation": {
156
+ "uri": "volvox.filtered.lowercase.vcf",
157
+ "locationType": "UriLocation"
158
+ }
159
+ }
160
+ }
161
+ ],
162
+ "assemblyNames": ["volvox"]
163
+ }
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
6
-
7
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
8
-
9
- var _BaseResults = _interopRequireDefault(require("@jbrowse/core/TextSearch/BaseResults"));
10
-
11
- var _path = _interopRequireDefault(require("path"));
12
-
13
- var _TrixTextSearchAdapter = _interopRequireDefault(require("./TrixTextSearchAdapter"));
14
-
15
- var _configSchema = _interopRequireDefault(require("./configSchema"));
16
-
17
- test('adapter can fetch output files', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
18
- var rootTemplate, urlPath, args, adapter, results, results2, test2;
19
- return _regenerator.default.wrap(function _callee$(_context) {
20
- while (1) {
21
- switch (_context.prev = _context.next) {
22
- case 0:
23
- rootTemplate = _path.default.join(__dirname, '..', '..', '..', '..', 'test_data', 'volvox', 'trix').replace(/\\/g, '\\\\');
24
- urlPath = decodeURI(new URL("file://".concat(rootTemplate)).href);
25
- args = {
26
- type: 'TrixTextSearchAdapter',
27
- textSearchAdapterId: 'TrixTextSearchAdapterTest',
28
- ixFilePath: {
29
- uri: "".concat(urlPath, "/volvox.ix"),
30
- locationType: 'UriLocation'
31
- },
32
- ixxFilePath: {
33
- uri: "".concat(urlPath, "/volvox.ixx"),
34
- locationType: 'UriLocation'
35
- },
36
- metaFilePath: {
37
- uri: "".concat(urlPath, "/volvox_meta.json"),
38
- locationType: 'UriLocation'
39
- }
40
- }; // create adapter
41
-
42
- adapter = new _TrixTextSearchAdapter.default(_configSchema.default.create(args)); // prefix search
43
-
44
- _context.next = 6;
45
- return adapter.searchIndex({
46
- queryString: 'apple'
47
- });
48
-
49
- case 6:
50
- results = _context.sent;
51
- // check results are of type BaseResult for prefix search
52
- expect(results[0] instanceof _BaseResults.default).toBeTruthy();
53
- expect(results[0].getLabel()).toEqual('Apple2');
54
- expect(results[1].getLabel()).toEqual('Apple3'); // exact search
55
-
56
- _context.next = 12;
57
- return adapter.searchIndex({
58
- queryString: 'apple3'
59
- });
60
-
61
- case 12:
62
- results2 = _context.sent;
63
- // check results are of type location for exact search
64
- expect(results2.length).toEqual(1);
65
- test2 = results2[0];
66
- expect(test2 instanceof _BaseResults.default).toBeTruthy();
67
- expect(test2.getLabel()).toEqual('Apple3');
68
- expect(test2.getLocation()).toEqual('ctgA:17400..23000');
69
-
70
- case 18:
71
- case "end":
72
- return _context.stop();
73
- }
74
- }
75
- }, _callee);
76
- })));