p2s_mapper 1.4.0 → 2.0.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/README.md +214 -32
- package/dist/coordinates.d.ts +8 -6
- package/dist/coordinates.js.map +1 -1
- package/dist/dbIds.d.ts +1 -2
- package/dist/extractPerResidueConfidence.d.ts +1 -2
- package/dist/extractStructureSequences.d.ts +14 -15
- package/dist/fetchUtils.js +19 -1
- package/dist/fetchUtils.js.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/isoformRanking.d.ts +3 -0
- package/dist/pairwiseAlignment.d.ts +1 -2
- package/dist/pdbEntry.d.ts +32 -0
- package/dist/pdbEntry.js +182 -0
- package/dist/pdbEntry.js.map +1 -0
- package/dist/pdbUniProtMapping.d.ts +9 -33
- package/dist/pdbUniProtMapping.js +17 -134
- package/dist/pdbUniProtMapping.js.map +1 -1
- package/dist/structureSources.d.ts +37 -13
- package/dist/structureSources.js +144 -57
- package/dist/structureSources.js.map +1 -1
- package/dist/structureUrls.d.ts +2 -0
- package/dist/structureUrls.js +11 -0
- package/dist/structureUrls.js.map +1 -1
- package/esm/coordinates.d.ts +8 -6
- package/esm/coordinates.js.map +1 -1
- package/esm/dbIds.d.ts +1 -2
- package/esm/extractPerResidueConfidence.d.ts +1 -2
- package/esm/extractStructureSequences.d.ts +14 -15
- package/esm/fetchUtils.js +19 -1
- package/esm/fetchUtils.js.map +1 -1
- package/esm/index.d.ts +1 -3
- package/esm/index.js +2 -4
- package/esm/index.js.map +1 -1
- package/esm/isoformRanking.d.ts +3 -0
- package/esm/pairwiseAlignment.d.ts +1 -2
- package/esm/pdbEntry.d.ts +32 -0
- package/esm/pdbEntry.js +174 -0
- package/esm/pdbEntry.js.map +1 -0
- package/esm/pdbUniProtMapping.d.ts +9 -33
- package/esm/pdbUniProtMapping.js +17 -131
- package/esm/pdbUniProtMapping.js.map +1 -1
- package/esm/structureSources.d.ts +37 -13
- package/esm/structureSources.js +139 -55
- package/esm/structureSources.js.map +1 -1
- package/esm/structureUrls.d.ts +2 -0
- package/esm/structureUrls.js +9 -0
- package/esm/structureUrls.js.map +1 -1
- package/package.json +3 -2
- package/src/coordinates.ts +3 -4
- package/src/dbIds.ts +1 -1
- package/src/extractPerResidueConfidence.ts +1 -1
- package/src/extractStructureSequences.ts +14 -14
- package/src/fetchUtils.ts +23 -1
- package/src/index.ts +2 -4
- package/src/isoformRanking.ts +3 -3
- package/src/pairwiseAlignment.ts +1 -1
- package/src/pdbEntry.ts +240 -0
- package/src/pdbUniProtMapping.ts +20 -158
- package/src/structureSources.ts +194 -70
- package/src/structureUrls.ts +11 -0
- package/dist/pdbeBestStructures.d.ts +0 -23
- package/dist/pdbeBestStructures.js +0 -79
- package/dist/pdbeBestStructures.js.map +0 -1
- package/dist/pdbeEntryMolecules.d.ts +0 -7
- package/dist/pdbeEntryMolecules.js +0 -39
- package/dist/pdbeEntryMolecules.js.map +0 -1
- package/dist/siftsNumbering.d.ts +0 -23
- package/dist/siftsNumbering.js +0 -44
- package/dist/siftsNumbering.js.map +0 -1
- package/esm/pdbeBestStructures.d.ts +0 -23
- package/esm/pdbeBestStructures.js +0 -73
- package/esm/pdbeBestStructures.js.map +0 -1
- package/esm/pdbeEntryMolecules.d.ts +0 -7
- package/esm/pdbeEntryMolecules.js +0 -35
- package/esm/pdbeEntryMolecules.js.map +0 -1
- package/esm/siftsNumbering.d.ts +0 -23
- package/esm/siftsNumbering.js +0 -40
- package/esm/siftsNumbering.js.map +0 -1
- package/src/pdbeBestStructures.ts +0 -94
- package/src/pdbeEntryMolecules.ts +0 -37
- package/src/siftsNumbering.ts +0 -61
package/dist/structureSources.js
CHANGED
|
@@ -1,87 +1,174 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// The experimental structures
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
// crystal structure beside a prediction without a PDB search of
|
|
6
|
-
// the entry id from here and ask `
|
|
2
|
+
// The experimental structures RCSB aligns to a UniProt entry: every PDB entity
|
|
3
|
+
// carrying the accession, with the UniProt range it covers, then each entry's
|
|
4
|
+
// method, resolution and chains. Two CORS-enabled calls, which is what lets a
|
|
5
|
+
// page offer a crystal structure beside a prediction without a PDB search of
|
|
6
|
+
// its own; take the entry id from here and ask `fetchPdbEntry` for its
|
|
7
7
|
// residue mapping.
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
9
|
+
exports.ENTITY_DETAILS_QUERY = exports.RCSB_SEQUENCE_COORDINATES_URL = void 0;
|
|
10
|
+
exports.entityAlignmentsQuery = entityAlignmentsQuery;
|
|
11
|
+
exports.parseEntityAlignments = parseEntityAlignments;
|
|
12
|
+
exports.parseEntityDetails = parseEntityDetails;
|
|
13
|
+
exports.experimentalStructures = experimentalStructures;
|
|
11
14
|
exports.fetchExperimentalStructures = fetchExperimentalStructures;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const pdbEntry_ts_1 = require("./pdbEntry.js");
|
|
16
|
+
const structureUrls_ts_1 = require("./structureUrls.js");
|
|
17
|
+
exports.RCSB_SEQUENCE_COORDINATES_URL = 'https://sequence-coordinates.rcsb.org/graphql';
|
|
18
|
+
function entityAlignmentsQuery(uniprotId) {
|
|
19
|
+
return `{ alignments(from: UNIPROT, to: PDB_ENTITY, queryId: "${uniprotId}") {
|
|
20
|
+
target_alignments {
|
|
21
|
+
target_id
|
|
22
|
+
coverage { query_coverage }
|
|
23
|
+
aligned_regions { query_begin query_end }
|
|
24
|
+
}
|
|
25
|
+
} }`;
|
|
18
26
|
}
|
|
27
|
+
exports.ENTITY_DETAILS_QUERY = `query($ids: [String!]!) { polymer_entities(entity_ids: $ids) {
|
|
28
|
+
rcsb_id
|
|
29
|
+
rcsb_polymer_entity_container_identifiers { auth_asym_ids }
|
|
30
|
+
entry { rcsb_entry_info { experimental_method resolution_combined } }
|
|
31
|
+
} }`;
|
|
32
|
+
// RCSB's cap on ids per batch request
|
|
33
|
+
const DETAILS_BATCH = 1000;
|
|
19
34
|
function isRecord(value) {
|
|
20
35
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
21
36
|
}
|
|
22
37
|
function finiteNumber(value) {
|
|
23
38
|
return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
24
39
|
}
|
|
40
|
+
function strings(value) {
|
|
41
|
+
return Array.isArray(value)
|
|
42
|
+
? value.filter((v) => typeof v === 'string')
|
|
43
|
+
: [];
|
|
44
|
+
}
|
|
25
45
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* prediction comes from AlphaFold's own API, which answers per model. And
|
|
30
|
-
* 3D-Beacons files SASBDB's small-angle-scattering fits under "experimentally
|
|
31
|
-
* determined" too, with numeric ids and near-full coverage — dystrophin's best
|
|
32
|
-
* "structure" by coverage was SASBDB 436 — which are not entries a residue
|
|
33
|
-
* mapping exists for. Hence the `provider === 'PDBe'` gate rather than the
|
|
34
|
-
* category alone.
|
|
46
|
+
* PDB entities only: the same list carries RCSB's computed models
|
|
47
|
+
* (`AF_AFP04637F1_1`), which a residue mapping does not exist for. The range
|
|
48
|
+
* spans every aligned region, as 3D-Beacons reported it.
|
|
35
49
|
*/
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
|
|
50
|
+
function parseEntityAlignments(data) {
|
|
51
|
+
const alignments = isRecord(data) ? data.alignments : undefined;
|
|
52
|
+
const targets = isRecord(alignments)
|
|
53
|
+
? alignments.target_alignments
|
|
54
|
+
: undefined;
|
|
55
|
+
if (!Array.isArray(targets)) {
|
|
39
56
|
return [];
|
|
40
57
|
}
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
const s = isRecord(entry) ? entry.summary : undefined;
|
|
44
|
-
if (!isRecord(s)) {
|
|
58
|
+
return targets.flatMap(target => {
|
|
59
|
+
if (!isRecord(target) || typeof target.target_id !== 'string') {
|
|
45
60
|
return [];
|
|
46
61
|
}
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
const [pdbId] = target.target_id.split('_');
|
|
63
|
+
const coverage = isRecord(target.coverage)
|
|
64
|
+
? finiteNumber(target.coverage.query_coverage)
|
|
65
|
+
: undefined;
|
|
66
|
+
const regions = Array.isArray(target.aligned_regions)
|
|
67
|
+
? target.aligned_regions.filter(isRecord)
|
|
68
|
+
: [];
|
|
69
|
+
const begins = regions.map(r => finiteNumber(r.query_begin));
|
|
70
|
+
const ends = regions.map(r => finiteNumber(r.query_end));
|
|
71
|
+
return pdbId !== undefined &&
|
|
72
|
+
(0, structureUrls_ts_1.isPdbId)(pdbId) &&
|
|
73
|
+
coverage !== undefined &&
|
|
74
|
+
begins.length > 0 &&
|
|
75
|
+
begins.every(b => b !== undefined) &&
|
|
76
|
+
ends.every(e => e !== undefined)
|
|
56
77
|
? [
|
|
57
78
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
resolution: finiteNumber(s.resolution),
|
|
63
|
-
start,
|
|
64
|
-
end,
|
|
79
|
+
entityId: target.target_id,
|
|
80
|
+
pdbId: pdbId.toLowerCase(),
|
|
81
|
+
start: Math.min(...begins),
|
|
82
|
+
end: Math.max(...ends),
|
|
65
83
|
coverage,
|
|
66
84
|
},
|
|
67
85
|
]
|
|
68
86
|
: [];
|
|
69
|
-
})
|
|
70
|
-
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function parseEntityDetails(data) {
|
|
90
|
+
const entities = isRecord(data) ? data.polymer_entities : undefined;
|
|
91
|
+
const details = new Map();
|
|
92
|
+
for (const entity of Array.isArray(entities) ? entities : []) {
|
|
93
|
+
if (!isRecord(entity) || typeof entity.rcsb_id !== 'string') {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const ids = entity.rcsb_polymer_entity_container_identifiers;
|
|
97
|
+
const info = isRecord(entity.entry)
|
|
98
|
+
? entity.entry.rcsb_entry_info
|
|
99
|
+
: undefined;
|
|
100
|
+
const resolutions = isRecord(info) ? info.resolution_combined : undefined;
|
|
101
|
+
const resolution = Array.isArray(resolutions)
|
|
102
|
+
? finiteNumber(resolutions[0])
|
|
103
|
+
: undefined;
|
|
104
|
+
details.set(entity.rcsb_id, {
|
|
105
|
+
method: isRecord(info) && typeof info.experimental_method === 'string'
|
|
106
|
+
? info.experimental_method
|
|
107
|
+
: 'experimental',
|
|
108
|
+
...(resolution === undefined ? {} : { resolution }),
|
|
109
|
+
chains: strings(isRecord(ids) ? ids.auth_asym_ids : undefined),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return details;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* One row per entry, best coverage first and sharpest within a tie. An entry
|
|
116
|
+
* with several entities of the protein (a construct crystallised beside a
|
|
117
|
+
* different fragment of itself) takes the best-covering entity's range and
|
|
118
|
+
* every entity's chains.
|
|
119
|
+
*/
|
|
120
|
+
function experimentalStructures(alignments, details) {
|
|
121
|
+
const byEntry = new Map();
|
|
122
|
+
for (const a of alignments) {
|
|
123
|
+
const d = details.get(a.entityId);
|
|
124
|
+
if (!d) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const existing = byEntry.get(a.pdbId);
|
|
128
|
+
if (!existing) {
|
|
129
|
+
byEntry.set(a.pdbId, {
|
|
130
|
+
pdbId: a.pdbId,
|
|
131
|
+
method: d.method,
|
|
132
|
+
...(d.resolution === undefined ? {} : { resolution: d.resolution }),
|
|
133
|
+
start: a.start,
|
|
134
|
+
end: a.end,
|
|
135
|
+
coverage: a.coverage,
|
|
136
|
+
chains: [...d.chains],
|
|
137
|
+
});
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
for (const chain of d.chains) {
|
|
141
|
+
if (!existing.chains.includes(chain)) {
|
|
142
|
+
existing.chains.push(chain);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (a.coverage > existing.coverage) {
|
|
146
|
+
Object.assign(existing, {
|
|
147
|
+
start: a.start,
|
|
148
|
+
end: a.end,
|
|
149
|
+
coverage: a.coverage,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return [...byEntry.values()].sort((a, b) => b.coverage - a.coverage ||
|
|
71
154
|
(a.resolution ?? Infinity) - (b.resolution ?? Infinity));
|
|
72
155
|
}
|
|
73
|
-
|
|
74
|
-
|
|
156
|
+
const ISOFORM_SUFFIX = /-\d+$/;
|
|
157
|
+
/**
|
|
158
|
+
* Every PDB entry aligned to the accession. An accession with none, or one
|
|
159
|
+
* RCSB does not know, is `[]`; an isoform accession is asked as its entry,
|
|
160
|
+
* which is what the alignment is numbered on.
|
|
161
|
+
*/
|
|
75
162
|
async function fetchExperimentalStructures(uniprotId, opts) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
163
|
+
const alignments = parseEntityAlignments(await (0, pdbEntry_ts_1.graphqlFetch)(exports.RCSB_SEQUENCE_COORDINATES_URL, entityAlignmentsQuery(uniprotId.replace(ISOFORM_SUFFIX, '')), undefined, opts));
|
|
164
|
+
const ids = alignments.map(a => a.entityId);
|
|
165
|
+
const details = new Map();
|
|
166
|
+
for (let i = 0; i < ids.length; i += DETAILS_BATCH) {
|
|
167
|
+
const batch = parseEntityDetails(await (0, pdbEntry_ts_1.graphqlFetch)(pdbEntry_ts_1.RCSB_DATA_GRAPHQL_URL, exports.ENTITY_DETAILS_QUERY, { ids: ids.slice(i, i + DETAILS_BATCH) }, opts));
|
|
168
|
+
for (const [id, d] of batch) {
|
|
169
|
+
details.set(id, d);
|
|
83
170
|
}
|
|
84
171
|
}
|
|
85
|
-
return
|
|
172
|
+
return experimentalStructures(alignments, details);
|
|
86
173
|
}
|
|
87
174
|
//# sourceMappingURL=structureSources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structureSources.js","sourceRoot":"","sources":["../src/structureSources.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,
|
|
1
|
+
{"version":3,"file":"structureSources.js","sourceRoot":"","sources":["../src/structureSources.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,uEAAuE;AACvE,mBAAmB;;;AAyCnB,sDAQC;AA8BD,sDAsCC;AAED,gDAyBC;AAQD,wDAyCC;AASD,kEA4BC;AApOD,+CAAmE;AACnE,yDAA4C;AAI/B,QAAA,6BAA6B,GACxC,+CAA+C,CAAA;AAiCjD,SAAgB,qBAAqB,CAAC,SAAiB;IACrD,OAAO,yDAAyD,SAAS;;;;;;IAMvE,CAAA;AACJ,CAAC;AAEY,QAAA,oBAAoB,GAAG;;;;IAIhC,CAAA;AAEJ,sCAAsC;AACtC,MAAM,aAAa,GAAG,IAAI,CAAA;AAE1B,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC7E,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;AAChF,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CA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AAQ,CAAC,CAC1D,CAAA;AACH,CAAC;AAED,MAAM,cAAc,GAAG,OAAO,CAAA;AAE9B;;;;GAIG;AACI,KAAK,UAAU,2BAA2B,CAC/C,SAAiB,EACjB,IAAmB;IAEnB,MAAM,UAAU,GAAG,qBAAqB,CACtC,MAAM,IAAA,0BAAY,EAChB,qCAA6B,EAC7B,qBAAqB,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,EAC5D,SAAS,EACT,IAAI,CACL,CACF,CAAA;IACD,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyB,CAAA;IAChD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,aAAa,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,kBAAkB,CAC9B,MAAM,IAAA,0BAAY,EAChB,mCAAqB,EACrB,4BAAoB,EACpB,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,EAAE,EACxC,IAAI,CACL,CACF,CAAA;QACD,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QACpB,CAAC;IACH,CAAC;IACD,OAAO,sBAAsB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;AACpD,CAAC"}
|
package/dist/structureUrls.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare function uniprotEntryUrl(uniprotId: string): string;
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function getAlphaFoldStructureUrl(uniprotId: string, version?: string): string;
|
|
11
11
|
export declare function getPdbStructureUrl(pdbId: string): string;
|
|
12
|
+
export declare function isPdbId(value: string): boolean;
|
|
13
|
+
export declare function rcsbEntryUrl(pdbId: string): string;
|
|
12
14
|
/**
|
|
13
15
|
* Resolve the `{ pdbId }` shorthand to a concrete structure URL, so a
|
|
14
16
|
* hand-authored snapshot or a short launch URL doesn't have to know RCSB's
|
package/dist/structureUrls.js
CHANGED
|
@@ -8,6 +8,8 @@ exports.uniprotFastaUrl = uniprotFastaUrl;
|
|
|
8
8
|
exports.uniprotEntryUrl = uniprotEntryUrl;
|
|
9
9
|
exports.getAlphaFoldStructureUrl = getAlphaFoldStructureUrl;
|
|
10
10
|
exports.getPdbStructureUrl = getPdbStructureUrl;
|
|
11
|
+
exports.isPdbId = isPdbId;
|
|
12
|
+
exports.rcsbEntryUrl = rcsbEntryUrl;
|
|
11
13
|
exports.resolveStructureUrl = resolveStructureUrl;
|
|
12
14
|
exports.getPdbIdFromUrl = getPdbIdFromUrl;
|
|
13
15
|
exports.getUniprotIdFromAlphaFoldTarget = getUniprotIdFromAlphaFoldTarget;
|
|
@@ -40,6 +42,15 @@ function getAlphaFoldStructureUrl(uniprotId, version = ALPHAFOLD_VERSION) {
|
|
|
40
42
|
function getPdbStructureUrl(pdbId) {
|
|
41
43
|
return `https://files.rcsb.org/download/${pdbId}.cif`;
|
|
42
44
|
}
|
|
45
|
+
// A PDB id is four characters, the first a digit: 1TUP, 6ZIO. Checked before
|
|
46
|
+
// a typed one reaches a fetch, so three characters on the way to four are not
|
|
47
|
+
// a 404 apiece.
|
|
48
|
+
function isPdbId(value) {
|
|
49
|
+
return /^[1-9][A-Za-z0-9]{3}$/.test(value);
|
|
50
|
+
}
|
|
51
|
+
function rcsbEntryUrl(pdbId) {
|
|
52
|
+
return `https://www.rcsb.org/structure/${pdbId.toUpperCase()}`;
|
|
53
|
+
}
|
|
43
54
|
/**
|
|
44
55
|
* Resolve the `{ pdbId }` shorthand to a concrete structure URL, so a
|
|
45
56
|
* hand-authored snapshot or a short launch URL doesn't have to know RCSB's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structureUrls.js","sourceRoot":"","sources":["../src/structureUrls.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,kFAAkF;AAClF,gFAAgF;;AAQhF,sCAEC;AAED,0CAEC;AAED,0CAEC;AAQD,4DAKC;AAED,gDAEC;AAkBD,kDAiBC;AAYD,0CAiBC;AAUD,0EAGC;AAID,8DAUC;AAED,gEAOC;AAOD,sDA0BC;
|
|
1
|
+
{"version":3,"file":"structureUrls.js","sourceRoot":"","sources":["../src/structureUrls.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,kFAAkF;AAClF,gFAAgF;;AAQhF,sCAEC;AAED,0CAEC;AAED,0CAEC;AAQD,4DAKC;AAED,gDAEC;AAKD,0BAEC;AAED,oCAEC;AAkBD,kDAiBC;AAYD,0CAiBC;AAUD,0EAGC;AAID,8DAUC;AAED,gEAOC;AAOD,sDA0BC;AAjLD,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAE9B,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,SAAgB,aAAa,CAAC,SAAiB;IAC7C,OAAO,sCAAsC,SAAS,MAAM,CAAA;AAC9D,CAAC;AAED,SAAgB,eAAe,CAAC,SAAiB;IAC/C,OAAO,sCAAsC,SAAS,QAAQ,CAAA;AAChE,CAAC;AAED,SAAgB,eAAe,CAAC,SAAiB;IAC/C,OAAO,qCAAqC,SAAS,QAAQ,CAAA;AAC/D,CAAC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CACtC,SAAiB,EACjB,OAAO,GAAG,iBAAiB;IAE3B,OAAO,wCAAwC,SAAS,aAAa,OAAO,MAAM,CAAA;AACpF,CAAC;AAED,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,mCAAmC,KAAK,MAAM,CAAA;AACvD,CAAC;AAED,6EAA6E;AAC7E,8EAA8E;AAC9E,gBAAgB;AAChB,SAAgB,OAAO,CAAC,KAAa;IACnC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AC,CAAA;QAChE,OAAO,qCAAqC,YAAY,OAAO,CAAA;IACjE,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,EACpC,GAAG,EACH,IAAI,EACJ,SAAS,GAKV;IACC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,IAAI,KAAK,SAAS;YACvB,CAAC,CAAC,oBAAoB;YACtB,CAAC,CAAC,SAAS;gBACT,CAAC,CAAC,aAAa,SAAS,EAAE;gBAC1B,CAAC,CAAC,EAAE,CAAA;IACV,CAAC;IACD,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,CAAA;IAClC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;IAC5B,CAAC;IACD,MAAM,YAAY,GAAG,+BAA+B,CAAC,GAAG,CAAC,CAAA;IACzD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,aAAa,YAAY,EAAE,CAAA;IACpC,CAAC;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IAChD,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;AACvD,CAAC"}
|
package/esm/coordinates.d.ts
CHANGED
|
@@ -11,12 +11,15 @@ import type { PairwiseAlignment } from './mappings.ts';
|
|
|
11
11
|
* sequence; TranscriptPos the ungapped transcript sequence; AlignmentCol a
|
|
12
12
|
* column of the pairwise alignment (gaps included).
|
|
13
13
|
*/
|
|
14
|
-
type
|
|
15
|
-
readonly __brand:
|
|
14
|
+
export type StructurePos = number & {
|
|
15
|
+
readonly __brand: 'StructurePos';
|
|
16
|
+
};
|
|
17
|
+
export type TranscriptPos = number & {
|
|
18
|
+
readonly __brand: 'TranscriptPos';
|
|
19
|
+
};
|
|
20
|
+
export type AlignmentCol = number & {
|
|
21
|
+
readonly __brand: 'AlignmentCol';
|
|
16
22
|
};
|
|
17
|
-
export type StructurePos = Branded<'StructurePos'>;
|
|
18
|
-
export type TranscriptPos = Branded<'TranscriptPos'>;
|
|
19
|
-
export type AlignmentCol = Branded<'AlignmentCol'>;
|
|
20
23
|
export declare const structurePos: (n: number) => StructurePos;
|
|
21
24
|
export declare const transcriptPos: (n: number) => TranscriptPos;
|
|
22
25
|
export declare const alignmentCol: (n: number) => AlignmentCol;
|
|
@@ -63,4 +66,3 @@ export declare function transcriptRangeToStructureRange(mapper: CoordinateMapper
|
|
|
63
66
|
start: number;
|
|
64
67
|
end: number;
|
|
65
68
|
} | undefined;
|
|
66
|
-
export {};
|
package/esm/coordinates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinates.js","sourceRoot":"","sources":["../src/coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"coordinates.js","sourceRoot":"","sources":["../src/coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAoB1C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAiB,CAAA;AAC5D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAkB,CAAA;AAC9D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAiB,CAAA;AA2B5D;;;;GAIG;AACH,MAAM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E,EAAE,CAAC;QAChE,MAAM,GAAG,GAAG,MAAM,CAAC,qBAAqB,CAAC,aAAa,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAA;QACpE,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,KAAK,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;YACxD,IAAI,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QACvD,CAAC;IACH,CAAC;IACD,OAAO,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS;QAC9C,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,GAAG,CAAC,EAAE,CAAA;AACrC,CAAC"}
|
package/esm/dbIds.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type DbType = 'ensembl' | 'refseq' | 'ccds' | 'hgnc' | 'geneid';
|
|
1
|
+
export type DbType = 'ensembl' | 'refseq' | 'ccds' | 'hgnc' | 'geneid';
|
|
2
2
|
export declare function matchDbIdPattern(id: string): {
|
|
3
3
|
db: DbType;
|
|
4
4
|
pattern: RegExp;
|
|
@@ -13,4 +13,3 @@ export declare function getDbIdLabel(id: string): string;
|
|
|
13
13
|
* "xref:ensembl-ENST00000123". HGNC strips its redundant "HGNC:" prefix. */
|
|
14
14
|
export declare function buildUniProtXrefQuery(id: string): string | undefined;
|
|
15
15
|
export declare function stripTrailingVersion(s?: string): string | undefined;
|
|
16
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface ConfidenceModel {
|
|
1
|
+
export interface ConfidenceModel {
|
|
2
2
|
obj?: {
|
|
3
3
|
data: {
|
|
4
4
|
atomicConformation: {
|
|
@@ -46,4 +46,3 @@ export declare function extractPerResidueConfidence(model: ConfidenceModel): Ent
|
|
|
46
46
|
* indicate the track wouldn't be meaningful as confidence.
|
|
47
47
|
*/
|
|
48
48
|
export declare function looksLikePlddt(values: number[] | undefined): values is number[];
|
|
49
|
-
export {};
|
|
@@ -20,30 +20,30 @@
|
|
|
20
20
|
* So carry the real ids and convert through them.
|
|
21
21
|
*/
|
|
22
22
|
export interface Entity {
|
|
23
|
+
/** mmCIF entity id, molstar's own bookkeeping */
|
|
23
24
|
entityId: string;
|
|
25
|
+
/** one letter per residue, observed or not */
|
|
24
26
|
seq: string;
|
|
27
|
+
/** molstar `label_seq_id` per position of `seq` */
|
|
25
28
|
seqIds: number[];
|
|
26
|
-
/** author chain ids carrying this entity, e.g. ['A', 'B'] for a homodimer
|
|
27
|
-
* what a user recognises from the PDB entry page
|
|
28
|
-
* molstar's own bookkeeping */
|
|
29
|
+
/** author chain ids carrying this entity, e.g. ['A', 'B'] for a homodimer:
|
|
30
|
+
* what a user recognises from the PDB entry page */
|
|
29
31
|
chains: string[];
|
|
30
|
-
/** DNA, RNA or a hybrid, by molstar's entity subtype. Its
|
|
31
|
-
*
|
|
32
|
-
*
|
|
32
|
+
/** DNA, RNA or a hybrid, by molstar's entity subtype. Its letters spell
|
|
33
|
+
* amino acids too (A, C, G, T, U), so it is kept out of the alignment
|
|
34
|
+
* rather than left to score low. */
|
|
33
35
|
nucleicAcid?: boolean;
|
|
34
|
-
/** `auth_seq_id` per position: the
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* is addressed through `seqIds`. Absent when the model has no atomic
|
|
39
|
-
* hierarchy to read it from. See `residueNumber`. */
|
|
36
|
+
/** `auth_seq_id` per position: the depositors' numbering, which papers cite
|
|
37
|
+
* (1TUP's position 154 is R248) and Mol*'s hover shows. Display only;
|
|
38
|
+
* address Mol* through `seqIds`. Absent when the model has no atomic
|
|
39
|
+
* hierarchy. See `residueNumber`. */
|
|
40
40
|
authSeqIds?: number[];
|
|
41
41
|
}
|
|
42
|
-
interface Column<T> {
|
|
42
|
+
export interface Column<T> {
|
|
43
43
|
rowCount: number;
|
|
44
44
|
value(row: number): T;
|
|
45
45
|
}
|
|
46
|
-
interface StructureModel {
|
|
46
|
+
export interface StructureModel {
|
|
47
47
|
obj?: {
|
|
48
48
|
data: {
|
|
49
49
|
entities?: {
|
|
@@ -139,4 +139,3 @@ export declare function rangeToLabelSeqIds(entity: Entity | undefined, range: {
|
|
|
139
139
|
} | undefined): number[];
|
|
140
140
|
/** Reverse of `seqIds`: molstar's label_seq_id -> 0-based structure position. */
|
|
141
141
|
export declare function makeLabelSeqIdIndex(entity: Entity | undefined): Map<number, number>;
|
|
142
|
-
export {};
|
package/esm/fetchUtils.js
CHANGED
|
@@ -51,10 +51,28 @@ export function networkError(url, cause) {
|
|
|
51
51
|
? new Error(`Could not reach ${hostOf(url)}. Check your network connection; the server may also be refusing cross-origin requests from this page.`, { cause })
|
|
52
52
|
: cause;
|
|
53
53
|
}
|
|
54
|
+
const USER_AGENT = 'p2s_mapper (+https://github.com/GMOD/p2s_mapper)';
|
|
55
|
+
/**
|
|
56
|
+
* AlphaFold's prediction API answers 403 to `node`, the user agent Node's fetch
|
|
57
|
+
* sends (measured 2026-10-11), so outside a browser every request names this
|
|
58
|
+
* package unless the caller named something else. A browser sends its own, and
|
|
59
|
+
* a script-set one would cost a CORS preflight on every call.
|
|
60
|
+
*/
|
|
61
|
+
function withUserAgent(init) {
|
|
62
|
+
if (typeof navigator !== 'undefined' &&
|
|
63
|
+
navigator.userAgent.startsWith('Mozilla')) {
|
|
64
|
+
return init;
|
|
65
|
+
}
|
|
66
|
+
const headers = new Headers(init.headers);
|
|
67
|
+
if (!headers.has('user-agent')) {
|
|
68
|
+
headers.set('user-agent', USER_AGENT);
|
|
69
|
+
}
|
|
70
|
+
return { ...init, headers };
|
|
71
|
+
}
|
|
54
72
|
export async function rawfetch(url, args) {
|
|
55
73
|
const { fetch: f = globalThis.fetch, ...init } = args ?? {};
|
|
56
74
|
try {
|
|
57
|
-
return await f(url, init);
|
|
75
|
+
return await f(url, withUserAgent(init));
|
|
58
76
|
}
|
|
59
77
|
catch (e) {
|
|
60
78
|
throw networkError(url, e);
|
package/esm/fetchUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchUtils.js","sourceRoot":"","sources":["../src/fetchUtils.ts"],"names":[],"mappings":"AAAA,SAAS,MAAM,CAAC,GAAW;IACzB,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;IAC1B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAA;IACZ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,GAAG,GAAG,CAAA;AAEtB,SAAS,SAAS,CAAC,IAAY;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IACjD,OAAO,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;AAC1E,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IACzB,MAAM,CAAQ;IAEvB,YAAY,OAAe,EAAE,MAAc;QACzC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,WAAW,CAAA;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF;AAED;;UAEU;AACV,MAAM,UAAU,mBAAmB,CAAC,CAAU;IAC5C,OAAO,CAAC,YAAY,SAAS,IAAI,CAAC,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,MAAM,GAAG,GAAG,CAAA;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BAChB,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;YAC5B,CAAC,EACD,EAAE,IAAI,EAAE,IAAI,EAAE,CACf,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/esm/index.d.ts
CHANGED
|
@@ -11,10 +11,8 @@ export * from './extractStructureSequences.ts';
|
|
|
11
11
|
export * from './extractPerResidueConfidence.ts';
|
|
12
12
|
export * from './isoformRanking.ts';
|
|
13
13
|
export * from './pdbUniProtMapping.ts';
|
|
14
|
-
export * from './
|
|
14
|
+
export * from './pdbEntry.ts';
|
|
15
15
|
export * from './alphaFoldModels.ts';
|
|
16
|
-
export * from './pdbeBestStructures.ts';
|
|
17
|
-
export * from './pdbeEntryMolecules.ts';
|
|
18
16
|
export * from './structureSources.ts';
|
|
19
17
|
export * from './uniProtSearch.ts';
|
|
20
18
|
export * from './dbIds.ts';
|
package/esm/index.js
CHANGED
|
@@ -13,13 +13,11 @@ export * from "./chooseMappedEntity.js";
|
|
|
13
13
|
export * from "./extractStructureSequences.js";
|
|
14
14
|
export * from "./extractPerResidueConfidence.js";
|
|
15
15
|
export * from "./isoformRanking.js";
|
|
16
|
-
//
|
|
16
|
+
// UniProt mapping
|
|
17
17
|
export * from "./pdbUniProtMapping.js";
|
|
18
|
-
export * from "./
|
|
18
|
+
export * from "./pdbEntry.js";
|
|
19
19
|
// Structure sources
|
|
20
20
|
export * from "./alphaFoldModels.js";
|
|
21
|
-
export * from "./pdbeBestStructures.js";
|
|
22
|
-
export * from "./pdbeEntryMolecules.js";
|
|
23
21
|
export * from "./structureSources.js";
|
|
24
22
|
export * from "./uniProtSearch.js";
|
|
25
23
|
export * from "./dbIds.js";
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AAEpC,cAAc;AACd,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AAEnC,eAAe;AACf,cAAc,yBAAyB,CAAA;AACvC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,qBAAqB,CAAA;AAEnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AAEpC,cAAc;AACd,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA;AAEnC,eAAe;AACf,cAAc,yBAAyB,CAAA;AACvC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kCAAkC,CAAA;AAChD,cAAc,qBAAqB,CAAA;AAEnC,kBAAkB;AAClB,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA;AAE7B,oBAAoB;AACpB,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAE1B,mBAAmB;AACnB,cAAc,oBAAoB,CAAA;AAClC,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA"}
|
package/esm/isoformRanking.d.ts
CHANGED
|
@@ -14,8 +14,11 @@ export interface RankedIsoform {
|
|
|
14
14
|
score?: number;
|
|
15
15
|
}
|
|
16
16
|
export interface ClassifiedIsoforms {
|
|
17
|
+
/** translates to exactly the structure's sequence, longest first */
|
|
17
18
|
matches: RankedIsoform[];
|
|
19
|
+
/** translates to something else, best-aligning first */
|
|
18
20
|
nonMatches: RankedIsoform[];
|
|
21
|
+
/** ids of the isoforms with no translation */
|
|
19
22
|
noData: string[];
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PairwiseAlignment } from './mappings.ts';
|
|
2
2
|
import type { AlignmentAlgorithm } from './types.ts';
|
|
3
|
-
interface AlignmentResult {
|
|
3
|
+
export interface AlignmentResult {
|
|
4
4
|
alignedSeq1: string;
|
|
5
5
|
alignedSeq2: string;
|
|
6
6
|
score: number;
|
|
@@ -32,4 +32,3 @@ export declare function scoredAlignment(seq1: string, seq2: string, algorithm: A
|
|
|
32
32
|
score: number;
|
|
33
33
|
};
|
|
34
34
|
export declare function runLocalAlignment(seq1: string, seq2: string, algorithm: AlignmentAlgorithm): PairwiseAlignment;
|
|
35
|
-
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { FetchOptions } from './fetchUtils.ts';
|
|
2
|
+
import type { UniProtStructureMapping } from './pdbUniProtMapping.ts';
|
|
3
|
+
export declare const RCSB_DATA_GRAPHQL_URL = "https://data.rcsb.org/graphql";
|
|
4
|
+
export interface PdbEntry {
|
|
5
|
+
/** every UniProt accession the entry's entities align to */
|
|
6
|
+
mappings: UniProtStructureMapping[];
|
|
7
|
+
/** one sequence per protein entity, in entity order; nucleic acids left
|
|
8
|
+
* out, since A, C, G, T and U are amino-acid letters too */
|
|
9
|
+
proteinSequences: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function pdbEntryQuery(pdbId: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* A GraphQL request. The server answers 200 whatever happened, so a failure
|
|
14
|
+
* is read from the body's `errors`, and counts as a 400: the server
|
|
15
|
+
* understood the query and declined it, so asking again gets the same answer.
|
|
16
|
+
*/
|
|
17
|
+
export declare function graphqlFetch(url: string, query: string, variables: Record<string, unknown> | undefined, opts?: FetchOptions): Promise<unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* The entry, retried twice: one failed request would otherwise leave a fusion
|
|
20
|
+
* construct mapped onto its partner for the whole session. An id RCSB has no
|
|
21
|
+
* entry for is a 404, which is not retried, since that answer cannot change.
|
|
22
|
+
*/
|
|
23
|
+
export declare function fetchPdbEntry(pdbId: string, opts?: FetchOptions): Promise<PdbEntry>;
|
|
24
|
+
/** The entry's UniProt alignment alone. */
|
|
25
|
+
export declare function fetchUniProtStructureMappings(pdbId: string, opts?: FetchOptions): Promise<UniProtStructureMapping[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Parses the `data` of `pdbEntryQuery`. Undefined when RCSB has no such
|
|
28
|
+
* entry; an entry nothing aligns to UniProt (DNA alone, say) parses to no
|
|
29
|
+
* mappings. An unparseable alignment is skipped rather than failing the
|
|
30
|
+
* entry, so a chimera with one malformed region still maps its other chains.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parsePdbEntry(data: unknown): PdbEntry | undefined;
|