@apollo-annotation/jbrowse-plugin-apollo 0.3.6 → 0.3.8

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/index.esm.js +4603 -2045
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/jbrowse-plugin-apollo.cjs.development.js +4611 -2039
  4. package/dist/jbrowse-plugin-apollo.cjs.development.js.map +1 -1
  5. package/dist/jbrowse-plugin-apollo.cjs.production.min.js +1 -1
  6. package/dist/jbrowse-plugin-apollo.cjs.production.min.js.map +1 -1
  7. package/dist/jbrowse-plugin-apollo.umd.development.js +9387 -4016
  8. package/dist/jbrowse-plugin-apollo.umd.development.js.map +1 -1
  9. package/dist/jbrowse-plugin-apollo.umd.production.min.js +1 -1
  10. package/dist/jbrowse-plugin-apollo.umd.production.min.js.map +1 -1
  11. package/package.json +15 -15
  12. package/src/ApolloInternetAccount/model.ts +48 -13
  13. package/src/BackendDrivers/CollaborationServerDriver.ts +23 -2
  14. package/src/ChangeManager.ts +42 -18
  15. package/src/FeatureDetailsWidget/ApolloTranscriptDetailsWidget.tsx +64 -5
  16. package/src/FeatureDetailsWidget/Attributes.tsx +8 -3
  17. package/src/FeatureDetailsWidget/TranscriptSequence.tsx +70 -81
  18. package/src/FeatureDetailsWidget/TranscriptWidgetEditLocation.tsx +946 -190
  19. package/src/FeatureDetailsWidget/TranscriptWidgetSummary.tsx +4 -0
  20. package/src/LinearApolloDisplay/components/LinearApolloDisplay.tsx +61 -73
  21. package/src/LinearApolloDisplay/glyphs/BoxGlyph.ts +55 -211
  22. package/src/LinearApolloDisplay/glyphs/GeneGlyph.ts +562 -108
  23. package/src/LinearApolloDisplay/glyphs/GenericChildGlyph.ts +78 -14
  24. package/src/LinearApolloDisplay/glyphs/Glyph.ts +15 -9
  25. package/src/LinearApolloDisplay/stateModel/base.ts +63 -43
  26. package/src/LinearApolloDisplay/stateModel/layouts.ts +3 -2
  27. package/src/LinearApolloDisplay/stateModel/mouseEvents.ts +79 -292
  28. package/src/LinearApolloDisplay/stateModel/rendering.ts +45 -344
  29. package/src/LinearApolloReferenceSequenceDisplay/components/LinearApolloReferenceSequenceDisplay.tsx +87 -0
  30. package/src/LinearApolloReferenceSequenceDisplay/components/index.ts +1 -0
  31. package/src/LinearApolloReferenceSequenceDisplay/configSchema.ts +7 -0
  32. package/src/LinearApolloReferenceSequenceDisplay/index.ts +3 -0
  33. package/src/LinearApolloReferenceSequenceDisplay/stateModel/base.ts +227 -0
  34. package/src/LinearApolloReferenceSequenceDisplay/stateModel/index.ts +25 -0
  35. package/src/LinearApolloReferenceSequenceDisplay/stateModel/rendering.ts +481 -0
  36. package/src/LinearApolloSixFrameDisplay/components/LinearApolloSixFrameDisplay.tsx +102 -40
  37. package/src/LinearApolloSixFrameDisplay/components/TrackLines.tsx +12 -20
  38. package/src/LinearApolloSixFrameDisplay/glyphs/GeneGlyph.ts +382 -243
  39. package/src/LinearApolloSixFrameDisplay/glyphs/Glyph.ts +12 -8
  40. package/src/LinearApolloSixFrameDisplay/stateModel/base.ts +83 -4
  41. package/src/LinearApolloSixFrameDisplay/stateModel/layouts.ts +23 -11
  42. package/src/LinearApolloSixFrameDisplay/stateModel/mouseEvents.ts +118 -123
  43. package/src/LinearApolloSixFrameDisplay/stateModel/rendering.ts +53 -63
  44. package/src/OntologyManager/index.ts +4 -1
  45. package/src/TabularEditor/HybridGrid/Feature.tsx +20 -14
  46. package/src/TabularEditor/HybridGrid/HybridGrid.tsx +7 -5
  47. package/src/TabularEditor/HybridGrid/featureContextMenuItems.ts +108 -16
  48. package/src/components/AddAssembly.tsx +1 -1
  49. package/src/components/AddAssemblyAliases.tsx +114 -0
  50. package/src/components/AddChildFeature.tsx +7 -7
  51. package/src/components/AddFeature.tsx +20 -15
  52. package/src/components/AddRefSeqAliases.tsx +9 -9
  53. package/src/components/CopyFeature.tsx +4 -4
  54. package/src/components/CreateApolloAnnotation.tsx +335 -151
  55. package/src/components/DeleteAssembly.tsx +1 -1
  56. package/src/components/DeleteFeature.tsx +358 -11
  57. package/src/components/DownloadGFF3.tsx +20 -1
  58. package/src/components/EditZoomThresholdDialog.tsx +69 -0
  59. package/src/components/FilterFeatures.tsx +7 -7
  60. package/src/components/FilterTranscripts.tsx +86 -0
  61. package/src/components/ImportFeatures.tsx +1 -1
  62. package/src/components/ManageChecks.tsx +1 -1
  63. package/src/components/MergeExons.tsx +193 -0
  64. package/src/components/MergeTranscripts.tsx +182 -0
  65. package/src/components/OntologyTermMultiSelect.tsx +11 -11
  66. package/src/components/OpenLocalFile.tsx +11 -7
  67. package/src/components/SplitExon.tsx +134 -0
  68. package/src/components/ViewCheckResults.tsx +1 -1
  69. package/src/components/index.ts +4 -0
  70. package/src/config.ts +11 -0
  71. package/src/extensions/annotationFromJBrowseFeature.ts +2 -0
  72. package/src/extensions/annotationFromPileup.ts +99 -89
  73. package/src/index.ts +42 -105
  74. package/src/makeDisplayComponent.tsx +0 -1
  75. package/src/menus/index.ts +1 -0
  76. package/src/{ApolloInternetAccount/addMenuItems.ts → menus/topLevelMenu.ts} +60 -33
  77. package/src/menus/topLevelMenuAdmin.ts +154 -0
  78. package/src/session/session.ts +163 -104
  79. package/src/util/annotationFeatureUtils.ts +59 -0
  80. package/src/util/copyToClipboard.ts +21 -0
  81. package/src/util/displayUtils.ts +149 -0
  82. package/src/util/glyphUtils.ts +201 -0
  83. package/src/util/index.ts +2 -0
  84. package/src/util/mouseEventsUtils.ts +145 -0
@@ -1,12 +1,9 @@
1
1
  /* eslint-disable @typescript-eslint/unbound-method */
2
2
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
3
- /* eslint-disable @typescript-eslint/no-misused-promises */
3
+
4
4
  import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
5
5
  import { AddFeatureChange } from '@apollo-annotation/shared'
6
- import {
7
- type AbstractSessionModel,
8
- type Region,
9
- } from '@jbrowse/core/util/types'
6
+ import { type Region } from '@jbrowse/core/util/types'
10
7
  import InfoIcon from '@mui/icons-material/Info'
11
8
  import {
12
9
  Box,
@@ -96,7 +93,6 @@ export function AddFeature({
96
93
  region,
97
94
  session,
98
95
  }: AddFeatureProps) {
99
- const { notify } = session as unknown as AbstractSessionModel
100
96
  const [end, setEnd] = useState(String(region.end))
101
97
  const [start, setStart] = useState(String(region.start + 1))
102
98
  const [type, setType] = useState<NewFeature>(NewFeature.GENE_AND_SUBFEATURES)
@@ -104,7 +100,7 @@ export function AddFeature({
104
100
  const [strand, setStrand] = useState<1 | -1 | undefined>()
105
101
  const [errorMessage, setErrorMessage] = useState('')
106
102
 
107
- async function onSubmit(event: React.FormEvent<HTMLFormElement>) {
103
+ function onSubmit(event: React.FormEvent<HTMLFormElement>) {
108
104
  event.preventDefault()
109
105
  setErrorMessage('')
110
106
 
@@ -120,7 +116,9 @@ export function AddFeature({
120
116
  }
121
117
 
122
118
  if (!refSeqId) {
123
- setErrorMessage('Invalid refseq id')
119
+ setErrorMessage(
120
+ 'Invalid refseq id. Make sure you have the Apollo annotation track open',
121
+ )
124
122
  return
125
123
  }
126
124
 
@@ -149,8 +147,9 @@ export function AddFeature({
149
147
  children,
150
148
  },
151
149
  })
152
- await changeManager.submit(change)
153
- notify('Feature added successfully', 'success')
150
+ void changeManager.submit(change).then(() => {
151
+ session.apolloSetSelectedFeature(id)
152
+ })
154
153
  handleClose()
155
154
  return
156
155
  }
@@ -167,8 +166,9 @@ export function AddFeature({
167
166
  assembly: region.assemblyName,
168
167
  addedFeature: mRNA,
169
168
  })
170
- await changeManager.submit(change)
171
- notify('Feature added successfully', 'success')
169
+ void changeManager.submit(change).then(() => {
170
+ session.apolloSetSelectedFeature(mRNA._id)
171
+ })
172
172
  handleClose()
173
173
  return
174
174
  }
@@ -191,8 +191,9 @@ export function AddFeature({
191
191
  strand,
192
192
  },
193
193
  })
194
- await changeManager.submit(change)
195
- notify('Feature added successfully', 'success')
194
+ void changeManager.submit(change).then(() => {
195
+ session.apolloSetSelectedFeature(id)
196
+ })
196
197
  handleClose()
197
198
  return
198
199
  }
@@ -231,7 +232,11 @@ export function AddFeature({
231
232
  }
232
233
 
233
234
  let submitDisabled: boolean = Boolean(error) || !(start && end && type)
234
- if (type === NewFeature.CUSTOM && !customType) {
235
+ if (
236
+ (type === NewFeature.CUSTOM && !customType) ||
237
+ (!strand && type === NewFeature.GENE_AND_SUBFEATURES) ||
238
+ (!strand && type === NewFeature.TRANSCRIPT_AND_SUBFEATURES)
239
+ ) {
235
240
  submitDisabled = true
236
241
  }
237
242
 
@@ -10,7 +10,7 @@ import {
10
10
  DialogContent,
11
11
  DialogContentText,
12
12
  FormControl,
13
- Grid2,
13
+ Grid,
14
14
  InputLabel,
15
15
  MenuItem,
16
16
  Select,
@@ -212,8 +212,8 @@ export function AddRefSeqAliases({
212
212
  fullWidth
213
213
  >
214
214
  <DialogContent style={{ display: 'flex', flexDirection: 'column' }}>
215
- <Grid2 container spacing={2}>
216
- <Grid2>
215
+ <Grid container spacing={2}>
216
+ <Grid>
217
217
  <FormControl disabled={enableSubmit && !errorMessage} fullWidth>
218
218
  <InputLabel id="demo-simple-select-label">Assembly</InputLabel>
219
219
  <Select
@@ -225,13 +225,13 @@ export function AddRefSeqAliases({
225
225
  >
226
226
  {assemblies.map((option) => (
227
227
  <MenuItem key={option.name} value={option.name}>
228
- {option.displayName ?? option.name}
228
+ {option.displayName}
229
229
  </MenuItem>
230
230
  ))}
231
231
  </Select>
232
232
  </FormControl>
233
- </Grid2>
234
- <Grid2>
233
+ </Grid>
234
+ <Grid>
235
235
  <InputLabel>Load RefName alias</InputLabel>
236
236
  <input
237
237
  type="file"
@@ -239,8 +239,8 @@ export function AddRefSeqAliases({
239
239
  ref={fileRef}
240
240
  disabled={(enableSubmit && !errorMessage) || !selectedAssembly}
241
241
  />
242
- </Grid2>
243
- </Grid2>
242
+ </Grid>
243
+ </Grid>
244
244
  {selectedAssembly && refNameAliasMap.size > 0 ? (
245
245
  <div style={{ height: 200, width: '100%', marginTop: 20 }}>
246
246
  <InputLabel>
@@ -256,7 +256,7 @@ export function AddRefSeqAliases({
256
256
  }}
257
257
  pageSizeOptions={[5, 10]}
258
258
  onRowSelectionModelChange={(ids) => {
259
- rowSelectionChange(ids as number[])
259
+ rowSelectionChange(ids as unknown as number[])
260
260
  }}
261
261
  processRowUpdate={processRowUpdate}
262
262
  checkboxSelection
@@ -83,7 +83,7 @@ export function CopyFeature({
83
83
  sourceAssemblyId,
84
84
  sourceFeature,
85
85
  }: CopyFeatureProps) {
86
- const { assemblyManager, notify } = session as unknown as AbstractSessionModel
86
+ const { assemblyManager } = session as unknown as AbstractSessionModel
87
87
  const assemblies = assemblyManager.assemblyList
88
88
 
89
89
  const [selectedAssemblyId, setSelectedAssemblyId] = useState<
@@ -203,9 +203,9 @@ export function CopyFeature({
203
203
  copyFeature: true,
204
204
  allIds: featureIds,
205
205
  })
206
- await changeManager.submit(change)
207
-
208
- notify('Feature copied successfully', 'success')
206
+ void changeManager.submit(change).then(() => {
207
+ session.apolloSetSelectedFeature(newFeatureLine._id)
208
+ })
209
209
  handleClose()
210
210
  event.preventDefault()
211
211
  }