jbrowse-plugin-protein3d 0.11.1 → 0.11.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/AddHighlightModel/index.js +3 -3
- package/dist/LaunchProteinView/components/FoldseekSearch.js +4 -5
- package/dist/LaunchProteinView/components/launchProteinAnnotationView.js +5 -2
- package/dist/LaunchProteinView/components/proteinTrackSetup.js +17 -8
- package/dist/LaunchProteinView/utils/calculateProteinSequence.js +9 -8
- package/dist/LaunchProteinView/utils/launchViewUtils.js +1 -1
- package/dist/LaunchProteinView/utils/sessionWithAddTracks.js +6 -0
- package/dist/LaunchProteinView/utils/util.js +4 -1
- package/dist/LaunchProteinViewExtensionPoint/index.js +2 -8
- package/dist/LaunchProteinViewExtensionPoint/resolveShortLaunch.js +4 -2
- package/dist/ProteinView/connectedHover.js +3 -3
- package/dist/ProteinView/structureModel.js +3 -1
- package/dist/ProteinView/util.js +13 -2
- package/dist/jbrowse-plugin-protein3d.umd.production.min.js +63 -15
- package/dist/jbrowse-plugin-protein3d.umd.production.min.js.map +4 -4
- package/dist/{molstar-chunk-2XBGYTCA.js → molstar-chunk-BYIOCM3L.js} +1 -1
- package/dist/{molstar-chunk-2XBGYTCA.js.map → molstar-chunk-BYIOCM3L.js.map} +1 -1
- package/dist/version.js +1 -1
- package/package.json +29 -25
- package/src/AddHighlightModel/index.tsx +1 -1
- package/src/LaunchProteinView/components/FoldseekSearch.tsx +4 -5
- package/src/LaunchProteinView/components/launchProteinAnnotationView.ts +11 -4
- package/src/LaunchProteinView/components/proteinAssemblySetup.ts +1 -1
- package/src/LaunchProteinView/components/proteinTrackSetup.ts +18 -9
- package/src/LaunchProteinView/utils/calculateProteinSequence.ts +9 -9
- package/src/LaunchProteinView/utils/launchViewUtils.ts +3 -7
- package/src/LaunchProteinView/utils/sessionWithAddTracks.ts +15 -0
- package/src/LaunchProteinView/utils/util.ts +5 -1
- package/src/LaunchProteinViewExtensionPoint/index.ts +4 -9
- package/src/LaunchProteinViewExtensionPoint/resolveShortLaunch.ts +8 -2
- package/src/ProteinView/connectedHover.ts +6 -2
- package/src/ProteinView/labelSeqIdIntegration.test.ts +5 -1
- package/src/ProteinView/structureLoader.test.ts +5 -0
- package/src/ProteinView/structureModel.test.ts +9 -1
- package/src/ProteinView/structureModel.ts +5 -1
- package/src/ProteinView/structureSuperposer.test.ts +3 -0
- package/src/ProteinView/util.test.ts +15 -0
- package/src/ProteinView/util.ts +13 -1
- package/src/mappings.ts +2 -1
- package/src/version.ts +1 -1
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.d.ts +0 -6
- package/dist/AddHighlightModel/GenomeTo1DProteinHoverHighlight.d.ts +0 -6
- package/dist/AddHighlightModel/Highlight.d.ts +0 -8
- package/dist/AddHighlightModel/HighlightComponents.d.ts +0 -6
- package/dist/AddHighlightModel/Protein1DToGenomeHoverHighlight.d.ts +0 -6
- package/dist/AddHighlightModel/ProteinToGenomeHighlight.d.ts +0 -8
- package/dist/AddHighlightModel/ProteinToGenomeHighlightInner.d.ts +0 -8
- package/dist/AddHighlightModel/index.d.ts +0 -2
- package/dist/AddHighlightModel/proteinViewLookup.d.ts +0 -27
- package/dist/AddHighlightModel/util.d.ts +0 -20
- package/dist/AlphaFoldConfidenceAdapter/AlphaFoldConfidenceAdapter.d.ts +0 -18
- package/dist/AlphaFoldConfidenceAdapter/configSchema.d.ts +0 -3
- package/dist/AlphaFoldConfidenceAdapter/index.d.ts +0 -2
- package/dist/AlphaMissensePathogenicityAdapter/AlphaMissensePathogenicityAdapter.d.ts +0 -35
- package/dist/AlphaMissensePathogenicityAdapter/configSchema.d.ts +0 -3
- package/dist/AlphaMissensePathogenicityAdapter/index.d.ts +0 -2
- package/dist/BaseProteinAnnotationAdapter.d.ts +0 -29
- package/dist/LaunchProteinView/components/AlignmentSettingsButton.d.ts +0 -6
- package/dist/LaunchProteinView/components/AlphaFoldDBSearch.d.ts +0 -13
- package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.d.ts +0 -8
- package/dist/LaunchProteinView/components/Checkbox2.d.ts +0 -7
- package/dist/LaunchProteinView/components/FoldseekActionMenu.d.ts +0 -17
- package/dist/LaunchProteinView/components/FoldseekDatabaseSelector.d.ts +0 -7
- package/dist/LaunchProteinView/components/FoldseekResultsTable.d.ts +0 -13
- package/dist/LaunchProteinView/components/FoldseekSearch.d.ts +0 -10
- package/dist/LaunchProteinView/components/HelpButton.d.ts +0 -2
- package/dist/LaunchProteinView/components/HelpDialog.d.ts +0 -4
- package/dist/LaunchProteinView/components/IdentifierSelector.d.ts +0 -9
- package/dist/LaunchProteinView/components/IsoformSequencesToggle.d.ts +0 -7
- package/dist/LaunchProteinView/components/LaunchOptionsMenu.d.ts +0 -13
- package/dist/LaunchProteinView/components/LaunchProteinViewDialog.d.ts +0 -7
- package/dist/LaunchProteinView/components/LaunchSettingsDialog.d.ts +0 -5
- package/dist/LaunchProteinView/components/MSATable.d.ts +0 -7
- package/dist/LaunchProteinView/components/PdbResultsTable.d.ts +0 -7
- package/dist/LaunchProteinView/components/PdbSearch.d.ts +0 -13
- package/dist/LaunchProteinView/components/ProteinViewActions.d.ts +0 -29
- package/dist/LaunchProteinView/components/SequenceMismatchNotice.d.ts +0 -6
- package/dist/LaunchProteinView/components/StructureSourcePicker.d.ts +0 -10
- package/dist/LaunchProteinView/components/TabPanel.d.ts +0 -6
- package/dist/LaunchProteinView/components/TranscriptSelector.d.ts +0 -12
- package/dist/LaunchProteinView/components/UniProtIdInput.d.ts +0 -12
- package/dist/LaunchProteinView/components/UniProtResultsTable.d.ts +0 -9
- package/dist/LaunchProteinView/components/UserProvidedStructure.d.ts +0 -14
- package/dist/LaunchProteinView/components/launchProteinAnnotationView.d.ts +0 -9
- package/dist/LaunchProteinView/components/proteinAssemblySetup.d.ts +0 -5
- package/dist/LaunchProteinView/components/proteinTrackSetup.d.ts +0 -9
- package/dist/LaunchProteinView/hooks/swrOptions.d.ts +0 -5
- package/dist/LaunchProteinView/hooks/useAlphaFoldDBSearch.d.ts +0 -46
- package/dist/LaunchProteinView/hooks/useAlphaFoldData.d.ts +0 -15
- package/dist/LaunchProteinView/hooks/useDebouncedValue.d.ts +0 -6
- package/dist/LaunchProteinView/hooks/useFoldseekSearch.d.ts +0 -16
- package/dist/LaunchProteinView/hooks/useIsoformProteinSequences.d.ts +0 -12
- package/dist/LaunchProteinView/hooks/useLocalStorage.d.ts +0 -1
- package/dist/LaunchProteinView/hooks/usePdbBestStructures.d.ts +0 -6
- package/dist/LaunchProteinView/hooks/useSafeLaunch.d.ts +0 -9
- package/dist/LaunchProteinView/hooks/useStructureFileSequence.d.ts +0 -9
- package/dist/LaunchProteinView/hooks/useTranscriptIsoformSelection.d.ts +0 -19
- package/dist/LaunchProteinView/hooks/useTranscriptSelection.d.ts +0 -11
- package/dist/LaunchProteinView/hooks/useUniProtIdLookup.d.ts +0 -36
- package/dist/LaunchProteinView/hooks/useUniProtSearch.d.ts +0 -14
- package/dist/LaunchProteinView/index.d.ts +0 -2
- package/dist/LaunchProteinView/services/alphaFoldModels.d.ts +0 -24
- package/dist/LaunchProteinView/services/foldseekApi.d.ts +0 -84
- package/dist/LaunchProteinView/services/lookupMethods.d.ts +0 -14
- package/dist/LaunchProteinView/services/pdbeBestStructures.d.ts +0 -22
- package/dist/LaunchProteinView/utils/caCoordsToPdb.d.ts +0 -18
- package/dist/LaunchProteinView/utils/calculateProteinSequence.d.ts +0 -24
- package/dist/LaunchProteinView/utils/geneticCodes.d.ts +0 -14
- package/dist/LaunchProteinView/utils/getSearchDescription.d.ts +0 -6
- package/dist/LaunchProteinView/utils/isoformRanking.d.ts +0 -44
- package/dist/LaunchProteinView/utils/launchHelpers.d.ts +0 -22
- package/dist/LaunchProteinView/utils/launchViewUtils.d.ts +0 -31
- package/dist/LaunchProteinView/utils/readStructureFile.d.ts +0 -5
- package/dist/LaunchProteinView/utils/sideBySide.d.ts +0 -16
- package/dist/LaunchProteinView/utils/structureUrls.d.ts +0 -46
- package/dist/LaunchProteinView/utils/util.d.ts +0 -51
- package/dist/LaunchProteinViewExtensionPoint/index.d.ts +0 -2
- package/dist/LaunchProteinViewExtensionPoint/resolveShortLaunch.d.ts +0 -27
- package/dist/Protein1DLinkage/index.d.ts +0 -4
- package/dist/Protein1DLinkage/linkage.d.ts +0 -34
- package/dist/ProteinView/__fixtures__/structureFixtures.d.ts +0 -17
- package/dist/ProteinView/addStructureFromData.d.ts +0 -20
- package/dist/ProteinView/addStructureFromURL.d.ts +0 -18
- package/dist/ProteinView/alignmentQuality.d.ts +0 -44
- package/dist/ProteinView/applyColorTheme.d.ts +0 -40
- package/dist/ProteinView/applyLociInteractivity.d.ts +0 -47
- package/dist/ProteinView/autoScroll.d.ts +0 -30
- package/dist/ProteinView/chooseMappedEntity.d.ts +0 -55
- package/dist/ProteinView/components/AddStructureDialog.d.ts +0 -6
- package/dist/ProteinView/components/AlignmentRuler.d.ts +0 -15
- package/dist/ProteinView/components/ChainSelect.d.ts +0 -6
- package/dist/ProteinView/components/FeatureBar.d.ts +0 -9
- package/dist/ProteinView/components/FeatureTypeLabel.d.ts +0 -10
- package/dist/ProteinView/components/HeaderStructureInfo.d.ts +0 -6
- package/dist/ProteinView/components/HoverMarker.d.ts +0 -6
- package/dist/ProteinView/components/ManualAlignmentDialog.d.ts +0 -6
- package/dist/ProteinView/components/ProteinAlignment.d.ts +0 -6
- package/dist/ProteinView/components/ProteinAlignmentHelpButton.d.ts +0 -5
- package/dist/ProteinView/components/ProteinAlignmentHelpDialog.d.ts +0 -4
- package/dist/ProteinView/components/ProteinFeatureTrack.d.ts +0 -12
- package/dist/ProteinView/components/ProteinView.d.ts +0 -6
- package/dist/ProteinView/components/ProteinViewHeader.d.ts +0 -6
- package/dist/ProteinView/components/ResidueValueTrack.d.ts +0 -19
- package/dist/ProteinView/components/SplitString.d.ts +0 -21
- package/dist/ProteinView/connectedHover.d.ts +0 -36
- package/dist/ProteinView/constants.d.ts +0 -11
- package/dist/ProteinView/coordinates.d.ts +0 -66
- package/dist/ProteinView/css/molstar.d.ts +0 -2
- package/dist/ProteinView/extractPerResidueConfidence.d.ts +0 -49
- package/dist/ProteinView/extractStructureSequences.d.ts +0 -142
- package/dist/ProteinView/frameSelection.d.ts +0 -32
- package/dist/ProteinView/hooks/useAlignmentColumnHover.d.ts +0 -11
- package/dist/ProteinView/hooks/useProteinFeatureTrackData.d.ts +0 -47
- package/dist/ProteinView/hooks/useStructureUniProt.d.ts +0 -30
- package/dist/ProteinView/hooks/useUniProtFeatures.d.ts +0 -14
- package/dist/ProteinView/index.d.ts +0 -2
- package/dist/ProteinView/loadMolstar.d.ts +0 -2
- package/dist/ProteinView/loadStructureData.d.ts +0 -29
- package/dist/ProteinView/lociChannel.d.ts +0 -27
- package/dist/ProteinView/model.d.ts +0 -2192
- package/dist/ProteinView/molstarExports.d.ts +0 -20
- package/dist/ProteinView/pairwiseAlignment.d.ts +0 -35
- package/dist/ProteinView/pdbUniProtMapping.d.ts +0 -70
- package/dist/ProteinView/proteinAbbreviationMapping.d.ts +0 -7
- package/dist/ProteinView/proteinToGenomeMapping.d.ts +0 -55
- package/dist/ProteinView/proteinViewSpec.d.ts +0 -101
- package/dist/ProteinView/residueTracks.d.ts +0 -21
- package/dist/ProteinView/showLoading.d.ts +0 -7
- package/dist/ProteinView/storedSettings.d.ts +0 -14
- package/dist/ProteinView/structureFormat.d.ts +0 -23
- package/dist/ProteinView/structureLoader.d.ts +0 -30
- package/dist/ProteinView/structureModel.d.ts +0 -589
- package/dist/ProteinView/structurePipeline.d.ts +0 -27
- package/dist/ProteinView/structureSuperposer.d.ts +0 -34
- package/dist/ProteinView/subscribeMolstarInteraction.d.ts +0 -36
- package/dist/ProteinView/superposeStructures.d.ts +0 -2
- package/dist/ProteinView/types.d.ts +0 -14
- package/dist/ProteinView/useProteinView.d.ts +0 -9
- package/dist/ProteinView/util.d.ts +0 -23
- package/dist/ProteinView/withTemporaryMolstarPlugin.d.ts +0 -9
- package/dist/UniProtVariationAdapter/UniProtVariationAdapter.d.ts +0 -81
- package/dist/UniProtVariationAdapter/configSchema.d.ts +0 -3
- package/dist/UniProtVariationAdapter/index.d.ts +0 -2
- package/dist/components/ExternalLink.d.ts +0 -3
- package/dist/extendStateModel.d.ts +0 -4
- package/dist/fetchUtils.d.ts +0 -10
- package/dist/index.d.ts +0 -8
- package/dist/mappings.d.ts +0 -66
- package/dist/storage.d.ts +0 -3
- package/dist/test_data/gene.d.ts +0 -580
- package/dist/test_data/molstarStructure.d.ts +0 -12
- package/dist/version.d.ts +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import HighlightComponents from './HighlightComponents';
|
|
3
3
|
export default function AddHighlightModelF(pluginManager) {
|
|
4
|
-
pluginManager.addToExtensionPoint(
|
|
5
|
-
// @ts-expect-error
|
|
6
|
-
(rest, { model }) => {
|
|
4
|
+
pluginManager.addToExtensionPoint(
|
|
5
|
+
// @ts-expect-error v4 hosts have no contributeToExtensionPoint
|
|
6
|
+
'LinearGenomeView-TracksContainerComponent', (rest, { model }) => {
|
|
7
7
|
return [
|
|
8
8
|
...rest,
|
|
9
9
|
React.createElement(HighlightComponents, { key: "highlight_protein_viewer_protein3d", model: model }),
|
|
@@ -66,14 +66,13 @@ const FoldseekSearch = observer(function FoldseekSearch({ feature, session, view
|
|
|
66
66
|
React.createElement(TextField, { label: "Protein sequence (amino acids)", multiline: true, rows: 4, value: sequence, onChange: e => {
|
|
67
67
|
setUserEditedSequence(e.target.value);
|
|
68
68
|
invalidatePrediction();
|
|
69
|
-
}, placeholder: `MKTVRQERLKSIVRILERSKEPVSGAQLAEEL...`, disabled: isBusy,
|
|
70
|
-
className: classes.sequenceInput,
|
|
69
|
+
}, placeholder: `MKTVRQERLKSIVRILERSKEPVSGAQLAEEL...`, disabled: isBusy, slotProps: {
|
|
70
|
+
input: { className: classes.sequenceInput },
|
|
71
71
|
} }))) : null,
|
|
72
72
|
di3Sequence ? (React.createElement("div", { className: classes.di3Section },
|
|
73
73
|
React.createElement(Typography, { variant: "subtitle2" }, "3Di structural alphabet (used for searching):"),
|
|
74
|
-
React.createElement(TextField, { multiline: true, rows: 4, value: di3Sequence,
|
|
75
|
-
className: classes.sequenceInput,
|
|
76
|
-
readOnly: true,
|
|
74
|
+
React.createElement(TextField, { multiline: true, rows: 4, value: di3Sequence, slotProps: {
|
|
75
|
+
input: { className: classes.sequenceInput, readOnly: true },
|
|
77
76
|
} }))) : null,
|
|
78
77
|
React.createElement(FoldseekDatabaseSelector, { selected: selectedDatabases, onChange: setSelectedDatabases, disabled: isBusy }),
|
|
79
78
|
statusMessage ? (React.createElement(LoadingEllipses, { variant: "subtitle2", message: statusMessage })) : null,
|
|
@@ -13,10 +13,13 @@ export async function launchProteinAnnotationView({ session, feature, selectedTr
|
|
|
13
13
|
const proteinLinkage = connectedViewId && selectedTranscript
|
|
14
14
|
? { connectedViewId, feature: selectedTranscript.toJSON(), uniprotId }
|
|
15
15
|
: undefined;
|
|
16
|
-
|
|
16
|
+
// a named object, because proteinLinkage comes from this plugin's own
|
|
17
|
+
// LinearGenomeView extension, which the launch snapshot type cannot see
|
|
18
|
+
const snapshot = {
|
|
17
19
|
type: 'LinearGenomeView',
|
|
18
20
|
displayName: formatViewName('Protein annotations', feature, selectedTranscript, uniprotId),
|
|
19
21
|
proteinLinkage,
|
|
20
|
-
}
|
|
22
|
+
};
|
|
23
|
+
const view = session.addView('LinearGenomeView', snapshot);
|
|
21
24
|
await view.navToLocString(uniprotId, uniprotId);
|
|
22
25
|
}
|
|
@@ -92,6 +92,18 @@ function addAlphaFoldConfidenceTrack({ session, uniprotId, confidenceUrl, }) {
|
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
94
|
assemblyNames: [uniprotId],
|
|
95
|
+
displays: [
|
|
96
|
+
{
|
|
97
|
+
type: 'LinearWiggleDisplay',
|
|
98
|
+
displayId: `${uniprotId}-AlphaFold-confidence-LinearWiggleDisplay`,
|
|
99
|
+
// pLDDT 50 is AlphaFold's own line between low and very low
|
|
100
|
+
// confidence: residues above it in AlphaFold's blue, below in its
|
|
101
|
+
// orange
|
|
102
|
+
bicolorPivot: 50,
|
|
103
|
+
posColor: '#0053d6',
|
|
104
|
+
negColor: '#ff7d45',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
95
107
|
});
|
|
96
108
|
}
|
|
97
109
|
}
|
|
@@ -115,14 +127,11 @@ function addAlphaMissenseTrack({ session, uniprotId, }) {
|
|
|
115
127
|
type: 'MultiLinearWiggleDisplay',
|
|
116
128
|
displayId: `${uniprotId}-AlphaMissense-scores-MultiLinearWiggleDisplay`,
|
|
117
129
|
defaultRendering: 'multirowdensity',
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
negColor: 'blue',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
130
|
+
// AlphaMissense's own reading: likely pathogenic red, likely benign
|
|
131
|
+
// blue, fading to white at the midpoint of its 0-1 score
|
|
132
|
+
bicolorPivot: 0.5,
|
|
133
|
+
posColor: '#d7191c',
|
|
134
|
+
negColor: '#2c7bb6',
|
|
126
135
|
},
|
|
127
136
|
],
|
|
128
137
|
});
|
|
@@ -34,14 +34,14 @@ export function getProteinSequence({ feature, seq, assemblyGeneticCodeId, }) {
|
|
|
34
34
|
const strand = feature.get('strand');
|
|
35
35
|
const subfeatures = feature.get('subfeatures') ?? [];
|
|
36
36
|
const cds = dedupe(subfeatures
|
|
37
|
+
.filter(sub => sub.get('type') === 'CDS')
|
|
37
38
|
.toSorted((a, b) => a.get('start') - b.get('start'))
|
|
38
39
|
.map(sub => ({
|
|
39
40
|
start: sub.get('start') - featureStart,
|
|
40
41
|
end: sub.get('end') - featureStart,
|
|
41
|
-
type:
|
|
42
|
+
type: 'CDS',
|
|
42
43
|
phase: sub.get('phase'),
|
|
43
|
-
}))
|
|
44
|
-
.filter(f => f.type === 'CDS'));
|
|
44
|
+
})));
|
|
45
45
|
// RefSeq declares transl_table=2 on a mitochondrial CDS, usually on the CDS
|
|
46
46
|
// rather than the transcript. GENCODE and UCSC declare nothing, so without
|
|
47
47
|
// the assembly's code all 13 human mitochondrial proteins read TGA as a stop
|
|
@@ -68,19 +68,20 @@ export async function fetchProteinSeq({ feature, session, assemblyName, }) {
|
|
|
68
68
|
throw new Error('assembly not found');
|
|
69
69
|
}
|
|
70
70
|
const sessionId = 'getSequence';
|
|
71
|
-
|
|
71
|
+
// a named object keeps sessionId, which v4 hosts read from the args
|
|
72
|
+
const args = {
|
|
72
73
|
adapterConfig: getConf(assembly, ['sequence', 'adapter']),
|
|
73
74
|
sessionId,
|
|
74
75
|
regions: [
|
|
75
76
|
{
|
|
76
77
|
start,
|
|
77
78
|
end,
|
|
78
|
-
refName: assembly.getCanonicalRefName(refName),
|
|
79
|
-
assemblyName,
|
|
79
|
+
refName: assembly.getCanonicalRefName(refName) ?? refName,
|
|
80
|
+
assemblyName: assembly.name,
|
|
80
81
|
},
|
|
81
82
|
],
|
|
82
|
-
}
|
|
83
|
-
const [feat] =
|
|
83
|
+
};
|
|
84
|
+
const [feat] = await rpcManager.call(sessionId, 'CoreGetFeatures', args);
|
|
84
85
|
const seq = feat?.get('seq');
|
|
85
86
|
return seq
|
|
86
87
|
? getProteinSequence({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isSessionWithAddTracks } from '
|
|
1
|
+
import { isSessionWithAddTracks } from './sessionWithAddTracks';
|
|
2
2
|
import { maybeLaunchSideBySide } from './sideBySide';
|
|
3
3
|
import { getGeneDisplayName, getTranscriptDisplayName } from './util';
|
|
4
4
|
import { proteinViewSnapshot } from '../../ProteinView/proteinViewSpec';
|
|
@@ -54,13 +54,16 @@ export function stripTrailingVersion(s) {
|
|
|
54
54
|
export function getId(val) {
|
|
55
55
|
return val === undefined ? '' : val.id();
|
|
56
56
|
}
|
|
57
|
+
function firstString(...vals) {
|
|
58
|
+
return vals.find((v) => typeof v === 'string') ?? '';
|
|
59
|
+
}
|
|
57
60
|
export function getTranscriptDisplayName(val) {
|
|
58
61
|
return val === undefined ? '' : (val.get('name') ?? val.get('id') ?? '');
|
|
59
62
|
}
|
|
60
63
|
export function getGeneDisplayName(val) {
|
|
61
64
|
return val === undefined
|
|
62
65
|
? ''
|
|
63
|
-
: (val.get('gene_name')
|
|
66
|
+
: firstString(val.get('gene_name'), val.get('name'), val.get('id'));
|
|
64
67
|
}
|
|
65
68
|
const DB_ID_PATTERNS = [
|
|
66
69
|
{ db: 'ensembl', pattern: /^ENS[A-Z]*G\d+/i, label: 'Ensembl gene' },
|
|
@@ -13,14 +13,6 @@ export default function LaunchProteinViewExtensionPointF(pluginManager) {
|
|
|
13
13
|
// assumption that the result was ignored; it is not. The handler returns
|
|
14
14
|
// its extendee at each exit now, like jbrowse-components' own
|
|
15
15
|
// LaunchDotplotView does.
|
|
16
|
-
//
|
|
17
|
-
// The suppression stays, and is NOT about the return value: this builds
|
|
18
|
-
// against @jbrowse/core 4.3.0, whose signature is `(extendee: T, props) => T`
|
|
19
|
-
// with no `| Promise<T>` and no ExtensionPointRegistry, so an async handler
|
|
20
|
-
// cannot be typed against it at all. jbrowse-components has since widened
|
|
21
|
-
// that signature; drop the suppression when the core dependency is bumped
|
|
22
|
-
// past it, not before.
|
|
23
|
-
// @ts-expect-error
|
|
24
16
|
async (args) => {
|
|
25
17
|
const { session, url, uniprotId, pdbId, transcriptId, userProvidedTranscriptSequence, feature, connectedViewId, connectedView, alignmentAlgorithm, colorScheme, displayName, height, showControls, showHighlight, showAlignment, showProteinTracks, compactTracks, autoScrollAlignment, zoomToBaseLevel, sideBySide, initialSelection, initialResidues, initialTranscriptResidues, } = args;
|
|
26
18
|
const requested = args.structures?.length
|
|
@@ -77,6 +69,8 @@ export default function LaunchProteinViewExtensionPointF(pluginManager) {
|
|
|
77
69
|
(connectedView
|
|
78
70
|
? session.addView('LinearGenomeView', {
|
|
79
71
|
type: 'LinearGenomeView',
|
|
72
|
+
// a spec's connectedView is unvalidated json, so a missing
|
|
73
|
+
// assembly reaches the view and is reported there, as before
|
|
80
74
|
init: connectedView,
|
|
81
75
|
}).id
|
|
82
76
|
: undefined);
|
|
@@ -72,11 +72,13 @@ export async function resolveShortLaunch({ session, structureUrl, transcriptId,
|
|
|
72
72
|
if (!trackConf) {
|
|
73
73
|
continue;
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
// a named object keeps sessionId, which v4 hosts read from the args
|
|
76
|
+
const args = {
|
|
76
77
|
adapterConfig: readConfObject(trackConf, 'adapter'),
|
|
77
78
|
sessionId,
|
|
78
79
|
regions: [region],
|
|
79
|
-
}
|
|
80
|
+
};
|
|
81
|
+
const feats = await session.rpcManager.call(sessionId, 'CoreGetFeatures', args);
|
|
80
82
|
for (const feat of feats) {
|
|
81
83
|
transcripts.push(...getTranscriptFeatures(feat));
|
|
82
84
|
}
|
|
@@ -9,9 +9,9 @@ import { genomeHoverToTranscriptPos } from './util';
|
|
|
9
9
|
* this holds for any alignment whose query row is linked to the transcript,
|
|
10
10
|
* such as a Pfam seed row cut to one domain.
|
|
11
11
|
*/
|
|
12
|
-
export function connectedHoverTranscriptPos({ hovered, views, mapping, connectedViewId, genomeViewReady, }) {
|
|
12
|
+
export function connectedHoverTranscriptPos({ hovered, views, mapping, connectedViewId, genomeViewReady, canonical = r => r, }) {
|
|
13
13
|
const fromGenome = genomeViewReady
|
|
14
|
-
? genomeHoverToTranscriptPos(hovered, mapping)
|
|
14
|
+
? genomeHoverToTranscriptPos(hovered, mapping, canonical)
|
|
15
15
|
: undefined;
|
|
16
16
|
if (fromGenome !== undefined) {
|
|
17
17
|
return { transcriptPos: fromGenome, source: 'genome' };
|
|
@@ -19,7 +19,7 @@ export function connectedHoverTranscriptPos({ hovered, views, mapping, connected
|
|
|
19
19
|
const codon = connectedViewId
|
|
20
20
|
? views.find(v => v.type === 'MsaView' && v.connectedViewId === connectedViewId)?.connectedHoverHighlights?.[0]
|
|
21
21
|
: undefined;
|
|
22
|
-
const fromMsa = mapping && codon
|
|
22
|
+
const fromMsa = mapping && codon && canonical(codon.refName) === canonical(mapping.refName)
|
|
23
23
|
? mapping.g2p[codon.start]
|
|
24
24
|
: undefined;
|
|
25
25
|
return fromMsa === undefined
|
|
@@ -990,13 +990,15 @@ const Structure = types
|
|
|
990
990
|
}
|
|
991
991
|
}));
|
|
992
992
|
addDisposer(self, autorun(() => {
|
|
993
|
-
const { hovered, views } = getSession(self);
|
|
993
|
+
const { hovered, views, assemblyManager } = getSession(self);
|
|
994
|
+
const assembly = assemblyManager.get(self.connectedView?.assemblyNames[0] ?? '');
|
|
994
995
|
const hover = connectedHoverTranscriptPos({
|
|
995
996
|
hovered,
|
|
996
997
|
views,
|
|
997
998
|
mapping: self.genomeToTranscriptSeqMapping,
|
|
998
999
|
connectedViewId: self.connectedViewId,
|
|
999
1000
|
genomeViewReady: !!self.connectedView?.initialized,
|
|
1001
|
+
canonical: r => assembly?.getCanonicalRefName(r) ?? r,
|
|
1000
1002
|
});
|
|
1001
1003
|
if (hover) {
|
|
1002
1004
|
self.setConnectedHoveredPosition(self.transcriptSeqToStructureSeqPosition?.[hover.transcriptPos], hover.source);
|
package/dist/ProteinView/util.js
CHANGED
|
@@ -19,11 +19,22 @@ export function invertMap(arg) {
|
|
|
19
19
|
* the transcript's *own* refName, so the refName gate is load-bearing: without
|
|
20
20
|
* it the same numeric coordinate on an unrelated chromosome matches a key and
|
|
21
21
|
* reports a residue for a different locus.
|
|
22
|
+
*
|
|
23
|
+
* The two sides name the chromosome independently, so the gate has to compare
|
|
24
|
+
* canonical names. The view reports the assembly's own (`1` on jbrowse.org's
|
|
25
|
+
* hg38), while the mapping carries the feature's, straight out of the file
|
|
26
|
+
* (`chr1` in GENCODE) — equal strings only by luck of which pair of files a
|
|
27
|
+
* config happens to use. Compared raw, every hover on such a config silently
|
|
28
|
+
* missed, which is how it shipped: nothing throws, the residue just never
|
|
29
|
+
* lights up. `canonical` defaults to identity so the pure function stays
|
|
30
|
+
* testable; the model passes the assembly's resolver.
|
|
22
31
|
*/
|
|
23
|
-
export function genomeHoverToTranscriptPos(hovered, mapping) {
|
|
32
|
+
export function genomeHoverToTranscriptPos(hovered, mapping, canonical = r => r) {
|
|
24
33
|
if (!mapping || !checkHovered(hovered)) {
|
|
25
34
|
return undefined;
|
|
26
35
|
}
|
|
27
36
|
const { coord, refName } = hovered.hoverPosition;
|
|
28
|
-
return refName === mapping.refName
|
|
37
|
+
return canonical(refName) === canonical(mapping.refName)
|
|
38
|
+
? mapping.g2p[coord - 1]
|
|
39
|
+
: undefined;
|
|
29
40
|
}
|