jbrowse-plugin-protein3d 0.0.2 → 0.0.3

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.
Files changed (84) hide show
  1. package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js +44 -27
  2. package/dist/LaunchProteinView/components/AlphaFoldDBSearch.js.map +1 -1
  3. package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.d.ts +7 -4
  4. package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.js +30 -11
  5. package/dist/LaunchProteinView/components/AlphaFoldDBSearchStatus.js.map +1 -1
  6. package/dist/LaunchProteinView/components/HelpDialog.js +10 -3
  7. package/dist/LaunchProteinView/components/HelpDialog.js.map +1 -1
  8. package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js +3 -7
  9. package/dist/LaunchProteinView/components/LaunchProteinViewDialog.js.map +1 -1
  10. package/dist/LaunchProteinView/components/MSATable.d.ts +10 -0
  11. package/dist/LaunchProteinView/components/MSATable.js +53 -0
  12. package/dist/LaunchProteinView/components/MSATable.js.map +1 -0
  13. package/dist/LaunchProteinView/components/TranscriptSelector.d.ts +7 -3
  14. package/dist/LaunchProteinView/components/TranscriptSelector.js +22 -7
  15. package/dist/LaunchProteinView/components/TranscriptSelector.js.map +1 -1
  16. package/dist/LaunchProteinView/components/UserProvidedStructure.js +56 -43
  17. package/dist/LaunchProteinView/components/UserProvidedStructure.js.map +1 -1
  18. package/dist/LaunchProteinView/components/calculateProteinSequence.js.map +1 -0
  19. package/dist/LaunchProteinView/components/useIsoformProteinSequences.d.ts +14 -0
  20. package/dist/LaunchProteinView/{useProteinSequences.js → components/useIsoformProteinSequences.js} +11 -6
  21. package/dist/LaunchProteinView/components/useIsoformProteinSequences.js.map +1 -0
  22. package/dist/LaunchProteinView/components/useLocalStructureFileSequence.d.ts +7 -0
  23. package/dist/LaunchProteinView/components/useLocalStructureFileSequence.js +44 -0
  24. package/dist/LaunchProteinView/components/useLocalStructureFileSequence.js.map +1 -0
  25. package/dist/LaunchProteinView/{useMyGeneInfo.d.ts → components/useMyGeneInfoUniprotIdLookup.d.ts} +2 -2
  26. package/dist/LaunchProteinView/{useMyGeneInfo.js → components/useMyGeneInfoUniprotIdLookup.js} +15 -10
  27. package/dist/LaunchProteinView/components/useMyGeneInfoUniprotIdLookup.js.map +1 -0
  28. package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.d.ts +7 -0
  29. package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.js +42 -0
  30. package/dist/LaunchProteinView/components/useRemoteStructureFileSequence.js.map +1 -0
  31. package/dist/LaunchProteinView/{util.d.ts → components/util.d.ts} +0 -10
  32. package/dist/LaunchProteinView/{util.js → components/util.js} +3 -24
  33. package/dist/LaunchProteinView/components/util.js.map +1 -0
  34. package/dist/LaunchProteinView/index.js +1 -1
  35. package/dist/LaunchProteinView/index.js.map +1 -1
  36. package/dist/ProteinView/components/Header.js +1 -1
  37. package/dist/ProteinView/components/Header.js.map +1 -1
  38. package/dist/ProteinView/components/SplitString.js +1 -1
  39. package/dist/ProteinView/components/SplitString.js.map +1 -1
  40. package/dist/ProteinView/model.d.ts +8 -4
  41. package/dist/ProteinView/model.js +39 -13
  42. package/dist/ProteinView/model.js.map +1 -1
  43. package/dist/index.js +0 -9
  44. package/dist/index.js.map +1 -1
  45. package/dist/jbrowse-plugin-protein3d.umd.production.min.js +147 -148
  46. package/dist/jbrowse-plugin-protein3d.umd.production.min.js.map +4 -4
  47. package/package.json +2 -2
  48. package/src/LaunchProteinView/components/AlphaFoldDBSearch.tsx +98 -47
  49. package/src/LaunchProteinView/components/AlphaFoldDBSearchStatus.tsx +65 -25
  50. package/src/LaunchProteinView/components/HelpDialog.tsx +35 -7
  51. package/src/LaunchProteinView/components/LaunchProteinViewDialog.tsx +1 -10
  52. package/src/LaunchProteinView/components/MSATable.tsx +96 -0
  53. package/src/LaunchProteinView/components/TranscriptSelector.tsx +36 -10
  54. package/src/LaunchProteinView/components/UserProvidedStructure.tsx +110 -64
  55. package/src/LaunchProteinView/{useProteinSequences.ts → components/useIsoformProteinSequences.ts} +12 -7
  56. package/src/LaunchProteinView/components/useLocalStructureFileSequence.ts +53 -0
  57. package/src/LaunchProteinView/{useMyGeneInfo.ts → components/useMyGeneInfoUniprotIdLookup.ts} +16 -11
  58. package/src/LaunchProteinView/components/useRemoteStructureFileSequence.ts +44 -0
  59. package/src/LaunchProteinView/{util.ts → components/util.ts} +3 -35
  60. package/src/LaunchProteinView/index.ts +1 -1
  61. package/src/ProteinView/components/Header.tsx +7 -5
  62. package/src/ProteinView/components/SplitString.tsx +1 -1
  63. package/src/ProteinView/model.ts +40 -12
  64. package/src/index.ts +1 -12
  65. package/dist/LaunchProteinView/calculateProteinSequence.js.map +0 -1
  66. package/dist/LaunchProteinView/components/PreLoadedStructureMapping.d.ts +0 -8
  67. package/dist/LaunchProteinView/components/PreLoadedStructureMapping.js +0 -72
  68. package/dist/LaunchProteinView/components/PreLoadedStructureMapping.js.map +0 -1
  69. package/dist/LaunchProteinView/components/useCheckAlphaFoldDBExistence.d.ts +0 -7
  70. package/dist/LaunchProteinView/components/useCheckAlphaFoldDBExistence.js +0 -26
  71. package/dist/LaunchProteinView/components/useCheckAlphaFoldDBExistence.js.map +0 -1
  72. package/dist/LaunchProteinView/useMyGeneInfo.js.map +0 -1
  73. package/dist/LaunchProteinView/useProteinSequences.d.ts +0 -10
  74. package/dist/LaunchProteinView/useProteinSequences.js.map +0 -1
  75. package/dist/LaunchProteinView/util.js.map +0 -1
  76. package/dist/ProteinModelSessionExtension.d.ts +0 -11
  77. package/dist/ProteinModelSessionExtension.js +0 -53
  78. package/dist/ProteinModelSessionExtension.js.map +0 -1
  79. package/src/LaunchProteinView/components/PreLoadedStructureMapping.tsx +0 -153
  80. package/src/LaunchProteinView/components/useCheckAlphaFoldDBExistence.ts +0 -31
  81. package/src/ProteinModelSessionExtension.ts +0 -71
  82. /package/dist/LaunchProteinView/{calculateProteinSequence.d.ts → components/calculateProteinSequence.d.ts} +0 -0
  83. /package/dist/LaunchProteinView/{calculateProteinSequence.js → components/calculateProteinSequence.js} +0 -0
  84. /package/src/LaunchProteinView/{calculateProteinSequence.ts → components/calculateProteinSequence.ts} +0 -0
@@ -1,25 +1,26 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { observer } from 'mobx-react';
3
- import { Button, DialogActions, DialogContent } from '@mui/material';
3
+ import { Button, DialogActions, DialogContent, Typography } from '@mui/material';
4
4
  import { makeStyles } from 'tss-react/mui';
5
5
  import { getContainingView, getSession, } from '@jbrowse/core/util';
6
6
  import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
7
7
  // locals
8
- import { getDisplayName, getGeneDisplayName, getId, getTranscriptDisplayName, getTranscriptFeatures, } from '../util';
8
+ import { getDisplayName, getGeneDisplayName, getId, getTranscriptDisplayName, getTranscriptFeatures, } from './util';
9
+ // components
9
10
  import TranscriptSelector from './TranscriptSelector';
10
11
  import HelpButton from './HelpButton';
11
- // hooks
12
- import useMyGeneInfo from '../useMyGeneInfo';
13
- import useAllSequences from '../useProteinSequences';
14
- import { useCheckAlphaFoldDBExistence } from './useCheckAlphaFoldDBExistence';
15
12
  import AlphaFoldDBSearchStatus from './AlphaFoldDBSearchStatus';
13
+ // hooks
14
+ import useMyGeneInfoUniprotIdLookup from './useMyGeneInfoUniprotIdLookup';
15
+ import useRemoteStructureFileSequence from './useRemoteStructureFileSequence';
16
+ import useIsoformProteinSequences from './useIsoformProteinSequences';
16
17
  const useStyles = makeStyles()(theme => ({
17
18
  dialogContent: {
18
19
  marginTop: theme.spacing(6),
19
20
  width: '80em',
20
21
  },
21
22
  }));
22
- const AlphaFoldDBSearch = observer(function AlphaFoldDBSearch({ feature, model, handleClose, }) {
23
+ const AlphaFoldDBSearch = observer(function ({ feature, model, handleClose, }) {
23
24
  const { classes } = useStyles();
24
25
  const session = getSession(model);
25
26
  // check if we are looking at a 'two-level' or 'three-level' feature by
@@ -28,38 +29,54 @@ const AlphaFoldDBSearch = observer(function AlphaFoldDBSearch({ feature, model,
28
29
  const [userSelection, setUserSelection] = useState();
29
30
  const view = getContainingView(model);
30
31
  const selectedTranscript = options.find(val => getId(val) === userSelection);
31
- const { seqs, error: error2 } = useAllSequences({ feature, view });
32
- const protein = seqs?.[userSelection ?? ''];
33
- const { result: foundStructureId, error } = useMyGeneInfo({
34
- id: selectedTranscript ? getDisplayName(selectedTranscript) : '',
32
+ const { isoformSequences, isLoading: isIsoformProteinSequencesLoading, error: isoformProteinSequencesError, } = useIsoformProteinSequences({
33
+ feature,
34
+ view,
35
35
  });
36
+ const userSelectedProteinSequence = isoformSequences?.[userSelection ?? ''];
37
+ const { uniprotId, isLoading: isMyGeneLoading, error: myGeneError, } = useMyGeneInfoUniprotIdLookup({
38
+ id: selectedTranscript
39
+ ? getDisplayName(selectedTranscript)
40
+ : getDisplayName(feature),
41
+ });
42
+ const url = uniprotId
43
+ ? `https://alphafold.ebi.ac.uk/files/AF-${uniprotId}-F1-model_v4.cif`
44
+ : undefined;
45
+ const { seq: structureSequence, isLoading: isRemoteStructureSequenceLoading, error: remoteStructureSequenceError, } = useRemoteStructureFileSequence({ url });
46
+ const e = myGeneError || isoformProteinSequencesError || remoteStructureSequenceError;
36
47
  useEffect(() => {
37
- if (userSelection === undefined && seqs !== undefined) {
38
- setUserSelection(options.find(f => !!seqs[f.id()])?.id());
48
+ if (isoformSequences !== undefined) {
49
+ const ret = options.find(f => isoformSequences[f.id()]?.seq.replaceAll('*', '') ==
50
+ structureSequence) ?? options.find(f => !!isoformSequences[f.id()]);
51
+ setUserSelection(ret?.id());
39
52
  }
40
- }, [options, userSelection, seqs]);
41
- const { success, loading, error: error3, } = useCheckAlphaFoldDBExistence({
42
- foundStructureId,
43
- });
44
- const e = error || error2 || error3;
45
- const url = `https://alphafold.ebi.ac.uk/files/AF-${foundStructureId}-F1-model_v4.cif`;
53
+ }, [options, structureSequence, isoformSequences]);
46
54
  return (React.createElement(React.Fragment, null,
47
55
  React.createElement(DialogContent, { className: classes.dialogContent },
48
56
  e ? React.createElement(ErrorMessage, { error: e }) : null,
49
- React.createElement("div", null,
50
- "Look up AlphaFoldDB structure for given transcript ",
57
+ React.createElement(Typography, null,
58
+ "Automatically find AlphaFoldDB entry for given transcript",
59
+ ' ',
51
60
  React.createElement(HelpButton, null)),
52
- seqs ? (React.createElement(React.Fragment, null,
53
- React.createElement(TranscriptSelector, { val: userSelection ?? '', setVal: setUserSelection, options: options, feature: feature, seqs: seqs }),
54
- selectedTranscript ? (React.createElement(AlphaFoldDBSearchStatus, { foundStructureId: foundStructureId, selectedTranscript: selectedTranscript, success: success, loading: loading })) : null)) : (React.createElement("div", { style: { margin: 20 } },
55
- React.createElement(LoadingEllipses, { message: "Loading protein sequences", variant: "h6" })))),
61
+ isRemoteStructureSequenceLoading ? (React.createElement(LoadingEllipses, { variant: "h6", message: "Loading sequence from remote structure file" })) : null,
62
+ isMyGeneLoading ? (React.createElement(LoadingEllipses, { variant: "h6", message: "Looking up UniProt ID from mygene.info" })) : !uniprotId ? (React.createElement("div", null,
63
+ "UniProt ID not found. Search sequence on AlphaFoldDB",
64
+ ' ',
65
+ React.createElement("a", { href: `https://alphafold.ebi.ac.uk/search/sequence/${userSelectedProteinSequence?.seq.replaceAll('*', '')}`, target: "_blank", rel: "noreferrer" }, "here"),
66
+ ' ',
67
+ React.createElement("br", null),
68
+ "After visiting the above link, then paste the structure URL into the Manual tab")) : null,
69
+ isIsoformProteinSequencesLoading ? (React.createElement(LoadingEllipses, { variant: "h6", message: "Loading protein sequences from transcript isoforms" })) : null,
70
+ isoformSequences && structureSequence && selectedTranscript ? (React.createElement(React.Fragment, null,
71
+ React.createElement(TranscriptSelector, { val: userSelection ?? '', setVal: setUserSelection, structureSequence: structureSequence, feature: feature, isoforms: options, isoformSequences: isoformSequences }),
72
+ React.createElement(AlphaFoldDBSearchStatus, { uniprotId: uniprotId, selectedTranscript: selectedTranscript, structureSequence: structureSequence, isoformSequences: isoformSequences }))) : null),
56
73
  React.createElement(DialogActions, null,
57
74
  React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel"),
58
- React.createElement(Button, { variant: "contained", color: "primary", disabled: !foundStructureId || !protein || !selectedTranscript, onClick: () => {
75
+ React.createElement(Button, { variant: "contained", color: "primary", disabled: !uniprotId || !userSelectedProteinSequence || !selectedTranscript, onClick: () => {
59
76
  session.addView('ProteinView', {
60
77
  type: 'ProteinView',
61
78
  url,
62
- seq2: protein,
79
+ seq2: userSelectedProteinSequence?.seq,
63
80
  feature: selectedTranscript?.toJSON(),
64
81
  connectedViewId: view.id,
65
82
  displayName: `Protein view ${getGeneDisplayName(feature)} - ${getTranscriptDisplayName(selectedTranscript)}`,
@@ -1 +1 @@
1
- {"version":3,"file":"AlphaFoldDBSearch.js","sourceRoot":"","sources":["../../../src/LaunchProteinView/components/AlphaFoldDBSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAGL,iBAAiB,EACjB,UAAU,GACX,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAGhE,SAAS;AACT,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,KAAK,EACL,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,SAAS,CAAA;AAChB,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,UAAU,MAAM,cAAc,CAAA;AAErC,QAAQ;AACR,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAC5C,OAAO,eAAe,MAAM,wBAAwB,CAAA;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B,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,GAClC,CACD,CACJ,CAAC,CAAC,CAAC,IAAI,CACM;QAChB,oBAAC,aAAa;YACZ,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,aAGrB;YACT,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,EACf,QAAQ,EACN,CAAC,SAAS,IAAI,CAAC,2BAA2B,IAAI,CAAC,kBAAkB,EAEnE,OAAO,EAAE,GAAG,EAAE;oBACZ,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE;wBAC7B,IAAI,EAAE,aAAa;wBACnB,GAAG;wBACH,IAAI,EAAE,2BAA2B,EAAE,GAAG;wBACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE;wBACrC,eAAe,EAAE,IAAI,CAAC,EAAE;wBACxB,WAAW,EAAE,gBAAgB,kBAAkB,CAAC,OAAO,CAAC,MAAM,wBAAwB,CAAC,kBAAkB,CAAC,EAAE;qBAC7G,CAAC,CAAA;oBACF,WAAW,EAAE,CAAA;gBACf,CAAC,aAGM,CACK,CACf,CACJ,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,iBAAiB,CAAA"}
@@ -1,8 +1,11 @@
1
1
  import React from 'react';
2
2
  import { Feature } from '@jbrowse/core/util';
3
- export default function AlphaFoldDBSearchStatus({ foundStructureId, selectedTranscript, success, loading, }: {
4
- foundStructureId?: string;
3
+ export default function AlphaFoldDBSearchStatus({ uniprotId, selectedTranscript, structureSequence, isoformSequences, }: {
4
+ uniprotId?: string;
5
5
  selectedTranscript: Feature;
6
- success: boolean;
7
- loading: boolean;
6
+ structureSequence?: string;
7
+ isoformSequences: Record<string, {
8
+ feature: Feature;
9
+ seq: string;
10
+ }>;
8
11
  }): React.JSX.Element;
@@ -1,19 +1,38 @@
1
- import React from 'react';
2
- import { Link, Typography } from '@mui/material';
3
- import { LoadingEllipses } from '@jbrowse/core/ui';
1
+ import React, { useState } from 'react';
2
+ import { Button, Link, Typography } from '@mui/material';
4
3
  // locals
5
- import { getDisplayName } from '../util';
6
- export default function AlphaFoldDBSearchStatus({ foundStructureId, selectedTranscript, success, loading, }) {
7
- return !foundStructureId ? (React.createElement(Typography, null,
4
+ import { getDisplayName } from './util';
5
+ import MSATable from './MSATable';
6
+ function NotFound({ uniprotId }) {
7
+ return (React.createElement(Typography, null,
8
+ "No structure found for this UniProtID in AlphaFoldDB",
9
+ ' ',
10
+ React.createElement(Link, { target: "_blank", href: `https://alphafold.ebi.ac.uk/search/text/${uniprotId}` }, "(search for results)")));
11
+ }
12
+ export default function AlphaFoldDBSearchStatus({ uniprotId, selectedTranscript, structureSequence, isoformSequences, }) {
13
+ const url = uniprotId
14
+ ? `https://alphafold.ebi.ac.uk/files/AF-${uniprotId}-F1-model_v4.cif`
15
+ : undefined;
16
+ const url2 = uniprotId
17
+ ? `https://www.uniprot.org/uniprotkb/${uniprotId}/entry`
18
+ : undefined;
19
+ const [showAllProteinSequences, setShowAllProteinSequences] = useState(false);
20
+ return !uniprotId ? (React.createElement(Typography, null,
8
21
  "Searching ",
9
22
  getDisplayName(selectedTranscript),
10
23
  " for UniProt ID")) : (React.createElement(React.Fragment, null,
11
24
  React.createElement(Typography, null,
12
- "Found Uniprot ID: ",
13
- foundStructureId),
14
- loading ? (React.createElement(LoadingEllipses, { title: "Looking up structure in AlphaFoldDB" })) : success ? (React.createElement(Typography, null, "Found structure in AlphaFoldDB")) : (React.createElement(Typography, null,
15
- "No structure found for this UniProtID in AlphaFoldDB",
25
+ "Found Uniprot ID:",
26
+ ' ',
27
+ React.createElement("a", { href: url2, target: "_blank", rel: "noreferrer" }, uniprotId)),
28
+ React.createElement(Typography, null,
29
+ "AlphaFoldDB link:",
16
30
  ' ',
17
- React.createElement(Link, { target: "_blank", href: `https://alphafold.ebi.ac.uk/search/text/${foundStructureId}` }, "(search for results)")))));
31
+ React.createElement("a", { href: url, target: "_blank", rel: "noreferrer" }, url)),
32
+ structureSequence ? (React.createElement("div", { style: { margin: 20 } },
33
+ React.createElement(Button, { variant: "contained", color: "primary", onClick: () => setShowAllProteinSequences(!showAllProteinSequences) }, showAllProteinSequences
34
+ ? 'Hide all isoform protein sequences'
35
+ : 'Show all isoform protein sequences'),
36
+ showAllProteinSequences ? (React.createElement(MSATable, { structureSequence: structureSequence, structureName: uniprotId, isoformSequences: isoformSequences })) : null)) : (React.createElement(NotFound, { uniprotId: uniprotId }))));
18
37
  }
19
38
  //# sourceMappingURL=AlphaFoldDBSearchStatus.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AlphaFoldDBSearchStatus.js","sourceRoot":"","sources":["../../../src/LaunchProteinView/components/AlphaFoldDBSearchStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElD,SAAS;AACT,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,gBAAgB,EAChB,kBAAkB,EAClB,OAAO,EACP,OAAO,GAMR;IACC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CACzB,oBAAC,UAAU;;QACE,cAAc,CAAC,kBAAkB,CAAC;0BAClC,CACd,CAAC,CAAC,CAAC,CACF;QACE,oBAAC,UAAU;;YAAoB,gBAAgB,CAAc;QAC5D,OAAO,CAAC,CAAC,CAAC,CACT,oBAAC,eAAe,IAAC,KAAK,EAAC,qCAAqC,GAAG,CAChE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,oBAAC,UAAU,yCAA4C,CACxD,CAAC,CAAC,CAAC,CACF,oBAAC,UAAU;;YAC4C,GAAG;YACxD,oBAAC,IAAI,IACH,MAAM,EAAC,QAAQ,EACf,IAAI,EAAE,2CAA2C,gBAAgB,EAAE,2BAG9D,CACI,CACd,CACA,CACJ,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"AlphaFoldDBSearchStatus.js","sourceRoot":"","sources":["../../../src/LaunchProteinView/components/AlphaFoldDBSearchStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAGxD,SAAS;AACT,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAyB;IACpD,OAAO,CACL,oBAAC,UAAU;;QAC4C,GAAG;QACxD,oBAAC,IAAI,IACH,MAAM,EAAC,QAAQ,EACf,IAAI,EAAE,2CAA2C,SAAS,EAAE,2BAGvD,CACI,CACd,CAAA;AACH,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,GAMjB;IACC,MAAM,GAAG,GAAG,SAAS;QACnB,CAAC,CAAC,wCAAwC,SAAS,kBAAkB;QACrE,CAAC,CAAC,SAAS,CAAA;IACb,MAAM,IAAI,GAAG,SAAS;QACpB,CAAC,CAAC,qCAAqC,SAAS,QAAQ;QACxD,CAAC,CAAC,SAAS,CAAA;IACb,MAAM,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE7E,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAClB,oBAAC,UAAU;;QACE,cAAc,CAAC,kBAAkB,CAAC;0BAClC,CACd,CAAC,CAAC,CAAC,CACF;QACE,oBAAC,UAAU;;YACS,GAAG;YACrB,2BAAG,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,IAC5C,SAAS,CACR,CACO;QACb,oBAAC,UAAU;;YACS,GAAG;YACrB,2BAAG,IAAI,EAAE,GAAG,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,IAC3C,GAAG,CACF,CACO;QACZ,iBAAiB,CAAC,CAAC,CAAC,CACnB,6BAAK,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACxB,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,0BAA0B,CAAC,CAAC,uBAAuB,CAAC,IAElE,uBAAuB;gBACtB,CAAC,CAAC,oCAAoC;gBACtC,CAAC,CAAC,oCAAoC,CACjC;YACR,uBAAuB,CAAC,CAAC,CAAC,CACzB,oBAAC,QAAQ,IACP,iBAAiB,EAAE,iBAAiB,EACpC,aAAa,EAAE,SAAS,EACxB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC,CAAC,CAAC,IAAI,CACJ,CACP,CAAC,CAAC,CAAC,CACF,oBAAC,QAAQ,IAAC,SAAS,EAAE,SAAS,GAAI,CACnC,CACA,CACJ,CAAA;AACH,CAAC"}
@@ -5,10 +5,17 @@ function Typography2({ children }) {
5
5
  return React.createElement(Typography, { style: { margin: 4 } }, children);
6
6
  }
7
7
  export default function HelpDialog({ handleClose, }) {
8
- return (React.createElement(Dialog, { open: true, maxWidth: "lg", onClose: handleClose, title: "Protein alignment" },
8
+ return (React.createElement(Dialog, { open: true, maxWidth: "lg", onClose: handleClose, title: "Help" },
9
9
  React.createElement(DialogContent, null,
10
- React.createElement(Typography2, null, "This process searches mygene.info for the transcript ID, in order to retrieve the UniProt ID associated with a given transcript ID. Then, it uses that UniProt ID to lookup the structure in AlphaFoldDB because every UniProt ID has been processed by AlphaFold."),
11
- React.createElement(Typography2, null, "If you run into challenges with this workflow e.g. your transcripts are not being found in mygene.info and you are interested in using this plugin, contact colin.diesh@gmail.com")),
10
+ React.createElement(Typography2, null,
11
+ "The procedure for the protein lookup is as follows:",
12
+ React.createElement("ul", null,
13
+ React.createElement("li", null, "(Automatic lookup) Searches mygene.info for the transcript ID, in order to retrieve the UniProt ID associated with a given transcript ID and then, the UniProt ID is used to lookup the structure in AlphaFoldDB"),
14
+ React.createElement("li", null, "(Manual) Allows you to choose your own structure file from your local machine (e.g. a PDB file predicted by e.g. ColabFold) or supply a specific URL"),
15
+ React.createElement("li", null, "The residues from the structure are downloaded, and then you can choose the transcript isoform from the selected gene that best represents the structure. Asterisks are displayed if there is an exact sequence match"),
16
+ React.createElement("li", null, "The residues from the structure are finally aligned to the to the selected transcript's protein sequence representation, and this creates a mapping from the reference genome coordinates to positions in the 3-D structure"),
17
+ React.createElement("li", null, "Finally the molstar panel is opened, and this contains many specialized features features, plus additional mouseover and selection features supplied by the plugin to connect mouse click actions and mouse hover with coordinates on the linear genome view"))),
18
+ React.createElement(Typography2, null, "If you run into challenges with this workflow e.g. your transcripts are not being found in mygene.info then you can use the Manual import form, or contact colin.diesh@gmail.com for troubleshooting")),
12
19
  React.createElement(Divider, null),
13
20
  React.createElement(DialogActions, null,
14
21
  React.createElement(Button, { onClick: () => handleClose(), color: "primary" }, "Close"))));
@@ -1 +1 @@
1
- {"version":3,"file":"HelpDialog.js","sourceRoot":"","sources":["../../../src/LaunchProteinView/components/HelpDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,OAAO,EACP,UAAU,GAEX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,SAAS,WAAW,CAAC,EAAE,QAAQ,EAAmB;IAChD,OAAO,oBAAC,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CACF,CACO;YACd,oBAAC,WAAW,+MAIE,CACA;QAChB,oBAAC,OAAO,OAAG;QACX,oBAAC,aAAa;YACZ,oBAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,EAAE,KAAK,EAAC,SAAS,YAE5C,CACK,CACT,CACV,CAAA;AACH,CAAC"}
@@ -2,7 +2,6 @@ import React, { useState } from 'react';
2
2
  import { Dialog } from '@jbrowse/core/ui';
3
3
  import { Tab, Tabs } from '@mui/material';
4
4
  // locals
5
- import PreLoadedStructureMapping from './PreLoadedStructureMapping';
6
5
  import AlphaFoldDBSearch from './AlphaFoldDBSearch';
7
6
  import UserProvidedStructure from './UserProvidedStructure';
8
7
  import TabPanel from './TabPanel';
@@ -10,14 +9,11 @@ export default function LaunchProteinViewDialog({ handleClose, feature, model, }
10
9
  const [choice, setChoice] = useState(0);
11
10
  return (React.createElement(Dialog, { maxWidth: "xl", title: "Launch protein view", onClose: () => handleClose(), open: true },
12
11
  React.createElement(Tabs, { value: choice, onChange: (_, val) => setChoice(val) },
13
- React.createElement(Tab, { value: 0, label: "AlphaFoldDB search" }),
14
- React.createElement(Tab, { value: 1, label: "Manual" }),
15
- React.createElement(Tab, { value: 2, label: "Pre-configured" })),
12
+ React.createElement(Tab, { value: 0, label: "Automatic lookup" }),
13
+ React.createElement(Tab, { value: 1, label: "Manual" })),
16
14
  React.createElement(TabPanel, { value: choice, index: 0 },
17
15
  React.createElement(AlphaFoldDBSearch, { model: model, feature: feature, handleClose: handleClose })),
18
16
  React.createElement(TabPanel, { value: choice, index: 1 },
19
- React.createElement(UserProvidedStructure, { model: model, feature: feature, handleClose: handleClose })),
20
- React.createElement(TabPanel, { value: choice, index: 2 },
21
- React.createElement(PreLoadedStructureMapping, { feature: feature, model: model, handleClose: handleClose }))));
17
+ React.createElement(UserProvidedStructure, { model: model, feature: feature, handleClose: handleClose }))));
22
18
  }
23
19
  //# sourceMappingURL=LaunchProteinViewDialog.js.map
@@ -1 +1 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AAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,GACxB,CACO;QACX,oBAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YAC/B,oBAAC,qBAAqB,IACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,GACxB,CACO;QACX,oBAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YAC/B,oBAAC,yBAAyB,IACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,GACxB,CACO,CACJ,CACV,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"LaunchProteinViewDialog.js","sourceRoot":"","sources":["../../../src/LaunchProteinView/components/LaunchProteinViewDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAGzC,SAAS;AACT,OAAO,iBAAiB,MAAM,qBAAqB,CAAA;AACnD,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAC9C,WAAW,EACX,OAAO,EACP,KAAK,GAKN;IACC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IACvC,OAAO,CACL,oBAAC,MAAM,IACL,QAAQ,EAAC,IAAI,EACb,KAAK,EAAC,qBAAqB,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,EAC5B,IAAI;QAEJ,oBAAC,IAAI,IAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC;YACvD,oBAAC,GAAG,IAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAC,kBAAkB,GAAG;YAC1C,oBAAC,GAAG,IAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAC,QAAQ,GAAG,CAC3B;QACP,oBAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YAC/B,oBAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,GACxB,CACO;QACX,oBAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;YAC/B,oBAAC,qBAAqB,IACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,GACxB,CACO,CACJ,CACV,CAAA;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Feature } from '@jbrowse/core/util';
3
+ export default function MSATable({ structureName, structureSequence, isoformSequences, }: {
4
+ structureName: string;
5
+ structureSequence: string;
6
+ isoformSequences: Record<string, {
7
+ feature: Feature;
8
+ seq: string;
9
+ }>;
10
+ }): React.JSX.Element;
@@ -0,0 +1,53 @@
1
+ import React, { useState } from 'react';
2
+ import { Checkbox, FormControlLabel, TextField } from '@mui/material';
3
+ import { max } from '@jbrowse/core/util';
4
+ import { makeStyles } from 'tss-react/mui';
5
+ // locals
6
+ import { getTranscriptDisplayName } from './util';
7
+ const useStyles = makeStyles()({
8
+ textAreaFont: {
9
+ fontFamily: 'Courier New',
10
+ whiteSpace: 'pre',
11
+ },
12
+ margin: {
13
+ marginLeft: 20,
14
+ },
15
+ });
16
+ export default function MSATable({ structureName, structureSequence, isoformSequences, }) {
17
+ const { classes } = useStyles();
18
+ const [showInFastaFormat, setShowInFastaFormat] = useState(false);
19
+ const removedStars = Object.fromEntries(Object.entries(isoformSequences).map(([key, val]) => [
20
+ key,
21
+ { ...val, seq: val.seq.replaceAll('*', '') },
22
+ ]));
23
+ const exactMatchIsoformAndStructureSeq = Object.entries(removedStars).find(([_, val]) => structureSequence === val.seq);
24
+ const sname = `${structureName || ''} (structure residues)`;
25
+ const maxKeyLen = max([
26
+ sname.length,
27
+ ...Object.entries(removedStars).map(([_, val]) => getTranscriptDisplayName(val.feature).length),
28
+ ]);
29
+ const l1 = [
30
+ `${sname.padEnd(maxKeyLen)}${exactMatchIsoformAndStructureSeq ? '*' : ' '} ${structureSequence}`,
31
+ exactMatchIsoformAndStructureSeq
32
+ ? `${getTranscriptDisplayName(exactMatchIsoformAndStructureSeq[1].feature).padEnd(maxKeyLen)}* ${exactMatchIsoformAndStructureSeq[1].seq}`
33
+ : undefined,
34
+ ...Object.entries(removedStars)
35
+ .map(([_, val]) => `${getTranscriptDisplayName(val.feature).padEnd(maxKeyLen)} ${val.seq}`)
36
+ .filter(([k]) => k !== exactMatchIsoformAndStructureSeq?.[0]),
37
+ ]
38
+ .filter(f => !!f)
39
+ .join('\n');
40
+ const l2 = [
41
+ `>${sname}\n${structureSequence}`,
42
+ ...Object.values(removedStars).map(({ feature, seq }) => `>${getTranscriptDisplayName(feature)}\n${seq}`),
43
+ ].join('\n');
44
+ return (React.createElement(React.Fragment, null,
45
+ React.createElement(FormControlLabel, { className: classes.margin, control: React.createElement(Checkbox, { onChange: event => setShowInFastaFormat(event.target.checked), checked: showInFastaFormat }), label: "Show in FASTA format?" }),
46
+ React.createElement(TextField, { variant: "outlined", multiline: true, minRows: 5, maxRows: 10, fullWidth: true, value: showInFastaFormat ? l2 : l1, InputProps: {
47
+ readOnly: true,
48
+ classes: {
49
+ input: classes.textAreaFont,
50
+ },
51
+ } })));
52
+ }
53
+ //# sourceMappingURL=MSATable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MSATable.js","sourceRoot":"","sources":["../../../src/LaunchProteinView/components/MSATable.tsx"],"names":[],"mappings":"AA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G,EAAE,EAAE,EAAE,CAAC,IAAI,wBAAwB,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,CACtE;KACF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACZ,OAAO,CACL;QACE,oBAAC,gBAAgB,IACf,SAAS,EAAE,OAAO,CAAC,MAAM,EACzB,OAAO,EACL,oBAAC,QAAQ,IACP,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,EAC7D,OAAO,EAAE,iBAAiB,GAC1B,EAEJ,KAAK,EAAC,uBAAuB,GAC7B;QACF,oBAAC,SAAS,IACR,OAAO,EAAC,UAAU,EAClB,SAAS,QACT,OAAO,EAAE,CAAC,EACV,OAAO,EAAE,EAAE,EACX,SAAS,QACT,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClC,UAAU,EAAE;gBACV,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE;oBACP,KAAK,EAAE,OAAO,CAAC,YAAY;iBAC5B;aACF,GACD,CACD,CACJ,CAAA;AACH,CAAC"}
@@ -1,9 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Feature } from '@jbrowse/core/util';
3
- export default function TranscriptSelector({ val, setVal, options, feature, seqs, }: {
4
- options: Feature[];
3
+ export default function TranscriptSelector({ val, setVal, isoforms, isoformSequences, structureSequence, feature, }: {
4
+ isoforms: Feature[];
5
5
  feature: Feature;
6
6
  val: string;
7
7
  setVal: (str: string) => void;
8
- seqs: Record<string, string>;
8
+ structureSequence: string;
9
+ isoformSequences: Record<string, {
10
+ feature: Feature;
11
+ seq: string;
12
+ }>;
9
13
  }): React.JSX.Element;
@@ -1,24 +1,39 @@
1
1
  import React from 'react';
2
2
  import { MenuItem, TextField } from '@mui/material';
3
3
  // locals
4
- import { getGeneDisplayName, getTranscriptDisplayName } from '../util';
4
+ import { getGeneDisplayName, getTranscriptDisplayName } from './util';
5
5
  function TextField2({ children, ...rest }) {
6
6
  return (React.createElement("div", null,
7
7
  React.createElement(TextField, { ...rest }, children)));
8
8
  }
9
- export default function TranscriptSelector({ val, setVal, options, feature, seqs, }) {
9
+ export default function TranscriptSelector({ val, setVal, isoforms, isoformSequences, structureSequence, feature, }) {
10
10
  return (React.createElement(TextField2, { value: val, onChange: event => setVal(event.target.value), label: "Choose transcript isoform", select: true },
11
- options
12
- .filter(f => !!seqs[f.id()])
11
+ isoforms
12
+ .filter(f => !!isoformSequences[f.id()])
13
+ .filter(f => isoformSequences[f.id()].seq.replaceAll('*', '') ===
14
+ structureSequence)
13
15
  .map(f => (React.createElement(MenuItem, { value: f.id(), key: f.id() },
14
16
  getGeneDisplayName(feature),
15
17
  " - ",
16
18
  getTranscriptDisplayName(f),
17
19
  " (",
18
- seqs[f.id()].length,
20
+ isoformSequences[f.id()].seq.length,
21
+ "aa) (matches structure residues)"))),
22
+ isoforms
23
+ .filter(f => !!isoformSequences[f.id()])
24
+ .filter(f => isoformSequences[f.id()].seq.replaceAll('*', '') !==
25
+ structureSequence)
26
+ .sort((a, b) => isoformSequences[b.id()].seq.length -
27
+ isoformSequences[a.id()].seq.length)
28
+ .map(f => (React.createElement(MenuItem, { value: f.id(), key: f.id() },
29
+ getGeneDisplayName(feature),
30
+ " - ",
31
+ getTranscriptDisplayName(f),
32
+ " (",
33
+ isoformSequences[f.id()].seq.length,
19
34
  "aa)"))),
20
- options
21
- .filter(f => !seqs[f.id()])
35
+ isoforms
36
+ .filter(f => !isoformSequences[f.id()])
22
37
  .map(f => (React.createElement(MenuItem, { value: f.id(), key: f.id(), disabled: true },
23
38
  getGeneDisplayName(feature),
24
39
  " - ",
@@ -1 +1 @@
1
- {"version":3,"file":"TranscriptSelector.js","sourceRoot":"","sources":["../../../src/LaunchProteinView/components/TranscriptSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,SAAS,E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,CAAC,OAAO,CAAC;;YAAK,wBAAwB,CAAC,CAAC,CAAC;yBAEnD,CACZ,CAAC,CACO,CACd,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"TranscriptSelector.js","sourceRoot":"","sources":["../../../src/LaunchProteinView/components/TranscriptSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAkB,MAAM,eAAe,CAAA;AAGnE,SAAS;AACT,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAA;AAErE,SAAS,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAkB;IACvD,OAAO,CACL;QACE,oBAAC,SAAS,OAAK,IAAI,IAAG,QAAQ,CAAa,CACvC,CACP,CAAA;AACH,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,GAAG,EACH,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,GAQR;IACC,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAC7C,KAAK,EAAC,2BAA2B,EACjC,MAAM;QAEL,QAAQ;aACN,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;aACvC,MAAM,CACL,CAAC,CAAC,EAAE,CACF,gBAAgB,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;YAChD,iBAAiB,CACpB;aACA,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CACR,oBAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,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AAE,QAAQ;YAC3C,kBAAkB,CAAC,OAAO,CAAC;;YAAK,wBAAwB,CAAC,CAAC,CAAC;yBAEnD,CACZ,CAAC,CACO,CACd,CAAA;AACH,CAAC"}
@@ -1,14 +1,19 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { observer } from 'mobx-react';
3
- import { Button, DialogActions, Radio, RadioGroup, DialogContent, TextField, FormControlLabel, FormControl, Link, Typography, } from '@mui/material';
3
+ import { Button, DialogActions, DialogContent, FormControlLabel, FormControl, Link, Radio, RadioGroup, TextField, Typography, } from '@mui/material';
4
4
  import { makeStyles } from 'tss-react/mui';
5
5
  import { getContainingView, getSession, } from '@jbrowse/core/util';
6
6
  import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui';
7
7
  // locals
8
- import { getGeneDisplayName, getId, getTranscriptDisplayName, getTranscriptFeatures, } from '../util';
8
+ import { getGeneDisplayName, getId, getTranscriptDisplayName, getTranscriptFeatures, } from './util';
9
+ // components
9
10
  import TranscriptSelector from './TranscriptSelector';
11
+ import MSATable from './MSATable';
12
+ import HelpButton from './HelpButton';
10
13
  // hooks
11
- import useAllSequences from '../useProteinSequences';
14
+ import useIsoformProteinSequences from './useIsoformProteinSequences';
15
+ import useLocalStructureFileSequence from './useLocalStructureFileSequence';
16
+ import useRemoteStructureFileSequence from './useRemoteStructureFileSequence';
12
17
  const useStyles = makeStyles()(theme => ({
13
18
  dialogContent: {
14
19
  marginTop: theme.spacing(6),
@@ -29,41 +34,49 @@ const UserProvidedStructure = observer(function ({ feature, model, handleClose,
29
34
  const { classes } = useStyles();
30
35
  const session = getSession(model);
31
36
  const [file, setFile] = useState();
37
+ const [pdbId, setPdbId] = useState('');
32
38
  const [choice, setChoice] = useState('file');
33
39
  const [error2, setError] = useState();
34
40
  const [structureURL, setStructureURL] = useState('');
35
- const [selection, setSelection] = useState();
41
+ const [userSelection, setUserSelection] = useState();
42
+ const [showAllProteinSequences, setShowAllProteinSequences] = useState(false);
36
43
  // check if we are looking at a 'two-level' or 'three-level' feature by
37
44
  // finding exon/CDS subfeatures. we want to select from transcript names
38
45
  const options = getTranscriptFeatures(feature);
39
46
  const view = getContainingView(model);
40
- const selectedTranscript = options.find(val => getId(val) === selection);
41
- const { seqs, error } = useAllSequences({ feature, view });
42
- const protein = seqs?.[selection ?? ''];
47
+ const selectedTranscript = options.find(val => getId(val) === userSelection);
48
+ const { isoformSequences, error } = useIsoformProteinSequences({
49
+ feature,
50
+ view,
51
+ });
52
+ const protein = isoformSequences?.[userSelection ?? ''];
53
+ const { seq: structureSequence1, error: error3 } = useLocalStructureFileSequence({ file });
54
+ const { seq: structureSequence2, error: error4 } = useRemoteStructureFileSequence({ url: structureURL });
55
+ const structureName = file?.name ??
56
+ structureURL.slice(structureURL.lastIndexOf('/') + 1) ??
57
+ 'structureSequence';
58
+ const structureSequence = structureSequence1 ?? structureSequence2;
43
59
  useEffect(() => {
44
- if (selection === undefined && seqs !== undefined) {
45
- setSelection(options.find(f => !!seqs[f.id()])?.id());
60
+ if (isoformSequences !== undefined) {
61
+ const ret = options.find(f => isoformSequences[f.id()]?.seq.replaceAll('*', '') ==
62
+ structureSequence) ?? options.find(f => !!isoformSequences[f.id()]);
63
+ setUserSelection(ret?.id());
46
64
  }
47
- }, [options, selection, seqs]);
48
- const e = error || error2;
65
+ }, [options, structureSequence, isoformSequences]);
66
+ const e = error || error2 || error3 || error4;
49
67
  return (React.createElement(React.Fragment, null,
50
68
  React.createElement(DialogContent, { className: classes.dialogContent },
51
69
  e ? React.createElement(ErrorMessage, { error: e }) : null,
52
70
  React.createElement(HelpText, null),
53
- seqs ? (React.createElement(React.Fragment, null,
54
- React.createElement(TranscriptSelector, { val: selection ?? '', setVal: setSelection, options: options, feature: feature, seqs: seqs }),
55
- selectedTranscript ? (React.createElement(TextField, { variant: "outlined", multiline: true, minRows: 5, maxRows: 10, fullWidth: true, value: `>${selectedTranscript.get('name') || selectedTranscript.get('id')}\n${protein}`, InputProps: {
56
- readOnly: true,
57
- classes: {
58
- input: classes.textAreaFont,
59
- },
60
- } })) : null)) : (React.createElement("div", { style: { margin: 20 } },
61
- React.createElement(LoadingEllipses, { title: "Loading protein sequences", variant: "h6" }))),
62
71
  React.createElement("div", { style: { display: 'flex', margin: 30 } },
72
+ React.createElement(Typography, null,
73
+ "Open your structure file ",
74
+ React.createElement(HelpButton, null)),
63
75
  React.createElement(FormControl, { component: "fieldset" },
64
76
  React.createElement(RadioGroup, { value: choice, onChange: event => setChoice(event.target.value) },
65
77
  React.createElement(FormControlLabel, { value: "url", control: React.createElement(Radio, null), label: "URL" }),
66
- React.createElement(FormControlLabel, { value: "file", control: React.createElement(Radio, null), label: "File" }))),
78
+ React.createElement(FormControlLabel, { value: "file", control: React.createElement(Radio, null), label: "File" }),
79
+ React.createElement(FormControlLabel, { value: "pdb", control: React.createElement(Radio, null), label: "PDB ID" }))),
67
80
  choice === 'url' ? (React.createElement("div", null,
68
81
  React.createElement(Typography, null, "Open a PDB/mmCIF/etc. file from remote URL"),
69
82
  React.createElement(TextField, { label: "URL", value: structureURL, onChange: event => setStructureURL(event.target.value) }))) : null,
@@ -76,7 +89,19 @@ const UserProvidedStructure = observer(function ({ feature, model, handleClose,
76
89
  if (file) {
77
90
  setFile(file);
78
91
  }
79
- } })))) : null)),
92
+ } })))) : null,
93
+ choice === 'pdb' ? (React.createElement(TextField, { value: pdbId, onChange: event => {
94
+ const s = event.target.value;
95
+ setPdbId(s);
96
+ setStructureURL(`https://files.rcsb.org/download/${s}.cif`);
97
+ }, label: "PDB ID" })) : null),
98
+ React.createElement("div", { style: { margin: 20 } }, isoformSequences ? (structureSequence ? (React.createElement(React.Fragment, null,
99
+ React.createElement(TranscriptSelector, { val: userSelection ?? '', setVal: setUserSelection, structureSequence: structureSequence, isoforms: options, feature: feature, isoformSequences: isoformSequences }),
100
+ React.createElement("div", { style: { margin: 10 } },
101
+ React.createElement(Button, { variant: "contained", color: "primary", onClick: () => setShowAllProteinSequences(!showAllProteinSequences) }, showAllProteinSequences
102
+ ? 'Hide all isoform protein sequences'
103
+ : 'Show all isoform protein sequences'),
104
+ showAllProteinSequences ? (React.createElement(MSATable, { structureSequence: structureSequence, structureName: structureName, isoformSequences: isoformSequences })) : null))) : null) : (React.createElement(LoadingEllipses, { title: "Loading protein sequences", variant: "h6" })))),
80
105
  React.createElement(DialogActions, null,
81
106
  React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel"),
82
107
  React.createElement(Button, { variant: "contained", color: "primary", disabled: !(structureURL || file) || !protein || !selectedTranscript, onClick: () => {
@@ -84,27 +109,15 @@ const UserProvidedStructure = observer(function ({ feature, model, handleClose,
84
109
  ;
85
110
  (async () => {
86
111
  try {
87
- if (file) {
88
- const data = await file.text();
89
- session.addView('ProteinView', {
90
- type: 'ProteinView',
91
- data,
92
- seq2: protein,
93
- feature: selectedTranscript?.toJSON(),
94
- connectedViewId: view.id,
95
- displayName: `Protein view ${getGeneDisplayName(feature)} - ${getTranscriptDisplayName(selectedTranscript)}`,
96
- });
97
- }
98
- else if (structureURL) {
99
- session.addView('ProteinView', {
100
- type: 'ProteinView',
101
- url: structureURL,
102
- seq2: protein,
103
- feature: selectedTranscript?.toJSON(),
104
- connectedViewId: view.id,
105
- displayName: `Protein view ${getGeneDisplayName(feature)} - ${getTranscriptDisplayName(selectedTranscript)}`,
106
- });
107
- }
112
+ session.addView('ProteinView', {
113
+ type: 'ProteinView',
114
+ seq2: protein,
115
+ feature: selectedTranscript?.toJSON(),
116
+ connectedViewId: view.id,
117
+ displayName: `Protein view ${getGeneDisplayName(feature)} - ${getTranscriptDisplayName(selectedTranscript)}`,
118
+ ...(file ? { data: await file.text() } : {}),
119
+ ...(structureURL ? { url: structureURL } : {}),
120
+ });
108
121
  handleClose();
109
122
  }
110
123
  catch (e) {