protvista-uniprot 4.2.0 → 4.3.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 +8 -2
- package/dist/protvista-uniprot.mjs +41399 -28456
- package/dist/protvista-uniprot.mjs.map +1 -1
- package/dist/types/adapters/types/interpro.d.ts +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/tooltips/interpro-tooltip.d.ts +3 -0
- package/dist/types/tooltips/{ptmTooltip.d.ts → ptm-tooltip.d.ts} +1 -1
- package/package.json +4 -4
- package/src/adapters/feature-adapter.ts +1 -1
- package/src/adapters/interpro-adapter.ts +21 -42
- package/src/adapters/proteomics-adapter.ts +6 -3
- package/src/adapters/ptm-exchange-adapter.ts +7 -2
- package/src/adapters/rna-editing-adapter.ts +1 -1
- package/src/adapters/structure-adapter.ts +1 -1
- package/src/adapters/types/interpro.ts +1 -1
- package/src/adapters/variation-adapter.ts +1 -1
- package/src/config.ts +60 -60
- package/src/index.ts +3 -3
- package/src/protvista-uniprot.ts +8 -8
- package/src/styles/protvista-styles.ts +1 -1
- package/src/tooltips/{featureTooltip.ts → feature-tooltip.ts} +8 -12
- package/src/tooltips/interpro-tooltip.ts +43 -0
- package/src/tooltips/{ptmTooltip.ts → ptm-tooltip.ts} +6 -1
- package/src/tooltips/{variationTooltip.ts → variation-tooltip.ts} +1 -1
- package/src/.vscode/settings.json +0 -3
- /package/dist/types/tooltips/{featureTooltip.d.ts → feature-tooltip.d.ts} +0 -0
- /package/dist/types/tooltips/{rnaEditingTooltip.d.ts → rna-editing-tooltip.d.ts} +0 -0
- /package/dist/types/tooltips/{structureTooltip.d.ts → structure-tooltip.d.ts} +0 -0
- /package/dist/types/tooltips/{variationTooltip.d.ts → variation-tooltip.d.ts} +0 -0
- /package/src/tooltips/{rnaEditingTooltip.ts → rna-editing-tooltip.ts} +0 -0
- /package/src/tooltips/{structureTooltip.ts → structure-tooltip.ts} +0 -0
package/dist/types/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TrackType = 'nightingale-track' | 'nightingale-interpro-track' | 'nightingale-colored-sequence' | 'nightingale-variation' | 'nightingale-linegraph-track' | 'nightingale-sequence-heatmap';
|
|
1
|
+
export type TrackType = 'nightingale-track-canvas' | 'nightingale-interpro-track' | 'nightingale-colored-sequence' | 'nightingale-variation' | 'nightingale-linegraph-track' | 'nightingale-sequence-heatmap';
|
|
2
2
|
export type ProtvistaTrackConfig = {
|
|
3
3
|
name: string;
|
|
4
4
|
label?: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as ProtvistaUniprot } from './protvista-uniprot';
|
|
2
2
|
export { default as filterConfig, colorConfig } from './filter-config';
|
|
3
|
-
export { default as getFeatureTooltip } from './tooltips/
|
|
4
|
-
export { default as getStructureTooltip } from './tooltips/
|
|
5
|
-
export { default as getVariationTooltip } from './tooltips/
|
|
3
|
+
export { default as getFeatureTooltip } from './tooltips/feature-tooltip';
|
|
4
|
+
export { default as getStructureTooltip } from './tooltips/structure-tooltip';
|
|
5
|
+
export { default as getVariationTooltip } from './tooltips/variation-tooltip';
|
|
6
6
|
export { default as ProtvistaUniprotStructure } from './protvista-uniprot-structure';
|
|
7
7
|
export default ProtvistaUniprot;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PTM } from '../adapters/ptm-exchange-adapter';
|
|
2
2
|
export declare const phosphorylate: (aa: string) => string;
|
|
3
3
|
export declare const sumoylate: (aa: string) => string;
|
|
4
|
-
declare const formatTooltip: (ptms: PTM[], aa: string, confidenceScore: string) => string;
|
|
4
|
+
declare const formatTooltip: (title: string, ptms: PTM[], aa: string, confidenceScore: string) => string;
|
|
5
5
|
export default formatTooltip;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "protvista-uniprot",
|
|
3
3
|
"description": "ProtVista tool for the UniProt website",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"src"
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@nightingale-elements/nightingale-colored-sequence": "5.4.0",
|
|
33
33
|
"@nightingale-elements/nightingale-filter": "5.4.0",
|
|
34
|
-
"@nightingale-elements/nightingale-interpro-track": "5.
|
|
34
|
+
"@nightingale-elements/nightingale-interpro-track": "5.5.0",
|
|
35
35
|
"@nightingale-elements/nightingale-linegraph-track": "5.4.0",
|
|
36
36
|
"@nightingale-elements/nightingale-manager": "5.4.0",
|
|
37
37
|
"@nightingale-elements/nightingale-navigation": "5.4.0",
|
|
38
38
|
"@nightingale-elements/nightingale-sequence": "5.4.0",
|
|
39
39
|
"@nightingale-elements/nightingale-sequence-heatmap": "5.4.0",
|
|
40
40
|
"@nightingale-elements/nightingale-structure": "5.4.0",
|
|
41
|
-
"@nightingale-elements/nightingale-track": "5.
|
|
42
|
-
"@nightingale-elements/nightingale-variation": "5.
|
|
41
|
+
"@nightingale-elements/nightingale-track-canvas": "5.5.0",
|
|
42
|
+
"@nightingale-elements/nightingale-variation": "5.5.0",
|
|
43
43
|
"color-hash": "2.0.2",
|
|
44
44
|
"core-js": "3.13.0",
|
|
45
45
|
"lit": "3.1.3",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import ColorHash from 'color-hash';
|
|
2
2
|
|
|
3
|
+
import formatTooltip from '../tooltips/interpro-tooltip';
|
|
4
|
+
|
|
3
5
|
import { InterProProteinSearch, TransformedInterPro } from './types/interpro';
|
|
4
6
|
|
|
5
7
|
// Copied from InterPro to replicate the same colours for the representative domains
|
|
@@ -11,58 +13,35 @@ const colorHash = new ColorHash({
|
|
|
11
13
|
|
|
12
14
|
const transformData = (data: InterProProteinSearch): TransformedInterPro => {
|
|
13
15
|
try {
|
|
14
|
-
return data?.results?.map(({ metadata, proteins }) =>
|
|
15
|
-
|
|
16
|
-
locations: proteins[0].entry_protein_locations,
|
|
17
|
-
start: proteins[0].entry_protein_locations
|
|
16
|
+
return data?.results?.map(({ metadata, proteins }) => {
|
|
17
|
+
const start = proteins[0].entry_protein_locations
|
|
18
18
|
? Math.min(
|
|
19
19
|
...proteins[0].entry_protein_locations.map((location) =>
|
|
20
20
|
Math.min(...location.fragments.map((fragment) => fragment.start))
|
|
21
21
|
)
|
|
22
22
|
)
|
|
23
|
-
: ''
|
|
24
|
-
|
|
23
|
+
: '';
|
|
24
|
+
|
|
25
|
+
const end = proteins[0].entry_protein_locations
|
|
25
26
|
? Math.max(
|
|
26
27
|
...proteins[0].entry_protein_locations?.map((location) =>
|
|
27
28
|
Math.max(...location.fragments.map((fragment) => fragment.end))
|
|
28
29
|
)
|
|
29
30
|
)
|
|
30
|
-
: ''
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
${metadata.accession}
|
|
45
|
-
</a>
|
|
46
|
-
</p>
|
|
47
|
-
<h5>Name</h5>
|
|
48
|
-
<p>${metadata.name}</p>
|
|
49
|
-
${
|
|
50
|
-
metadata.integrated
|
|
51
|
-
? `<h5>Integrated into </h5>
|
|
52
|
-
<p>
|
|
53
|
-
<a
|
|
54
|
-
target="_blank"
|
|
55
|
-
rel="noopener"
|
|
56
|
-
href="https://www.ebi.ac.uk/interpro/entry/InterPro/${metadata.integrated}/"
|
|
57
|
-
>
|
|
58
|
-
${metadata.integrated}
|
|
59
|
-
</a>
|
|
60
|
-
</p>`
|
|
61
|
-
: ''
|
|
62
|
-
}
|
|
63
|
-
`,
|
|
64
|
-
length: proteins[0].protein_length,
|
|
65
|
-
}));
|
|
31
|
+
: '';
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
...metadata,
|
|
35
|
+
locations: proteins[0].entry_protein_locations,
|
|
36
|
+
start,
|
|
37
|
+
end,
|
|
38
|
+
color: colorHash.hex(
|
|
39
|
+
metadata.accession.toLowerCase().split('').reverse().join('')
|
|
40
|
+
),
|
|
41
|
+
tooltipContent: formatTooltip(start, end, metadata),
|
|
42
|
+
length: proteins[0].protein_length,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
66
45
|
} catch (error) {
|
|
67
46
|
throw new Error('Failed transforming the data');
|
|
68
47
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renameProperties } from '../utils';
|
|
2
|
-
import formatTooltip from '../tooltips/
|
|
2
|
+
import formatTooltip from '../tooltips/feature-tooltip';
|
|
3
3
|
|
|
4
4
|
const proteomicsTrackProperties = (feature, taxId) => {
|
|
5
5
|
return {
|
|
@@ -49,7 +49,7 @@ const transformData = (data) => {
|
|
|
49
49
|
evidences: features[0].evidences,
|
|
50
50
|
peptide: features[0].peptide,
|
|
51
51
|
unique: features[0].unique,
|
|
52
|
-
|
|
52
|
+
residuesToHighlight: features[0].ptms.map((ptm) => ({
|
|
53
53
|
name: ptm.name,
|
|
54
54
|
position: ptm.position,
|
|
55
55
|
sources: ptm.sources,
|
|
@@ -64,7 +64,10 @@ const transformData = (data) => {
|
|
|
64
64
|
}, []);
|
|
65
65
|
} else {
|
|
66
66
|
adaptedData = data.features.map((feature) => {
|
|
67
|
-
return Object.assign(
|
|
67
|
+
return Object.assign(
|
|
68
|
+
feature,
|
|
69
|
+
proteomicsTrackProperties(feature, data.taxid)
|
|
70
|
+
);
|
|
68
71
|
});
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import formatTooltip from
|
|
1
|
+
import formatTooltip from '../tooltips/ptm-tooltip';
|
|
2
2
|
|
|
3
3
|
type ProteomicsPtm = {
|
|
4
4
|
accession: string;
|
|
@@ -82,7 +82,12 @@ const convertPtmExchangePtms = (
|
|
|
82
82
|
start: absolutePosition,
|
|
83
83
|
end: absolutePosition,
|
|
84
84
|
shape: 'triangle',
|
|
85
|
-
tooltipContent: formatTooltip(
|
|
85
|
+
tooltipContent: formatTooltip(
|
|
86
|
+
`MOD_RES_LS ${absolutePosition}-${absolutePosition}`,
|
|
87
|
+
ptms,
|
|
88
|
+
aa,
|
|
89
|
+
confidenceScore
|
|
90
|
+
),
|
|
86
91
|
color:
|
|
87
92
|
(confidenceScore && ConfidenceScoreColors[confidenceScore]) || 'black',
|
|
88
93
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AminoAcid } from '@nightingale-elements/nightingale-variation';
|
|
2
2
|
|
|
3
3
|
import { RnaEditing, TransformedRnaEditing } from './types/rna-editing';
|
|
4
|
-
import formatTooltip from '../tooltips/
|
|
4
|
+
import formatTooltip from '../tooltips/rna-editing-tooltip';
|
|
5
5
|
|
|
6
6
|
const transformData = ({
|
|
7
7
|
sequence,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
VariationDatum,
|
|
8
8
|
} from '@nightingale-elements/nightingale-variation';
|
|
9
9
|
|
|
10
|
-
import formatTooltip from '../tooltips/
|
|
10
|
+
import formatTooltip from '../tooltips/variation-tooltip';
|
|
11
11
|
|
|
12
12
|
export type TransformedVariant = VariationDatum & Variant;
|
|
13
13
|
|