jbrowse-plugin-msaview 2.4.4 → 2.5.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/dist/AddHighlightModel/GenomeMouseoverHighlight.js +2 -2
- package/dist/AddHighlightModel/HighlightComponents.js +0 -1
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js +5 -3
- package/dist/AddHighlightModel/index.js +2 -2
- package/dist/AddHighlightModel/util.d.ts +1 -6
- package/dist/AddHighlightModel/util.js +1 -7
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +0 -1
- package/dist/BgzipFastaMsaAdapter/configSchema.js +0 -1
- package/dist/BgzipFastaMsaAdapter/index.js +0 -1
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js +0 -1
- package/dist/LaunchMsaView/components/LaunchPanelContent.js +0 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +0 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.js +0 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js +0 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +0 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js +0 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.js +0 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/types.js +0 -1
- package/dist/LaunchMsaView/components/SubmitCancelActions.js +0 -1
- package/dist/LaunchMsaView/components/TabPanel.js +1 -2
- package/dist/LaunchMsaView/components/TranscriptSelector.js +0 -1
- package/dist/LaunchMsaView/components/calculateProteinSequence.js +0 -1
- package/dist/LaunchMsaView/components/fetchSeq.js +0 -1
- package/dist/LaunchMsaView/components/types.js +0 -1
- package/dist/LaunchMsaView/components/useFeatureSequence.js +0 -1
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js +0 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.js +0 -1
- package/dist/LaunchMsaView/components/util.js +0 -1
- package/dist/LaunchMsaView/index.js +0 -1
- package/dist/LaunchMsaView/util.js +1 -2
- package/dist/LaunchMsaViewExtensionPoint/index.js +0 -1
- package/dist/MsaViewPanel/afterCreateAutoruns.d.ts +8 -1
- package/dist/MsaViewPanel/afterCreateAutoruns.js +25 -21
- package/dist/MsaViewPanel/blosum62.js +0 -1
- package/dist/MsaViewPanel/components/ConnectStructureDialog.js +0 -1
- package/dist/MsaViewPanel/components/ErrorBoundary.d.ts +1 -1
- package/dist/MsaViewPanel/components/ErrorBoundary.js +0 -1
- package/dist/MsaViewPanel/components/LoadingBLAST.js +0 -1
- package/dist/MsaViewPanel/components/MsaViewPanel.js +0 -1
- package/dist/MsaViewPanel/components/RIDLink.js +0 -1
- package/dist/MsaViewPanel/doLaunchBlast.js +0 -1
- package/dist/MsaViewPanel/genomeToMSA.d.ts +0 -6
- package/dist/MsaViewPanel/genomeToMSA.js +8 -30
- package/dist/MsaViewPanel/genomeToMSA.test.js +0 -1
- package/dist/MsaViewPanel/index.js +0 -1
- package/dist/MsaViewPanel/model.d.ts +143 -514
- package/dist/MsaViewPanel/model.js +18 -61
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.js +5 -22
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.test.js +0 -1
- package/dist/MsaViewPanel/msaDataStore.js +0 -1
- package/dist/MsaViewPanel/pairwiseAlignment.js +2 -10
- package/dist/MsaViewPanel/pairwiseAlignment.test.js +0 -1
- package/dist/MsaViewPanel/structureConnection.d.ts +0 -6
- package/dist/MsaViewPanel/structureConnection.js +0 -17
- package/dist/MsaViewPanel/structureConnection.test.js +1 -52
- package/dist/MsaViewPanel/syncGenomeHoverToMsaColumn.test.d.ts +1 -0
- package/dist/MsaViewPanel/syncGenomeHoverToMsaColumn.test.js +92 -0
- package/dist/MsaViewPanel/types.js +0 -1
- package/dist/MsaViewPanel/util.d.ts +1 -3
- package/dist/MsaViewPanel/util.js +1 -3
- package/dist/components/ExternalLink.js +0 -1
- package/dist/components/ReadOnlyTextField2.js +0 -1
- package/dist/components/TextField2.js +0 -1
- package/dist/index.js +0 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +40 -40
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
- package/dist/utils/blastCache.js +2 -5
- package/dist/utils/fetch.js +0 -1
- package/dist/utils/msa.js +9 -9
- package/dist/utils/ncbiBlast.js +5 -6
- package/dist/utils/swrConfig.js +0 -1
- package/dist/utils/taxonomyNames.js +0 -1
- package/dist/utils/types.js +0 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -2
- package/package.json +11 -11
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +4 -1
- package/src/AddHighlightModel/MsaToGenomeHighlight.tsx +5 -8
- package/src/AddHighlightModel/index.tsx +4 -1
- package/src/AddHighlightModel/util.ts +1 -10
- package/src/LaunchMsaView/components/TabPanel.tsx +1 -1
- package/src/LaunchMsaView/util.ts +1 -3
- package/src/MsaViewPanel/afterCreateAutoruns.ts +24 -21
- package/src/MsaViewPanel/genomeToMSA.ts +10 -29
- package/src/MsaViewPanel/model.ts +21 -66
- package/src/MsaViewPanel/msaCoordToGenomeCoord.ts +5 -21
- package/src/MsaViewPanel/pairwiseAlignment.ts +2 -7
- package/src/MsaViewPanel/structureConnection.test.ts +1 -61
- package/src/MsaViewPanel/structureConnection.ts +0 -22
- package/src/MsaViewPanel/syncGenomeHoverToMsaColumn.test.ts +112 -0
- package/src/MsaViewPanel/util.ts +3 -7
- package/src/utils/blastCache.ts +2 -4
- package/src/utils/msa.ts +10 -8
- package/src/utils/ncbiBlast.ts +5 -6
- package/src/version.ts +1 -1
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +0 -1
- package/dist/AddHighlightModel/HighlightComponents.js.map +0 -1
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js.map +0 -1
- package/dist/AddHighlightModel/index.js.map +0 -1
- package/dist/AddHighlightModel/util.js.map +0 -1
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js.map +0 -1
- package/dist/BgzipFastaMsaAdapter/configSchema.js.map +0 -1
- package/dist/BgzipFastaMsaAdapter/index.js.map +0 -1
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +0 -1
- package/dist/LaunchMsaView/components/LaunchPanelContent.js.map +0 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +0 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.js.map +0 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js.map +0 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js.map +0 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +0 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js.map +0 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.js.map +0 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/types.js.map +0 -1
- package/dist/LaunchMsaView/components/SubmitCancelActions.js.map +0 -1
- package/dist/LaunchMsaView/components/TabPanel.js.map +0 -1
- package/dist/LaunchMsaView/components/TranscriptSelector.js.map +0 -1
- package/dist/LaunchMsaView/components/calculateProteinSequence.js.map +0 -1
- package/dist/LaunchMsaView/components/fetchSeq.js.map +0 -1
- package/dist/LaunchMsaView/components/types.js.map +0 -1
- package/dist/LaunchMsaView/components/useFeatureSequence.js.map +0 -1
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js.map +0 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.js.map +0 -1
- package/dist/LaunchMsaView/components/util.js.map +0 -1
- package/dist/LaunchMsaView/index.js.map +0 -1
- package/dist/LaunchMsaView/util.js.map +0 -1
- package/dist/LaunchMsaViewExtensionPoint/index.js.map +0 -1
- package/dist/MsaViewPanel/afterCreateAutoruns.js.map +0 -1
- package/dist/MsaViewPanel/blosum62.js.map +0 -1
- package/dist/MsaViewPanel/components/ConnectStructureDialog.js.map +0 -1
- package/dist/MsaViewPanel/components/ErrorBoundary.js.map +0 -1
- package/dist/MsaViewPanel/components/LoadingBLAST.js.map +0 -1
- package/dist/MsaViewPanel/components/MsaViewPanel.js.map +0 -1
- package/dist/MsaViewPanel/components/RIDLink.js.map +0 -1
- package/dist/MsaViewPanel/doLaunchBlast.js.map +0 -1
- package/dist/MsaViewPanel/genomeToMSA.js.map +0 -1
- package/dist/MsaViewPanel/genomeToMSA.test.js.map +0 -1
- package/dist/MsaViewPanel/index.js.map +0 -1
- package/dist/MsaViewPanel/model.js.map +0 -1
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.js.map +0 -1
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.test.js.map +0 -1
- package/dist/MsaViewPanel/msaDataStore.js.map +0 -1
- package/dist/MsaViewPanel/pairwiseAlignment.js.map +0 -1
- package/dist/MsaViewPanel/pairwiseAlignment.test.js.map +0 -1
- package/dist/MsaViewPanel/structureConnection.js.map +0 -1
- package/dist/MsaViewPanel/structureConnection.test.js.map +0 -1
- package/dist/MsaViewPanel/types.js.map +0 -1
- package/dist/MsaViewPanel/util.js.map +0 -1
- package/dist/components/ExternalLink.js.map +0 -1
- package/dist/components/ReadOnlyTextField2.js.map +0 -1
- package/dist/components/TextField2.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils/blastCache.js.map +0 -1
- package/dist/utils/fetch.js.map +0 -1
- package/dist/utils/msa.js.map +0 -1
- package/dist/utils/ncbiBlast.js.map +0 -1
- package/dist/utils/swrConfig.js.map +0 -1
- package/dist/utils/taxonomyNames.js.map +0 -1
- package/dist/utils/types.js.map +0 -1
- package/dist/version.js.map +0 -1
|
@@ -2,9 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { getSession } from '@jbrowse/core/util';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { hasHoverPosition, useStyles } from './util';
|
|
5
|
+
import { isMsaView } from '../MsaViewPanel/model';
|
|
5
6
|
const GenomeMouseoverHighlight = observer(function ({ model, }) {
|
|
6
7
|
const { hovered, views } = getSession(model);
|
|
7
|
-
const hasMsaView = views.some(s => s.
|
|
8
|
+
const hasMsaView = views.some(s => isMsaView(s) && s.connectedViewId === model.id);
|
|
8
9
|
return hasMsaView && hasHoverPosition(hovered) ? (React.createElement(GenomeMouseoverHighlightRenderer, { model: model, hovered: hovered })) : null;
|
|
9
10
|
});
|
|
10
11
|
const GenomeMouseoverHighlightRenderer = observer(function ({ model, hovered, }) {
|
|
@@ -21,4 +22,3 @@ const GenomeMouseoverHighlightRenderer = observer(function ({ model, hovered, })
|
|
|
21
22
|
return null;
|
|
22
23
|
});
|
|
23
24
|
export default GenomeMouseoverHighlight;
|
|
24
|
-
//# sourceMappingURL=GenomeMouseoverHighlight.js.map
|
|
@@ -2,14 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import { getSession } from '@jbrowse/core/util';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
4
|
import { hasHoverPosition, useStyles } from './util';
|
|
5
|
+
import { isMsaView } from '../MsaViewPanel/model';
|
|
5
6
|
import { getCanonicalRefName } from '../MsaViewPanel/util';
|
|
6
7
|
const MsaToGenomeHighlight = observer(function MsaToGenomeHighlight2({ model, }) {
|
|
7
8
|
const { views, hovered } = getSession(model);
|
|
8
|
-
const msaView = views
|
|
9
|
+
const msaView = views
|
|
10
|
+
.filter(isMsaView)
|
|
11
|
+
.find(v => v.connectedViewId === model.id);
|
|
9
12
|
const highlights = msaView?.connectedHighlights;
|
|
10
13
|
// Suppress codon highlight while hovering the LGV — GenomeMouseoverHighlight
|
|
11
14
|
// handles the single-bp display in that case
|
|
12
|
-
return !hasHoverPosition(hovered) && highlights?.length ? (React.createElement(MsaToGenomeHighlightRenderer, { model: model, highlights:
|
|
15
|
+
return !hasHoverPosition(hovered) && highlights?.length ? (React.createElement(MsaToGenomeHighlightRenderer, { model: model, highlights: highlights })) : null;
|
|
13
16
|
});
|
|
14
17
|
// Inner component: handles the scroll-dependent rendering
|
|
15
18
|
const MsaToGenomeHighlightRenderer = observer(function ({ model, highlights, }) {
|
|
@@ -33,4 +36,3 @@ const MsaToGenomeHighlightRenderer = observer(function ({ model, highlights, })
|
|
|
33
36
|
})));
|
|
34
37
|
});
|
|
35
38
|
export default MsaToGenomeHighlight;
|
|
36
|
-
//# sourceMappingURL=MsaToGenomeHighlight.js.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { getSession } from '@jbrowse/core/util';
|
|
3
3
|
import HighlightComponents from './HighlightComponents';
|
|
4
|
+
import { isMsaView } from '../MsaViewPanel/model';
|
|
4
5
|
export default function AddHighlightComponentsModelF(pluginManager) {
|
|
5
6
|
pluginManager.addToExtensionPoint('LinearGenomeView-TracksContainerComponent',
|
|
6
7
|
// @ts-expect-error
|
|
7
8
|
(rest, { model }) => {
|
|
8
9
|
// Quick check: don't add any components if no MSA view exists
|
|
9
10
|
const { views } = getSession(model);
|
|
10
|
-
const hasMsaView = views.some(v => v.
|
|
11
|
+
const hasMsaView = views.some(v => isMsaView(v) && v.connectedViewId === model.id);
|
|
11
12
|
if (!hasMsaView) {
|
|
12
13
|
return rest;
|
|
13
14
|
}
|
|
@@ -17,4 +18,3 @@ export default function AddHighlightComponentsModelF(pluginManager) {
|
|
|
17
18
|
];
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
hoverPosition: {
|
|
3
|
-
coord: number;
|
|
4
|
-
refName: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
1
|
+
export { hasHoverPosition } from '../MsaViewPanel/util';
|
|
7
2
|
export declare const useStyles: (params: void, muiStyleOverridesParams?: {
|
|
8
3
|
props: Record<string, unknown>;
|
|
9
4
|
ownerState?: Record<string, unknown> | undefined;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { makeStyles } from 'tss-react/mui';
|
|
2
|
-
export
|
|
3
|
-
return (!!hovered &&
|
|
4
|
-
typeof hovered === 'object' &&
|
|
5
|
-
'hoverPosition' in hovered &&
|
|
6
|
-
!!hovered.hoverPosition);
|
|
7
|
-
}
|
|
2
|
+
export { hasHoverPosition } from '../MsaViewPanel/util';
|
|
8
3
|
export const useStyles = makeStyles()({
|
|
9
4
|
highlight: {
|
|
10
5
|
height: '100%',
|
|
@@ -17,4 +12,3 @@ export const useStyles = makeStyles()({
|
|
|
17
12
|
overflow: 'hidden',
|
|
18
13
|
},
|
|
19
14
|
});
|
|
20
|
-
//# sourceMappingURL=util.js.map
|
|
@@ -26,4 +26,3 @@ export default function LaunchMsaViewDialog({ handleClose, feature, model, }) {
|
|
|
26
26
|
React.createElement(TabPanel, { value: value, index: "manual_msa" },
|
|
27
27
|
React.createElement(ManualMSALoader, { model: model, feature: feature, handleClose: handleClose }))));
|
|
28
28
|
}
|
|
29
|
-
//# sourceMappingURL=LaunchMsaViewDialog.js.map
|
|
@@ -77,4 +77,3 @@ const CachedBlastResults = observer(function ({ model, handleClose, feature, })
|
|
|
77
77
|
React.createElement(ListItemText, { primary: `${getResultDisplayName(result)} - ${result.blastDatabase}/${result.blastProgram} (${result.msaAlgorithm})`, secondary: `${new Date(result.timestamp).toLocaleString()} - Seq: ${result.proteinSequence.slice(0, 30)}...` }))))))));
|
|
78
78
|
});
|
|
79
79
|
export default CachedBlastResults;
|
|
80
|
-
//# sourceMappingURL=CachedBlastResults.js.map
|
|
@@ -9,4 +9,3 @@ export default function NCBIBlastMethodSelector({ lookupMethod, setLookupMethod,
|
|
|
9
9
|
React.createElement(FormControlLabel, { value: "rid", control: React.createElement(Radio, null), label: "Load from RID" }),
|
|
10
10
|
React.createElement(FormControlLabel, { value: "manual", control: React.createElement(Radio, null), label: "Manual" }))));
|
|
11
11
|
}
|
|
12
|
-
//# sourceMappingURL=NCBIBlastMethodSelector.js.map
|
|
@@ -2,4 +2,3 @@ export const BASE_BLAST_URL = 'https://blast.ncbi.nlm.nih.gov/Blast.cgi';
|
|
|
2
2
|
export const msaAlgorithms = ['clustalo', 'muscle', 'kalign', 'mafft'];
|
|
3
3
|
export const blastDatabaseOptions = ['nr', 'nr_cluster_seq'];
|
|
4
4
|
export const blastPrograms = ['blastp', 'quick-blastp'];
|
|
5
|
-
//# sourceMappingURL=consts.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
// this is from MUI example
|
|
3
3
|
export default function TabPanel({ children, value, index, ...other }) {
|
|
4
|
-
return (React.createElement("div", { role: "tabpanel", hidden: value !== index, ...other }, value === index ?
|
|
4
|
+
return (React.createElement("div", { role: "tabpanel", hidden: value !== index, ...other }, value === index ? children : null));
|
|
5
5
|
}
|
|
6
|
-
//# sourceMappingURL=TabPanel.js.map
|
|
@@ -26,7 +26,7 @@ export function getTranscriptFeatures(feature) {
|
|
|
26
26
|
export function getTranscriptLength(feature) {
|
|
27
27
|
const cdsLen = sum(feature
|
|
28
28
|
.get('subfeatures')
|
|
29
|
-
?.filter(f => f.get('type')
|
|
29
|
+
?.filter(f => f.get('type') === 'CDS')
|
|
30
30
|
.map(s => s.get('end') - s.get('start')) ?? []);
|
|
31
31
|
return {
|
|
32
32
|
len: Math.floor(cdsLen / 3),
|
|
@@ -79,4 +79,3 @@ export function getGeneIdentifiers(feature) {
|
|
|
79
79
|
feature.get('gene_name'),
|
|
80
80
|
]);
|
|
81
81
|
}
|
|
82
|
-
//# sourceMappingURL=util.js.map
|
|
@@ -3,7 +3,14 @@ export declare function loadStoredData(self: JBrowsePluginMsaViewModel): void;
|
|
|
3
3
|
export declare function storeDataToIndexedDB(self: JBrowsePluginMsaViewModel): void;
|
|
4
4
|
export declare function launchBlastIfNeeded(self: JBrowsePluginMsaViewModel): void;
|
|
5
5
|
export declare function processInit(self: JBrowsePluginMsaViewModel): void;
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Mirror the connected genome view's hover position onto the MSA's hovered
|
|
8
|
+
* column. Returns the autorun body so it can keep a flag tracking whether the
|
|
9
|
+
* MSA's mouseCol was set by this sync: that way an unrelated session hover
|
|
10
|
+
* change clears the column only when the genome put it there, never wiping a
|
|
11
|
+
* column the user is hovering directly in the MSA.
|
|
12
|
+
*/
|
|
13
|
+
export declare function syncGenomeHoverToMsaColumn(self: JBrowsePluginMsaViewModel): () => void;
|
|
7
14
|
export declare function highlightConnectedStructures(self: JBrowsePluginMsaViewModel): void;
|
|
8
15
|
export declare function autoConnectStructures(self: JBrowsePluginMsaViewModel): void;
|
|
9
16
|
export declare function observeProteinHighlights(self: JBrowsePluginMsaViewModel): void;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { getSession } from '@jbrowse/core/util';
|
|
2
2
|
import { doLaunchBlast } from './doLaunchBlast';
|
|
3
|
-
import {
|
|
3
|
+
import { genomeToMSA } from './genomeToMSA';
|
|
4
4
|
import { cleanupOldData, generateDataStoreId, retrieveMsaData, storeMsaData, } from './msaDataStore';
|
|
5
5
|
import { gappedToUngappedPosition, getProteinViews, } from './structureConnection';
|
|
6
6
|
import { getUniprotIdFromAlphaFoldUrl } from './util';
|
|
7
7
|
export function loadStoredData(self) {
|
|
8
8
|
const { dataStoreId, rows } = self;
|
|
9
9
|
if (dataStoreId && rows.length === 0) {
|
|
10
|
-
|
|
11
|
-
;
|
|
12
|
-
(async () => {
|
|
10
|
+
void (async () => {
|
|
13
11
|
try {
|
|
14
12
|
self.setLoadingStoredData(true);
|
|
15
13
|
const storedData = await retrieveMsaData(dataStoreId);
|
|
@@ -44,7 +42,7 @@ export function storeDataToIndexedDB(self) {
|
|
|
44
42
|
// data observables change while the write is pending) don't kick off a
|
|
45
43
|
// duplicate write and leave an orphan IndexedDB entry
|
|
46
44
|
self.setIsStoringData(true);
|
|
47
|
-
(async () => {
|
|
45
|
+
void (async () => {
|
|
48
46
|
try {
|
|
49
47
|
const newId = generateDataStoreId();
|
|
50
48
|
const success = await storeMsaData(newId, {
|
|
@@ -68,9 +66,7 @@ export function storeDataToIndexedDB(self) {
|
|
|
68
66
|
}
|
|
69
67
|
export function launchBlastIfNeeded(self) {
|
|
70
68
|
if (self.blastParams) {
|
|
71
|
-
|
|
72
|
-
;
|
|
73
|
-
(async () => {
|
|
69
|
+
void (async () => {
|
|
74
70
|
try {
|
|
75
71
|
self.setProgress('Submitting query');
|
|
76
72
|
self.setError(undefined);
|
|
@@ -91,9 +87,7 @@ export function launchBlastIfNeeded(self) {
|
|
|
91
87
|
export function processInit(self) {
|
|
92
88
|
const { init } = self;
|
|
93
89
|
if (init) {
|
|
94
|
-
|
|
95
|
-
;
|
|
96
|
-
(async () => {
|
|
90
|
+
void (async () => {
|
|
97
91
|
try {
|
|
98
92
|
self.setError(undefined);
|
|
99
93
|
const { msaData, msaUrl, treeData, treeUrl, querySeqName } = init;
|
|
@@ -138,15 +132,26 @@ export function processInit(self) {
|
|
|
138
132
|
})();
|
|
139
133
|
}
|
|
140
134
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Mirror the connected genome view's hover position onto the MSA's hovered
|
|
137
|
+
* column. Returns the autorun body so it can keep a flag tracking whether the
|
|
138
|
+
* MSA's mouseCol was set by this sync: that way an unrelated session hover
|
|
139
|
+
* change clears the column only when the genome put it there, never wiping a
|
|
140
|
+
* column the user is hovering directly in the MSA.
|
|
141
|
+
*/
|
|
142
|
+
export function syncGenomeHoverToMsaColumn(self) {
|
|
143
|
+
let genomeDrivenCol = false;
|
|
144
|
+
return () => {
|
|
145
|
+
const col = genomeToMSA({ model: self });
|
|
146
|
+
if (col !== undefined) {
|
|
147
|
+
self.setMousePos(col);
|
|
148
|
+
genomeDrivenCol = true;
|
|
149
|
+
}
|
|
150
|
+
else if (genomeDrivenCol) {
|
|
151
|
+
self.setMousePos(undefined);
|
|
152
|
+
genomeDrivenCol = false;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
150
155
|
}
|
|
151
156
|
export function highlightConnectedStructures(self) {
|
|
152
157
|
const { mouseCol, connectedProteinViews } = self;
|
|
@@ -250,4 +255,3 @@ export function runCleanup() {
|
|
|
250
255
|
console.error('Failed to cleanup old MSA data:', e);
|
|
251
256
|
});
|
|
252
257
|
}
|
|
253
|
-
//# sourceMappingURL=afterCreateAutoruns.js.map
|
|
@@ -58,4 +58,3 @@ const ConnectStructureDialog = observer(function ConnectStructureDialog({ model,
|
|
|
58
58
|
React.createElement(Button, { onClick: handleConnect, variant: "contained", disabled: proteinViews.length === 0 || !selectedViewId }, "Connect"))));
|
|
59
59
|
});
|
|
60
60
|
export default ConnectStructureDialog;
|
|
61
|
-
//# sourceMappingURL=ConnectStructureDialog.js.map
|
|
@@ -14,6 +14,6 @@ export declare class ErrorBoundary extends Component<Props, State> {
|
|
|
14
14
|
error: unknown;
|
|
15
15
|
};
|
|
16
16
|
componentDidCatch(error: unknown, info: React.ErrorInfo): void;
|
|
17
|
-
render(): string | number | bigint | boolean |
|
|
17
|
+
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -31,4 +31,3 @@ const LoadingBLAST = observer(function LoadingBLAST2({ model, baseUrl, }) {
|
|
|
31
31
|
error ? (React.createElement(RIDError, { baseUrl: baseUrl, rid: rid, error: error })) : rid ? (React.createElement(RIDProgress, { baseUrl: baseUrl, rid: rid, progress: progress })) : (React.createElement(Typography, null, progress || 'Initializing BLAST query'))));
|
|
32
32
|
});
|
|
33
33
|
export default LoadingBLAST;
|
|
34
|
-
//# sourceMappingURL=LoadingBLAST.js.map
|
|
@@ -18,4 +18,3 @@ const MsaViewPanel = observer(function MsaViewPanel2({ model, }) {
|
|
|
18
18
|
React.createElement(LoadingEllipses, { message: "Loading MSA data", variant: "h6" }))) : (React.createElement(MSAView, { model: model })))));
|
|
19
19
|
});
|
|
20
20
|
export default MsaViewPanel;
|
|
21
|
-
//# sourceMappingURL=MsaViewPanel.js.map
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import type { JBrowsePluginMsaViewModel } from './model';
|
|
2
|
-
/**
|
|
3
|
-
* Convert a genome coordinate from session.hovered to a visible MSA column.
|
|
4
|
-
*
|
|
5
|
-
* @param model - The MSA view model
|
|
6
|
-
* @returns The visible column index, or undefined if no mapping exists
|
|
7
|
-
*/
|
|
8
2
|
export declare function genomeToMSA({ model }: {
|
|
9
3
|
model: JBrowsePluginMsaViewModel;
|
|
10
4
|
}): number | undefined;
|
|
@@ -1,48 +1,26 @@
|
|
|
1
1
|
import { getSession } from '@jbrowse/core/util';
|
|
2
|
-
import {
|
|
3
|
-
/**
|
|
4
|
-
* Convert a genome coordinate from session.hovered to a visible MSA column.
|
|
5
|
-
*
|
|
6
|
-
* @param model - The MSA view model
|
|
7
|
-
* @returns The visible column index, or undefined if no mapping exists
|
|
8
|
-
*/
|
|
2
|
+
import { hasHoverPosition } from './util';
|
|
9
3
|
export function genomeToMSA({ model }) {
|
|
10
4
|
const { hovered } = getSession(model);
|
|
11
5
|
const { querySeqName, transcriptToMsaMap, connectedView, mafRegion } = model;
|
|
12
|
-
if (!connectedView?.initialized || !
|
|
6
|
+
if (!connectedView?.initialized || !hasHoverPosition(hovered)) {
|
|
13
7
|
return undefined;
|
|
14
8
|
}
|
|
15
9
|
const { coord: hoverCoord, refName } = hovered.hoverPosition;
|
|
16
|
-
// Handle MAF region mapping
|
|
17
10
|
if (mafRegion) {
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
if (refName !== mafRegion.refName ||
|
|
12
|
+
!connectedView.assemblyNames.includes(mafRegion.assemblyName) ||
|
|
13
|
+
hoverCoord < mafRegion.start ||
|
|
14
|
+
hoverCoord >= mafRegion.end) {
|
|
20
15
|
return undefined;
|
|
21
16
|
}
|
|
22
|
-
|
|
23
|
-
const viewAssemblies = connectedView.assemblyNames;
|
|
24
|
-
if (!viewAssemblies.includes(mafRegion.assemblyName)) {
|
|
25
|
-
return undefined;
|
|
26
|
-
}
|
|
27
|
-
// Check if the hover coordinate is within the MAF region
|
|
28
|
-
if (hoverCoord < mafRegion.start || hoverCoord >= mafRegion.end) {
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
// Calculate the ungapped position relative to the region start
|
|
32
|
-
const ungappedPos = hoverCoord - mafRegion.start;
|
|
33
|
-
// Convert to visible column using the query sequence
|
|
34
|
-
return model.seqPosToVisibleCol(querySeqName, ungappedPos);
|
|
17
|
+
return model.seqPosToVisibleCol(querySeqName, hoverCoord - mafRegion.start);
|
|
35
18
|
}
|
|
36
|
-
// Handle transcript mapping (original behavior)
|
|
37
19
|
if (transcriptToMsaMap) {
|
|
38
|
-
const
|
|
39
|
-
// g2p maps genome coordinate to sequence position (0-based)
|
|
40
|
-
const seqPos = g2p[hoverCoord];
|
|
20
|
+
const seqPos = transcriptToMsaMap.g2p[hoverCoord];
|
|
41
21
|
if (seqPos !== undefined) {
|
|
42
|
-
// Convert sequence position to visible column
|
|
43
22
|
return model.seqPosToVisibleCol(querySeqName, seqPos);
|
|
44
23
|
}
|
|
45
24
|
}
|
|
46
25
|
return undefined;
|
|
47
26
|
}
|
|
48
|
-
//# sourceMappingURL=genomeToMSA.js.map
|