jbrowse-plugin-msaview 2.0.6 → 2.2.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.
Files changed (181) hide show
  1. package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +3 -3
  2. package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +1 -1
  3. package/dist/AddHighlightModel/MsaToGenomeHighlight.js +3 -1
  4. package/dist/AddHighlightModel/MsaToGenomeHighlight.js.map +1 -1
  5. package/dist/ExternalLink.d.ts +3 -0
  6. package/dist/ExternalLink.js +11 -0
  7. package/dist/ExternalLink.js.map +1 -0
  8. package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/NcbiBlastPanel.d.ts → EnsemblGeneTree/EnsemblGeneTree.d.ts} +2 -2
  9. package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js +76 -0
  10. package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js.map +1 -0
  11. package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.d.ts +13 -0
  12. package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.js +12 -0
  13. package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.js.map +1 -0
  14. package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.d.ts +6 -0
  15. package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js +25 -0
  16. package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js.map +1 -0
  17. package/dist/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.d.ts +2 -0
  18. package/dist/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.js +20 -0
  19. package/dist/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.js.map +1 -0
  20. package/dist/LaunchMsaView/components/EnsemblGeneTree/types.d.ts +24 -0
  21. package/dist/LaunchMsaView/components/EnsemblGeneTree/types.js +2 -0
  22. package/dist/LaunchMsaView/components/EnsemblGeneTree/types.js.map +1 -0
  23. package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.d.ts +10 -0
  24. package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.js +27 -0
  25. package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.js.map +1 -0
  26. package/dist/LaunchMsaView/components/EnsemblGeneTree/util.d.ts +4 -0
  27. package/dist/LaunchMsaView/components/EnsemblGeneTree/util.js +38 -0
  28. package/dist/LaunchMsaView/components/EnsemblGeneTree/util.js.map +1 -0
  29. package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js +22 -16
  30. package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
  31. package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.d.ts +8 -0
  32. package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +103 -0
  33. package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -0
  34. package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.d.ts +1 -0
  35. package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.js +12 -0
  36. package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.js.map +1 -0
  37. package/dist/LaunchMsaView/components/ManualMSALoader/launchView.d.ts +14 -0
  38. package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js +12 -0
  39. package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js.map +1 -0
  40. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.d.ts +10 -0
  41. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +89 -0
  42. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -0
  43. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.d.ts +10 -0
  44. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js +55 -0
  45. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js.map +1 -0
  46. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.d.ts +5 -0
  47. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js +11 -0
  48. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js.map +1 -0
  49. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.d.ts +7 -0
  50. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js +30 -0
  51. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js.map +1 -0
  52. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.d.ts +5 -0
  53. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js +26 -0
  54. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js.map +1 -0
  55. package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/ncbiBlastLaunchView.d.ts → NCBIBlastQuery/blastLaunchView.d.ts} +2 -1
  56. package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/ncbiBlastLaunchView.js → NCBIBlastQuery/blastLaunchView.js} +3 -6
  57. package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js.map +1 -0
  58. package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.d.ts +1 -0
  59. package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js +2 -0
  60. package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js.map +1 -0
  61. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +18 -19
  62. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
  63. package/dist/LaunchMsaView/components/TabPanel.d.ts +6 -0
  64. package/dist/LaunchMsaView/components/TabPanel.js +6 -0
  65. package/dist/LaunchMsaView/components/TabPanel.js.map +1 -0
  66. package/dist/LaunchMsaView/components/TranscriptSelector.d.ts +10 -0
  67. package/dist/LaunchMsaView/components/TranscriptSelector.js +45 -0
  68. package/dist/LaunchMsaView/components/TranscriptSelector.js.map +1 -0
  69. package/dist/LaunchMsaView/components/calculateProteinSequence.d.ts +17 -0
  70. package/dist/LaunchMsaView/components/calculateProteinSequence.js +39 -0
  71. package/dist/LaunchMsaView/components/calculateProteinSequence.js.map +1 -0
  72. package/dist/LaunchMsaView/components/fetchSeq.d.ts +8 -0
  73. package/dist/LaunchMsaView/components/fetchSeq.js +23 -0
  74. package/dist/LaunchMsaView/components/fetchSeq.js.map +1 -0
  75. package/dist/LaunchMsaView/components/types.d.ts +10 -0
  76. package/dist/LaunchMsaView/components/types.js +2 -0
  77. package/dist/LaunchMsaView/components/types.js.map +1 -0
  78. package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/useFeatureSequence.d.ts → useFeatureSequence.d.ts} +3 -6
  79. package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/useFeatureSequence.js → useFeatureSequence.js} +13 -23
  80. package/dist/LaunchMsaView/components/useFeatureSequence.js.map +1 -0
  81. package/dist/LaunchMsaView/components/util.js.map +1 -0
  82. package/dist/LaunchMsaView/util.d.ts +5 -1
  83. package/dist/LaunchMsaView/util.js +15 -1
  84. package/dist/LaunchMsaView/util.js.map +1 -1
  85. package/dist/MsaViewPanel/components/LoadingBLAST.d.ts +2 -1
  86. package/dist/MsaViewPanel/components/LoadingBLAST.js +6 -6
  87. package/dist/MsaViewPanel/components/LoadingBLAST.js.map +1 -1
  88. package/dist/MsaViewPanel/components/MsaViewPanel.js +1 -1
  89. package/dist/MsaViewPanel/components/MsaViewPanel.js.map +1 -1
  90. package/dist/MsaViewPanel/components/RIDLink.d.ts +2 -1
  91. package/dist/MsaViewPanel/components/RIDLink.js +6 -9
  92. package/dist/MsaViewPanel/components/RIDLink.js.map +1 -1
  93. package/dist/MsaViewPanel/doLaunchBlast.js +18 -20
  94. package/dist/MsaViewPanel/doLaunchBlast.js.map +1 -1
  95. package/dist/MsaViewPanel/model.d.ts +15 -12
  96. package/dist/MsaViewPanel/model.js.map +1 -1
  97. package/dist/ReadOnlyTextField2.d.ts +4 -0
  98. package/dist/ReadOnlyTextField2.js +20 -0
  99. package/dist/ReadOnlyTextField2.js.map +1 -0
  100. package/dist/index.d.ts +15 -0
  101. package/dist/index.js +17 -0
  102. package/dist/index.js.map +1 -1
  103. package/dist/jbrowse-plugin-msaview.umd.production.min.js +33 -31
  104. package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
  105. package/dist/utils/fetch.d.ts +1 -1
  106. package/dist/utils/fetch.js.map +1 -1
  107. package/dist/utils/ncbiBlast.d.ts +2 -2
  108. package/dist/utils/ncbiBlast.js +29 -15
  109. package/dist/utils/ncbiBlast.js.map +1 -1
  110. package/dist/utils/types.d.ts +20 -0
  111. package/dist/utils/types.js +2 -0
  112. package/dist/utils/types.js.map +1 -0
  113. package/package.json +3 -3
  114. package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +3 -3
  115. package/src/AddHighlightModel/MsaToGenomeHighlight.tsx +2 -1
  116. package/src/ExternalLink.tsx +15 -0
  117. package/src/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.tsx +127 -0
  118. package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.ts +30 -0
  119. package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.ts +46 -0
  120. package/src/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.ts +22 -0
  121. package/src/LaunchMsaView/components/EnsemblGeneTree/types.ts +28 -0
  122. package/src/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.ts +29 -0
  123. package/src/LaunchMsaView/components/EnsemblGeneTree/util.ts +45 -0
  124. package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +36 -21
  125. package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +219 -0
  126. package/src/LaunchMsaView/components/ManualMSALoader/fetchGeneList.ts +13 -0
  127. package/src/LaunchMsaView/components/ManualMSALoader/launchView.ts +34 -0
  128. package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +226 -0
  129. package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.tsx +111 -0
  130. package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.tsx +34 -0
  131. package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.tsx +82 -0
  132. package/src/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.tsx +75 -0
  133. package/src/LaunchMsaView/components/{NewNCBIBlastQuery/ncbiBlastLaunchView.ts → NCBIBlastQuery/blastLaunchView.ts} +4 -5
  134. package/src/LaunchMsaView/components/NCBIBlastQuery/consts.ts +1 -0
  135. package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +28 -44
  136. package/src/LaunchMsaView/components/TabPanel.tsx +19 -0
  137. package/src/LaunchMsaView/components/TranscriptSelector.tsx +99 -0
  138. package/src/LaunchMsaView/components/calculateProteinSequence.ts +68 -0
  139. package/src/LaunchMsaView/components/fetchSeq.ts +37 -0
  140. package/src/LaunchMsaView/components/types.ts +11 -0
  141. package/src/LaunchMsaView/components/{NewNCBIBlastQuery/useFeatureSequence.ts → useFeatureSequence.ts} +20 -42
  142. package/src/LaunchMsaView/util.ts +22 -2
  143. package/src/MsaViewPanel/components/LoadingBLAST.tsx +26 -8
  144. package/src/MsaViewPanel/components/MsaViewPanel.tsx +5 -1
  145. package/src/MsaViewPanel/components/RIDLink.tsx +8 -8
  146. package/src/MsaViewPanel/doLaunchBlast.ts +29 -30
  147. package/src/MsaViewPanel/model.ts +1 -0
  148. package/src/ReadOnlyTextField2.tsx +33 -0
  149. package/src/index.ts +23 -0
  150. package/src/utils/fetch.ts +2 -2
  151. package/src/utils/ncbiBlast.ts +40 -30
  152. package/src/utils/types.ts +14 -0
  153. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.js +0 -85
  154. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.js.map +0 -1
  155. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.d.ts +0 -26
  156. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.js +0 -48
  157. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.js.map +0 -1
  158. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/index.d.ts +0 -1
  159. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/index.js +0 -2
  160. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/index.js.map +0 -1
  161. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/ncbiBlastLaunchView.js.map +0 -1
  162. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/useFeatureSequence.js.map +0 -1
  163. package/dist/LaunchMsaView/components/NewNCBIBlastQuery/util.js.map +0 -1
  164. package/dist/LaunchMsaView/components/TabUtils.d.ts +0 -8
  165. package/dist/LaunchMsaView/components/TabUtils.js +0 -7
  166. package/dist/LaunchMsaView/components/TabUtils.js.map +0 -1
  167. package/dist/LaunchMsaView/components/tabUtil.d.ts +0 -4
  168. package/dist/LaunchMsaView/components/tabUtil.js +0 -7
  169. package/dist/LaunchMsaView/components/tabUtil.js.map +0 -1
  170. package/dist/OpenInNewIcon.d.ts +0 -3
  171. package/dist/OpenInNewIcon.js +0 -8
  172. package/dist/OpenInNewIcon.js.map +0 -1
  173. package/src/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.tsx +0 -171
  174. package/src/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.ts +0 -92
  175. package/src/LaunchMsaView/components/NewNCBIBlastQuery/index.tsx +0 -1
  176. package/src/LaunchMsaView/components/TabUtils.tsx +0 -25
  177. package/src/LaunchMsaView/components/tabUtil.ts +0 -6
  178. package/src/OpenInNewIcon.tsx +0 -14
  179. /package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/util.d.ts → util.d.ts} +0 -0
  180. /package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/util.js → util.js} +0 -0
  181. /package/src/LaunchMsaView/components/{NewNCBIBlastQuery/util.ts → util.ts} +0 -0
@@ -1,4 +0,0 @@
1
- export declare function a11yProps(index: number): {
2
- id: string;
3
- 'aria-controls': string;
4
- };
@@ -1,7 +0,0 @@
1
- export function a11yProps(index) {
2
- return {
3
- id: `gtab-${index}`,
4
- 'aria-controls': `gtabpanel-${index}`,
5
- };
6
- }
7
- //# sourceMappingURL=tabUtil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tabUtil.js","sourceRoot":"","sources":["../../../src/LaunchMsaView/components/tabUtil.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO;QACL,EAAE,EAAE,QAAQ,KAAK,EAAE;QACnB,eAAe,EAAE,aAAa,KAAK,EAAE;KACtC,CAAA;AACH,CAAC"}
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { SvgIconProps } from '@mui/material';
3
- export default function OpenInNewIcon(props: SvgIconProps): React.JSX.Element;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { SvgIcon } from '@mui/material';
3
- export default function OpenInNewIcon(props) {
4
- return (React.createElement(SvgIcon, { ...props },
5
- React.createElement("path", { d: "M0 0h24v24H0z", fill: "none" }),
6
- React.createElement("path", { d: "M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z" })));
7
- }
8
- //# sourceMappingURL=OpenInNewIcon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OpenInNewIcon.js","sourceRoot":"","sources":["../src/OpenInNewIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAIvC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAmB;IACvD,OAAO,CACL,oBAAC,OAAO,OAAK,KAAK;QAChB,8BAAM,CAAC,EAAC,eAAe,EAAC,IAAI,EAAC,MAAM,GAAG;QACtC,8BAAM,CAAC,EAAC,oIAAoI,GAAG,CACvI,CACX,CAAA;AACH,CAAC"}
@@ -1,171 +0,0 @@
1
- import React, { useState } from 'react'
2
-
3
- import { ErrorMessage } from '@jbrowse/core/ui'
4
- import {
5
- AbstractTrackModel,
6
- Feature,
7
- getContainingView,
8
- } from '@jbrowse/core/util'
9
- import { Button, DialogActions, DialogContent, MenuItem } from '@mui/material'
10
- import { observer } from 'mobx-react'
11
- import { makeStyles } from 'tss-react/mui'
12
-
13
- import { getProteinSequence } from './calculateProteinSequence'
14
- import { ncbiBlastLaunchView } from './ncbiBlastLaunchView'
15
- import { useFeatureSequence } from './useFeatureSequence'
16
- import TextField2 from '../../../TextField2'
17
- import {
18
- getGeneDisplayName,
19
- getId,
20
- getTranscriptDisplayName,
21
- getTranscriptFeatures,
22
- } from '../../util'
23
-
24
- import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
25
-
26
- const useStyles = makeStyles()({
27
- dialogContent: {
28
- width: '80em',
29
- },
30
- textAreaFont: {
31
- fontFamily: 'Courier New',
32
- },
33
- })
34
-
35
- const NcbiBlastPanel = observer(function NcbiBlastPanel2({
36
- handleClose,
37
- feature,
38
- model,
39
- }: {
40
- model: AbstractTrackModel
41
- feature: Feature
42
- handleClose: () => void
43
- }) {
44
- const { classes } = useStyles()
45
- const view = getContainingView(model) as LinearGenomeViewModel
46
- const [blastDatabase, setBlastDatabase] = useState('nr')
47
- const [msaAlgorithm, setMsaAlgorithm] = useState('clustalo')
48
-
49
- const options = getTranscriptFeatures(feature)
50
- const [userSelection, setUserSelection] = useState(getId(options[0]))
51
- const selectedTranscript = options.find(val => getId(val) === userSelection)!
52
- const { sequence, error } = useFeatureSequence({
53
- view,
54
- feature: selectedTranscript,
55
- })
56
- const proteinSequence =
57
- sequence && !('error' in sequence)
58
- ? getProteinSequence({
59
- seq: sequence.seq,
60
- selectedTranscript,
61
- })
62
- : ''
63
-
64
- const blastDatabaseOptions = ['nr', 'nr_cluster_seq']
65
- const msaAlgorithms = ['clustalo', 'muscle', 'kalign', 'mafft']
66
- return (
67
- <DialogContent className={classes.dialogContent}>
68
- {error ? <ErrorMessage error={error} /> : null}
69
- <TextField2
70
- value={blastDatabase}
71
- onChange={event => {
72
- setBlastDatabase(event.target.value)
73
- }}
74
- label="BLAST blastDatabase"
75
- select
76
- >
77
- {blastDatabaseOptions.map(val => (
78
- <MenuItem value={val} key={val}>
79
- {val}
80
- </MenuItem>
81
- ))}
82
- </TextField2>
83
-
84
- <TextField2
85
- value={msaAlgorithm}
86
- onChange={event => {
87
- setMsaAlgorithm(event.target.value)
88
- }}
89
- label="MSA Algorithm"
90
- select
91
- >
92
- {msaAlgorithms.map(val => (
93
- <MenuItem value={val} key={val}>
94
- {val}
95
- </MenuItem>
96
- ))}
97
- </TextField2>
98
-
99
- <TextField2
100
- value={userSelection}
101
- onChange={event => {
102
- setUserSelection(event.target.value)
103
- }}
104
- label="Choose isoform to BLAST"
105
- select
106
- >
107
- {options.map(val => (
108
- <MenuItem value={getId(val)} key={val.id()}>
109
- {getGeneDisplayName(feature)} - {getTranscriptDisplayName(val)}
110
- </MenuItem>
111
- ))}
112
- </TextField2>
113
- <TextField2
114
- variant="outlined"
115
- multiline
116
- minRows={5}
117
- maxRows={10}
118
- fullWidth
119
- value={
120
- proteinSequence
121
- ? `>${getTranscriptDisplayName(selectedTranscript)}\n${proteinSequence}`
122
- : 'Loading...'
123
- }
124
- slotProps={{
125
- input: {
126
- readOnly: true,
127
- classes: {
128
- input: classes.textAreaFont,
129
- },
130
- },
131
- }}
132
- />
133
-
134
- <DialogActions>
135
- <Button
136
- color="primary"
137
- variant="contained"
138
- onClick={() => {
139
- const newView = ncbiBlastLaunchView({
140
- feature: selectedTranscript,
141
- view,
142
- newViewTitle: `NCBI BLAST - ${getGeneDisplayName(feature)} - ${getTranscriptDisplayName(selectedTranscript)} - ${msaAlgorithm}`,
143
- })
144
- newView.setBlastParams({
145
- blastProgram: 'blastp',
146
- blastDatabase,
147
- msaAlgorithm,
148
- selectedTranscript,
149
- proteinSequence,
150
- })
151
- handleClose()
152
- }}
153
- disabled={!proteinSequence}
154
- >
155
- Submit
156
- </Button>
157
- <Button
158
- color="secondary"
159
- variant="contained"
160
- onClick={() => {
161
- handleClose()
162
- }}
163
- >
164
- Cancel
165
- </Button>
166
- </DialogActions>
167
- </DialogContent>
168
- )
169
- })
170
-
171
- export default NcbiBlastPanel
@@ -1,92 +0,0 @@
1
- import {
2
- Feature,
3
- defaultCodonTable,
4
- generateCodonTable,
5
- revcom,
6
- } from '@jbrowse/core/util'
7
-
8
- export interface Feat {
9
- start: number
10
- end: number
11
- type: string
12
- }
13
-
14
- export function stitch(subfeats: Feat[], sequence: string) {
15
- return subfeats.map(sub => sequence.slice(sub.start, sub.end)).join('')
16
- }
17
-
18
- export function calculateProteinSequence({
19
- cds,
20
- sequence,
21
- codonTable,
22
- }: {
23
- cds: Feat[]
24
- sequence: string
25
- codonTable: Record<string, string>
26
- }) {
27
- const str = stitch(cds, sequence)
28
- let protein = ''
29
- for (let i = 0; i < str.length; i += 3) {
30
- // use & symbol for undefined codon, or partial slice
31
- protein += codonTable[str.slice(i, i + 3)] ?? '&'
32
- }
33
- return protein
34
- }
35
-
36
- export function revlist(
37
- list: { start: number; end: number; type: string }[],
38
- seqlen: number,
39
- ) {
40
- return list
41
- .map(sub => ({
42
- ...sub,
43
- start: seqlen - sub.end,
44
- end: seqlen - sub.start,
45
- }))
46
- .sort((a, b) => a.start - b.start)
47
- }
48
-
49
- // filter items if they have the same "ID" or location
50
- function getItemId(feat: Feat) {
51
- return `${feat.start}-${feat.end}`
52
- }
53
-
54
- // filters if successive elements share same start/end
55
- export function dedupe(list: Feat[]) {
56
- return list.filter(
57
- (item, pos, ary) => !pos || getItemId(item) !== getItemId(ary[pos - 1]!),
58
- )
59
- }
60
-
61
- export function getProteinSequence({
62
- selectedTranscript,
63
- seq,
64
- }: {
65
- seq: string
66
- selectedTranscript: Feature
67
- }) {
68
- // @ts-expect-error
69
- const f = selectedTranscript.toJSON() as {
70
- start: number
71
- end: number
72
- strand: number
73
- type: string
74
- subfeatures: { start: number; end: number; type: string }[]
75
- }
76
- const cds = dedupe(
77
- f.subfeatures
78
- .sort((a, b) => a.start - b.start)
79
- .map(sub => ({
80
- ...sub,
81
- start: sub.start - f.start,
82
- end: sub.end - f.start,
83
- }))
84
- .filter(f => f.type === 'CDS'),
85
- )
86
-
87
- return calculateProteinSequence({
88
- cds: f.strand === -1 ? revlist(cds, seq.length) : cds,
89
- sequence: f.strand === -1 ? revcom(seq) : seq,
90
- codonTable: generateCodonTable(defaultCodonTable),
91
- })
92
- }
@@ -1 +0,0 @@
1
- export { default } from './NcbiBlastPanel'
@@ -1,25 +0,0 @@
1
- import React from 'react'
2
-
3
- import { Box } from '@mui/material'
4
-
5
- interface TabPanelProps {
6
- children?: React.ReactNode
7
- index: number
8
- value: number
9
- }
10
-
11
- export default function CustomTabPanel(props: TabPanelProps) {
12
- const { children, value, index, ...other } = props
13
-
14
- return (
15
- <div
16
- role="tabpanel"
17
- hidden={value !== index}
18
- id={`gtabpanel-${index}`}
19
- aria-labelledby={`gtab-${index}`}
20
- {...other}
21
- >
22
- {value === index && <Box sx={{ p: 3 }}>{children}</Box>}
23
- </div>
24
- )
25
- }
@@ -1,6 +0,0 @@
1
- export function a11yProps(index: number) {
2
- return {
3
- id: `gtab-${index}`,
4
- 'aria-controls': `gtabpanel-${index}`,
5
- }
6
- }
@@ -1,14 +0,0 @@
1
- import React from 'react'
2
-
3
- import { SvgIcon } from '@mui/material'
4
-
5
- import type { SvgIconProps } from '@mui/material'
6
-
7
- export default function OpenInNewIcon(props: SvgIconProps) {
8
- return (
9
- <SvgIcon {...props}>
10
- <path d="M0 0h24v24H0z" fill="none" />
11
- <path d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z" />
12
- </SvgIcon>
13
- )
14
- }