@jbrowse/plugin-rdf 2.6.1 → 2.6.2
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/SPARQLAdapter/SPARQLAdapter.js +0 -1
- package/dist/SPARQLAdapter/configSchema.js +0 -1
- package/dist/SPARQLAdapter/index.js +0 -1
- package/dist/index.js +0 -1
- package/esm/SPARQLAdapter/SPARQLAdapter.js +0 -1
- package/esm/SPARQLAdapter/configSchema.js +0 -1
- package/esm/SPARQLAdapter/index.js +0 -1
- package/esm/index.js +0 -1
- package/package.json +3 -4
- package/dist/SPARQLAdapter/SPARQLAdapter.js.map +0 -1
- package/dist/SPARQLAdapter/configSchema.js.map +0 -1
- package/dist/SPARQLAdapter/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/esm/SPARQLAdapter/SPARQLAdapter.js.map +0 -1
- package/esm/SPARQLAdapter/configSchema.js.map +0 -1
- package/esm/SPARQLAdapter/index.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/src/SPARQLAdapter/README.md +0 -115
- package/src/SPARQLAdapter/SPARQLAdapter.test.ts +0 -84
- package/src/SPARQLAdapter/SPARQLAdapter.ts +0 -257
- package/src/SPARQLAdapter/__snapshots__/SPARQLAdapter.test.ts.snap +0 -449
- package/src/SPARQLAdapter/configSchema.ts +0 -40
- package/src/SPARQLAdapter/index.ts +0 -2
- package/src/SPARQLAdapter/test_data/emptyQueryResponse.json +0 -30
- package/src/SPARQLAdapter/test_data/queryResponse.json +0 -3834
- package/src/SPARQLAdapter/test_data/refNamesResponse.json +0 -114
- package/src/__snapshots__/index.test.ts.snap +0 -3
- package/src/index.test.ts +0 -18
- package/src/index.ts +0 -46
|
@@ -8,4 +8,3 @@ var SPARQLAdapter_1 = require("./SPARQLAdapter");
|
|
|
8
8
|
Object.defineProperty(exports, "AdapterClass", { enumerable: true, get: function () { return __importDefault(SPARQLAdapter_1).default; } });
|
|
9
9
|
var configSchema_1 = require("./configSchema");
|
|
10
10
|
Object.defineProperty(exports, "configSchema", { enumerable: true, get: function () { return __importDefault(configSchema_1).default; } });
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js
CHANGED
package/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-rdf",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"description": "JBrowse 2 RDF resources",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"main": "dist/index.js",
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
|
-
"src",
|
|
24
23
|
"esm"
|
|
25
24
|
],
|
|
26
25
|
"scripts": {
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
"useSrc": "node ../../scripts/useSrc.js",
|
|
34
33
|
"prebuild": "npm run clean",
|
|
35
34
|
"build:esm": "tsc --build tsconfig.build.esm.json",
|
|
36
|
-
"build:
|
|
35
|
+
"build:commonjs": "tsc --build tsconfig.build.commonjs.json",
|
|
37
36
|
"clean": "rimraf dist esm *.tsbuildinfo"
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
@@ -52,5 +51,5 @@
|
|
|
52
51
|
"publishConfig": {
|
|
53
52
|
"access": "public"
|
|
54
53
|
},
|
|
55
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "bbea587a402d9974acdd804a33f4b77f31a2fd5f"
|
|
56
55
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SPARQLAdapter.js","sourceRoot":"","sources":["../../src/SPARQLAdapter/SPARQLAdapter.ts"],"names":[],"mappings":";;;;;AAAA,yEAGgD;AAEhD,kDAA0D;AAC1D,qFAAyE;AACzE,sEAAoC;AAGpC,+DAA4D;AA0C5D,MAAqB,aAAc,SAAQ,oCAAsB;IAa/D,YACE,MA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E;KACzE;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,EAAE;QAChB,WAAW,EACT,gGAAgG;KACnG;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,EAAE;QAChB,WAAW,EACT,+DAA+D;KAClE;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/SPARQLAdapter/index.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAyD;AAAhD,8HAAA,OAAO,OAAgB;AAChC,+CAAwD;AAA/C,6HAAA,OAAO,OAAgB"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,kGAAyE;AACzE,kEAAyC;AAGzC,mDAGwB;AACxB,sDAAuE;AAEvE,MAAqB,SAAU,SAAQ,gBAAM;IAA7C;;QACE,SAAI,GAAG,WAAW,CAAA;IAkCpB,CAAC;IAhCC,OAAO,CAAC,aAA4B;QAClC,aAAa,CAAC,cAAc,CAC1B,GAAG,EAAE,CACH,IAAI,qBAAW,CAAC;YACd,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,gBAAgB;YAC7B,YAAY,EAAE,4BAAyB;YACvC,YAAY,EAAE,4BAAkB;SACjC,CAAC,CACL,CAAA;QACD,aAAa,CAAC,mBAAmB,CAC/B,8BAA8B,EAC9B,CAAC,cAA8B,EAAE,EAAE;YACjC,OAAO,CACL,IAAkB,EAClB,KAAoB,EACpB,WAAoB,EACpB,EAAE;gBACF,MAAM,UAAU,GAAG,YAAY,CAAA;gBAC/B,MAAM,WAAW,GAAG,eAAe,CAAA;gBACnC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAA;gBAClC,IAAI,UAAU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,QAAQ,CAAC,OAAO,CAAC,EAAE;YAClD,OAAO,KAAK,CAAA;SACb;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,aAAa,EAAC,gBAAgB,IAAS,CAAC;CAChD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/SPARQLAdapter/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,eAAe,mBAAmB,CAChC,eAAe,EACf;IACE,QAAQ,EAAE;QACR,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YACZ,GAAG,EAAE,6BAA6B;YAClC,YAAY,EAAE,aAAa;SAC5B;QACD,WAAW,EAAE,4BAA4B;KAC1C;IACD,aAAa,EAAE;QACb,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,EAAE;QAChB,WAAW,EACT,gFAAgF;KACnF;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,EAAE;QAChB,WAAW,EACT,sEAAsE;KACzE;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,EAAE;QAChB,WAAW,EACT,gGAAgG;KACnG;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,EAAE;QAChB,WAAW,EACT,+DAA+D;KAClE;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/SPARQLAdapter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
|
package/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version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can display genomic information stored in RDF data stores by accessing
|
|
4
|
-
them via a SPARQL endpoint. This is done by configuring a SPARQL adapter.
|
|
5
|
-
|
|
6
|
-
## Query template
|
|
7
|
-
|
|
8
|
-
The most basic configuration starts with a SPARQL query that returns features in
|
|
9
|
-
a genomic range, i.e. on a particular chromosome/contig and between a start and
|
|
10
|
-
end position. In such a query, replace the chromosome/contig name with
|
|
11
|
-
`{refName}` and the start and end with `{start}` and `{end}`. For example
|
|
12
|
-
|
|
13
|
-
```sparql
|
|
14
|
-
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
|
15
|
-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
|
16
|
-
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
|
|
17
|
-
PREFIX dc: <http://purl.org/dc/elements/1.1/>
|
|
18
|
-
|
|
19
|
-
SELECT DISTINCT ?gene (?id AS ?uniqueId) (?label AS ?name) (?desc AS ?note) ?strand ?start ?end
|
|
20
|
-
WHERE
|
|
21
|
-
{ VALUES ?location_type { faldo:ForwardStrandPosition faldo:ReverseStrandPosition faldo:BothStrandsPosition }
|
|
22
|
-
?location faldo:begin _:b0 .
|
|
23
|
-
_:b0 rdf:type ?location_type ;
|
|
24
|
-
faldo:position ?faldo_begin .
|
|
25
|
-
?location faldo:end _:b1 .
|
|
26
|
-
_:b1 rdf:type ?location_type ;
|
|
27
|
-
faldo:position ?faldo_end .
|
|
28
|
-
?location faldo:reference <http://rdf.ebi.ac.uk/resource/ensembl/97/homo_sapiens/GRCh38/{refName}> .
|
|
29
|
-
?gene rdf:type ?type ;
|
|
30
|
-
rdfs:label ?label ;
|
|
31
|
-
dc:description ?desc ;
|
|
32
|
-
dc:identifier ?id ;
|
|
33
|
-
faldo:location ?location
|
|
34
|
-
BIND(if(( ?location_type = faldo:ForwardStrandPosition ), 1, if(( ?location_type = faldo:ReverseStrandPosition ), -1, 0)) AS ?strand)
|
|
35
|
-
BIND(if(( ?strand = -1 ), ?faldo_end, ?faldo_begin) AS ?start)
|
|
36
|
-
BIND(if(( ?strand = -1 ), ?faldo_begin, ?faldo_end) AS ?end)
|
|
37
|
-
FILTER ( ( ?start >= {start} ) && ( ?end <= {end} ) )
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
The SELECT in the the query must provide at least the variables `?start`,
|
|
42
|
-
`?end`, and `?uniqueId`. Any other variables will be added to the feature data.
|
|
43
|
-
|
|
44
|
-
## Adding a track
|
|
45
|
-
|
|
46
|
-
From a JBrowse track selector, click the "+" icon and choose "Add track". When
|
|
47
|
-
asked for the location of the data source, enter the SPARQL endpoint. If the
|
|
48
|
-
endpoint ends with `/sparql`, JBrowse will automatically choose the SPARQL
|
|
49
|
-
adapter. If not, choose "SPARQL adapter" in the resulting dialog. (You can use
|
|
50
|
-
https://www.ebi.ac.uk/rdf/services/sparql as the endpoint to demonstrate the
|
|
51
|
-
above example.)
|
|
52
|
-
|
|
53
|
-
You will then be able to choose a track name and type as well as the assembly to
|
|
54
|
-
which the track should be added. BasicTrack is suggested for most
|
|
55
|
-
configurations, and using other track types is covered below. Click the "Add"
|
|
56
|
-
button to add the track.
|
|
57
|
-
|
|
58
|
-
Next, in the track selector click the settings icon next to the track which was
|
|
59
|
-
just added. Paste the query template (see above) in the "queryTemplate" section.
|
|
60
|
-
You can also configure other aspects of the track such as a description,
|
|
61
|
-
category, etc.
|
|
62
|
-
|
|
63
|
-
## Advanced configuration
|
|
64
|
-
|
|
65
|
-
### Subfeatures
|
|
66
|
-
|
|
67
|
-
There are two ways to provide subfeature information. The first is to include a
|
|
68
|
-
`?parentUniqueId` variable with a feature. It will be created as a subfeature of
|
|
69
|
-
the feature with a matching `?uniqueId`.
|
|
70
|
-
|
|
71
|
-
The second way is useful if a single query response line contains information
|
|
72
|
-
for more than one feature, e.g. gene, transcript, and exon information on a
|
|
73
|
-
single line. For this type of data prefix all variables for the subfeature with
|
|
74
|
-
`sub_`, which will allow you to define multiple features from the same line. It
|
|
75
|
-
also works for deeper nested features, too, by using `sub_sub_`, etc. Parent
|
|
76
|
-
features that are duplicated across lines will be resolved into a single
|
|
77
|
-
feature. For example, take the following SPARQL query result lines:
|
|
78
|
-
|
|
79
|
-
| uniqueId | type | start | end | sub_uniqueId | sub_type | sub_start | sub_end | sub_sub_uniqueId | sub_sub_type | sub_sub_start | sub_sub_end |
|
|
80
|
-
| ---------- | ---- | -------- | -------- | ---------------- | ---------- | --------- | -------- | ---------------- | ------------ | ------------- | ----------- |
|
|
81
|
-
| geneId0001 | gene | 10430102 | 10452003 | transcriptId0001 | transcript | 10430518 | 10442405 | exonId0001 | exon | 10430518 | 10430568 |
|
|
82
|
-
| geneId0001 | gene | 10430102 | 10452003 | transcriptId0001 | transcript | 10430518 | 10442405 | exonId0002 | exon | 10432568 | 10433965 |
|
|
83
|
-
|
|
84
|
-
These two lines will resolve into a singe feature "geneId0001" with one child
|
|
85
|
-
feature "transcriptId0001", which will then itself have two child features
|
|
86
|
-
"exonId0001" and "exonId0002".
|
|
87
|
-
|
|
88
|
-
### Additional query parameters
|
|
89
|
-
|
|
90
|
-
JBrowse will automatically send a header stating that it expects responses to be
|
|
91
|
-
in the `application/json` or `application/sparql-results+json` format. Some
|
|
92
|
-
SPARQL endpoints, however, require additional query parameters to be passed in
|
|
93
|
-
order for the results be returned in JSON format, for example `format=json`.
|
|
94
|
-
These can be added to the "additionalQueryParams" section and will be appended
|
|
95
|
-
to each SPARQL request.
|
|
96
|
-
|
|
97
|
-
### Reference sequence renaming
|
|
98
|
-
|
|
99
|
-
In order for the track to take advantage of JBrowse's reference name aliasing,
|
|
100
|
-
it must know what reference name the SPARQL store uses. These can be entered in
|
|
101
|
-
one of two ways. The first is by entering a SPARQL query in the
|
|
102
|
-
"refNamesQueryTemplate" config section. This query should return a line for each
|
|
103
|
-
reference name in a `refName` column.
|
|
104
|
-
|
|
105
|
-
The second option is to enumerate the reference names explicitly in the
|
|
106
|
-
"refNames" config section. These will be ignored if a "refNamesQueryTemplate" is
|
|
107
|
-
defined.
|
|
108
|
-
|
|
109
|
-
### Other track types
|
|
110
|
-
|
|
111
|
-
BasicTracks are flexible because they don't require any additional information,
|
|
112
|
-
any any additional info provided in the query is just added to the feature. You
|
|
113
|
-
can use other tracks as well, though, as long as you make sure the SPARQL query
|
|
114
|
-
provides any info the track requires. For example, if you want to use a
|
|
115
|
-
VariantTrack, the SPARQL query must provide REF, ALT, QUAL, etc.
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { toArray } from 'rxjs/operators'
|
|
2
|
-
import 'whatwg-fetch'
|
|
3
|
-
import Adapter from './SPARQLAdapter'
|
|
4
|
-
import emptyQueryResponse from './test_data/emptyQueryResponse.json'
|
|
5
|
-
import queryResponse from './test_data/queryResponse.json'
|
|
6
|
-
import refNamesResponse from './test_data/refNamesResponse.json'
|
|
7
|
-
|
|
8
|
-
import configSchema from './configSchema'
|
|
9
|
-
|
|
10
|
-
// window.fetch = jest.fn(url => new Promise(resolve => resolve()))
|
|
11
|
-
|
|
12
|
-
test('adapter can fetch variants from volvox.vcf.gz', async () => {
|
|
13
|
-
function mockFetch(url: RequestInfo | URL) {
|
|
14
|
-
let response = {}
|
|
15
|
-
if (`${url}`.includes('chr1')) {
|
|
16
|
-
response = queryResponse
|
|
17
|
-
}
|
|
18
|
-
if (`${url}`.includes('chr80')) {
|
|
19
|
-
response = emptyQueryResponse
|
|
20
|
-
} else if (`${url}`.includes('fakeRefNamesQuery')) {
|
|
21
|
-
response = refNamesResponse
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return Promise.resolve(new Response(JSON.stringify(response)))
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const spy = jest.spyOn(global, 'fetch')
|
|
28
|
-
spy.mockImplementation(mockFetch)
|
|
29
|
-
const adapter = new Adapter(
|
|
30
|
-
configSchema.create({
|
|
31
|
-
endpoint: {
|
|
32
|
-
uri: 'http://somesite.com/sparql',
|
|
33
|
-
locationType: 'UriLocation',
|
|
34
|
-
},
|
|
35
|
-
queryTemplate: 'fakeSPARQLQuery-start{start}-end{end}-{refName}',
|
|
36
|
-
refNamesQueryTemplate: 'fakeRefNamesQuery',
|
|
37
|
-
additionalQueryParams: ['format=json'],
|
|
38
|
-
refNames: [],
|
|
39
|
-
}),
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
const refNames = await adapter.getRefNames()
|
|
43
|
-
expect(spy).toHaveBeenLastCalledWith(
|
|
44
|
-
'http://somesite.com/sparql?query=fakeRefNamesQuery&format=json',
|
|
45
|
-
{
|
|
46
|
-
headers: { accept: 'application/json,application/sparql-results+json' },
|
|
47
|
-
signal: undefined,
|
|
48
|
-
},
|
|
49
|
-
)
|
|
50
|
-
expect(refNames.length).toBe(17)
|
|
51
|
-
expect(refNames[0]).toBe('NC_004353.4')
|
|
52
|
-
|
|
53
|
-
const features = adapter.getFeatures({
|
|
54
|
-
refName: 'chr1',
|
|
55
|
-
start: 0,
|
|
56
|
-
end: 20000,
|
|
57
|
-
})
|
|
58
|
-
const featuresArray = await features.pipe(toArray()).toPromise()
|
|
59
|
-
expect(featuresArray).toMatchSnapshot()
|
|
60
|
-
expect(spy).toHaveBeenLastCalledWith(
|
|
61
|
-
'http://somesite.com/sparql?query=fakeSPARQLQuery-start0-end20000-chr1&format=json',
|
|
62
|
-
{
|
|
63
|
-
headers: { accept: 'application/json,application/sparql-results+json' },
|
|
64
|
-
signal: undefined,
|
|
65
|
-
},
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
const featuresNonExist = adapter.getFeatures({
|
|
69
|
-
refName: 'chr80',
|
|
70
|
-
start: 0,
|
|
71
|
-
end: 20000,
|
|
72
|
-
})
|
|
73
|
-
const featuresArrayNonExist = await featuresNonExist
|
|
74
|
-
.pipe(toArray())
|
|
75
|
-
.toPromise()
|
|
76
|
-
expect(featuresArrayNonExist).toEqual([])
|
|
77
|
-
expect(spy).toHaveBeenLastCalledWith(
|
|
78
|
-
'http://somesite.com/sparql?query=fakeSPARQLQuery-start0-end20000-chr80&format=json',
|
|
79
|
-
{
|
|
80
|
-
headers: { accept: 'application/json,application/sparql-results+json' },
|
|
81
|
-
signal: undefined,
|
|
82
|
-
},
|
|
83
|
-
)
|
|
84
|
-
})
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BaseFeatureDataAdapter,
|
|
3
|
-
BaseOptions,
|
|
4
|
-
} from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
5
|
-
import { NoAssemblyRegion } from '@jbrowse/core/util/types'
|
|
6
|
-
import { ObservableCreate } from '@jbrowse/core/util/rxjs'
|
|
7
|
-
import SimpleFeature, { Feature } from '@jbrowse/core/util/simpleFeature'
|
|
8
|
-
import format from 'string-template'
|
|
9
|
-
|
|
10
|
-
import { Instance } from 'mobx-state-tree'
|
|
11
|
-
import { readConfObject } from '@jbrowse/core/configuration'
|
|
12
|
-
import MyConfigSchema from './configSchema'
|
|
13
|
-
import PluginManager from '@jbrowse/core/PluginManager'
|
|
14
|
-
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache'
|
|
15
|
-
|
|
16
|
-
interface SPARQLEntry {
|
|
17
|
-
type: string
|
|
18
|
-
value: string
|
|
19
|
-
dataTypes?: string
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface SPARQLBinding {
|
|
23
|
-
[key: string]: SPARQLEntry
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface SPARQLResponseHead {
|
|
27
|
-
vars: string[]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface SPARQLResponseResults {
|
|
31
|
-
bindings: SPARQLBinding[]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface SPARQLResponse {
|
|
35
|
-
head: SPARQLResponseHead
|
|
36
|
-
results: SPARQLResponseResults
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface SPARQLFeatureData {
|
|
40
|
-
start: number
|
|
41
|
-
end: number
|
|
42
|
-
strand: number
|
|
43
|
-
subfeatures?: SPARQLFeatureData[]
|
|
44
|
-
uniqueId: string
|
|
45
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
-
[propName: string]: any
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
interface SPARQLFeature {
|
|
50
|
-
data: SPARQLFeatureData
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default class SPARQLAdapter extends BaseFeatureDataAdapter {
|
|
54
|
-
private endpoint: string
|
|
55
|
-
|
|
56
|
-
private queryTemplate: string
|
|
57
|
-
|
|
58
|
-
private refNamesQueryTemplate: string
|
|
59
|
-
|
|
60
|
-
private additionalQueryParams: string[]
|
|
61
|
-
|
|
62
|
-
private configRefNames: string[]
|
|
63
|
-
|
|
64
|
-
private refNames: string[] | undefined
|
|
65
|
-
|
|
66
|
-
public constructor(
|
|
67
|
-
config: Instance<typeof MyConfigSchema>,
|
|
68
|
-
getSubAdapter?: getSubAdapterType,
|
|
69
|
-
pluginManager?: PluginManager,
|
|
70
|
-
) {
|
|
71
|
-
super(config, getSubAdapter, pluginManager)
|
|
72
|
-
this.endpoint = readConfObject(config, 'endpoint').uri
|
|
73
|
-
this.queryTemplate = readConfObject(config, 'queryTemplate')
|
|
74
|
-
this.additionalQueryParams = readConfObject(config, 'additionalQueryParams')
|
|
75
|
-
this.refNamesQueryTemplate = readConfObject(config, 'refNamesQueryTemplate')
|
|
76
|
-
this.configRefNames = readConfObject(config, 'refNames')
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public async getRefNames(opts: BaseOptions = {}): Promise<string[]> {
|
|
80
|
-
if (this.refNames) {
|
|
81
|
-
return this.refNames
|
|
82
|
-
}
|
|
83
|
-
let refNames = [] as string[]
|
|
84
|
-
if (this.refNamesQueryTemplate) {
|
|
85
|
-
const queryTemplate = encodeURIComponent(this.refNamesQueryTemplate)
|
|
86
|
-
const results = await this.querySparql(queryTemplate, opts)
|
|
87
|
-
refNames = this.resultsToRefNames(results)
|
|
88
|
-
} else if (this.configRefNames) {
|
|
89
|
-
refNames = this.configRefNames
|
|
90
|
-
}
|
|
91
|
-
this.refNames = refNames
|
|
92
|
-
return refNames
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
public getFeatures(query: NoAssemblyRegion, opts: BaseOptions = {}) {
|
|
96
|
-
return ObservableCreate<Feature>(async observer => {
|
|
97
|
-
const filledTemplate = encodeURIComponent(
|
|
98
|
-
format(this.queryTemplate, query),
|
|
99
|
-
)
|
|
100
|
-
const { refName } = query
|
|
101
|
-
const results = await this.querySparql(filledTemplate, opts)
|
|
102
|
-
this.resultsToFeatures(results, refName).forEach(feature => {
|
|
103
|
-
observer.next(feature)
|
|
104
|
-
})
|
|
105
|
-
observer.complete()
|
|
106
|
-
}, opts.signal)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
|
-
private async querySparql(query: string, opts?: BaseOptions): Promise<any> {
|
|
111
|
-
let additionalQueryParams = ''
|
|
112
|
-
if (this.additionalQueryParams.length) {
|
|
113
|
-
additionalQueryParams = `&${this.additionalQueryParams.join('&')}`
|
|
114
|
-
}
|
|
115
|
-
const signal = opts && opts.signal
|
|
116
|
-
const response = await fetch(
|
|
117
|
-
`${this.endpoint}?query=${query}${additionalQueryParams}`,
|
|
118
|
-
{
|
|
119
|
-
headers: { accept: 'application/json,application/sparql-results+json' },
|
|
120
|
-
signal,
|
|
121
|
-
},
|
|
122
|
-
)
|
|
123
|
-
return response.json()
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
private resultsToRefNames(response: SPARQLResponse): string[] {
|
|
127
|
-
const rows = ((response || {}).results || {}).bindings || []
|
|
128
|
-
if (!rows.length) {
|
|
129
|
-
return []
|
|
130
|
-
}
|
|
131
|
-
const fields = response.head.vars
|
|
132
|
-
if (!fields.includes('refName')) {
|
|
133
|
-
throw new Error('"refName" not found in refNamesQueryTemplate response')
|
|
134
|
-
}
|
|
135
|
-
return rows.map(row => row.refName.value)
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
private resultsToFeatures(
|
|
139
|
-
results: SPARQLResponse,
|
|
140
|
-
refName: string,
|
|
141
|
-
): SimpleFeature[] {
|
|
142
|
-
const rows = ((results || {}).results || {}).bindings || []
|
|
143
|
-
if (!rows.length) {
|
|
144
|
-
return []
|
|
145
|
-
}
|
|
146
|
-
const fields = results.head.vars
|
|
147
|
-
const requiredFields = ['start', 'end', 'uniqueId']
|
|
148
|
-
requiredFields.forEach(requiredField => {
|
|
149
|
-
if (!fields.includes(requiredField)) {
|
|
150
|
-
console.error(
|
|
151
|
-
`Required field ${requiredField} missing from feature data`,
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
})
|
|
155
|
-
const seenFeatures: Record<string, SPARQLFeature> = {}
|
|
156
|
-
rows.forEach(row => {
|
|
157
|
-
const rawData: Record<string, string>[] = [{}]
|
|
158
|
-
fields.forEach(field => {
|
|
159
|
-
if (field in row) {
|
|
160
|
-
const { value } = row[field]
|
|
161
|
-
let idx = 0
|
|
162
|
-
while (field.startsWith('sub_')) {
|
|
163
|
-
field = field.slice(4)
|
|
164
|
-
idx += 1
|
|
165
|
-
}
|
|
166
|
-
while (idx > rawData.length - 1) {
|
|
167
|
-
rawData.push({})
|
|
168
|
-
}
|
|
169
|
-
rawData[idx][field] = value
|
|
170
|
-
}
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
rawData.forEach((rd, idx) => {
|
|
174
|
-
const { uniqueId } = rd
|
|
175
|
-
if (idx < rawData.length - 1) {
|
|
176
|
-
rawData[idx + 1].parentUniqueId = uniqueId
|
|
177
|
-
}
|
|
178
|
-
seenFeatures[uniqueId] = {
|
|
179
|
-
data: {
|
|
180
|
-
...rd,
|
|
181
|
-
uniqueId,
|
|
182
|
-
refName,
|
|
183
|
-
start: parseInt(rd.start, 10),
|
|
184
|
-
end: parseInt(rd.end, 10),
|
|
185
|
-
strand: parseInt(rd.strand, 10) || 0,
|
|
186
|
-
},
|
|
187
|
-
}
|
|
188
|
-
})
|
|
189
|
-
})
|
|
190
|
-
|
|
191
|
-
// resolve subfeatures, keeping only top-level features in seenFeatures
|
|
192
|
-
for (const [uniqueId, f] of Object.entries(seenFeatures)) {
|
|
193
|
-
const pid = f.data.parentUniqueId
|
|
194
|
-
delete f.data.parentUniqueId
|
|
195
|
-
if (pid) {
|
|
196
|
-
const p = seenFeatures[pid]
|
|
197
|
-
if (p) {
|
|
198
|
-
if (!p.data.subfeatures) {
|
|
199
|
-
p.data.subfeatures = []
|
|
200
|
-
}
|
|
201
|
-
p.data.subfeatures.push({
|
|
202
|
-
...f.data,
|
|
203
|
-
uniqueId,
|
|
204
|
-
})
|
|
205
|
-
delete seenFeatures[uniqueId]
|
|
206
|
-
} else {
|
|
207
|
-
const subfeatures = Object.values(seenFeatures)
|
|
208
|
-
.map(sf => sf.data.subfeatures)
|
|
209
|
-
.filter(sf => !!sf)
|
|
210
|
-
.flat()
|
|
211
|
-
let found = false
|
|
212
|
-
for (const subfeature of subfeatures) {
|
|
213
|
-
if (subfeature && subfeature.uniqueId === pid) {
|
|
214
|
-
if (!subfeature.subfeatures) {
|
|
215
|
-
subfeature.subfeatures = []
|
|
216
|
-
}
|
|
217
|
-
subfeature.subfeatures.push({
|
|
218
|
-
...f.data,
|
|
219
|
-
uniqueId,
|
|
220
|
-
})
|
|
221
|
-
delete seenFeatures[uniqueId]
|
|
222
|
-
found = true
|
|
223
|
-
break
|
|
224
|
-
} else if (subfeature && subfeature.subfeatures) {
|
|
225
|
-
subfeatures.push(...subfeature.subfeatures)
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
if (!found) {
|
|
229
|
-
console.error(`Could not find parentID ${pid}`)
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return Object.keys(seenFeatures).map(
|
|
236
|
-
seenFeature =>
|
|
237
|
-
new SimpleFeature({
|
|
238
|
-
...seenFeatures[seenFeature].data,
|
|
239
|
-
uniqueId: seenFeature,
|
|
240
|
-
subfeatures: seenFeatures[seenFeature].data.subfeatures,
|
|
241
|
-
}),
|
|
242
|
-
)
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
public async hasDataForRefName(
|
|
246
|
-
refName: string,
|
|
247
|
-
opts: BaseOptions = {},
|
|
248
|
-
): Promise<boolean> {
|
|
249
|
-
const refNames = await this.getRefNames(opts)
|
|
250
|
-
if (refNames.length && !refNames.includes(refName)) {
|
|
251
|
-
return false
|
|
252
|
-
}
|
|
253
|
-
return true
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
public freeResources(/* { region } */): void {}
|
|
257
|
-
}
|