@apollo-annotation/jbrowse-plugin-apollo 0.1.0 → 0.1.5

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 (61) hide show
  1. package/dist/index.esm.js +3096 -2525
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/jbrowse-plugin-apollo.cjs.development.js +3095 -2524
  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 +2974 -2103
  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 +8 -9
  12. package/src/ApolloInternetAccount/model.ts +9 -9
  13. package/src/ApolloSixFrameRenderer/components/ApolloRendering.tsx +5 -2
  14. package/src/BackendDrivers/BackendDriver.ts +6 -3
  15. package/src/BackendDrivers/CollaborationServerDriver.ts +12 -6
  16. package/src/BackendDrivers/DesktopFileDriver.ts +13 -15
  17. package/src/BackendDrivers/InMemoryFileDriver.ts +9 -3
  18. package/src/ChangeManager.ts +6 -3
  19. package/src/FeatureDetailsWidget/ApolloFeatureDetailsWidget.tsx +86 -0
  20. package/src/FeatureDetailsWidget/Attributes.tsx +374 -0
  21. package/src/FeatureDetailsWidget/BasicInformation.tsx +178 -0
  22. package/src/FeatureDetailsWidget/NumberTextField.tsx +75 -0
  23. package/src/FeatureDetailsWidget/RelatedFeature.tsx +87 -0
  24. package/src/FeatureDetailsWidget/Sequence.tsx +88 -0
  25. package/src/FeatureDetailsWidget/StringTextField.tsx +60 -0
  26. package/src/FeatureDetailsWidget/index.ts +2 -0
  27. package/src/FeatureDetailsWidget/model.ts +67 -0
  28. package/src/LinearApolloDisplay/glyphs/BoxGlyph.ts +5 -2
  29. package/src/LinearApolloDisplay/glyphs/CanonicalGeneGlyph.ts +12 -4
  30. package/src/LinearApolloDisplay/glyphs/GenericChildGlyph.ts +1 -1
  31. package/src/LinearApolloDisplay/glyphs/Glyph.ts +21 -2
  32. package/src/LinearApolloDisplay/glyphs/ImplicitExonGeneGlyph.ts +18 -5
  33. package/src/LinearApolloDisplay/stateModel/base.ts +1 -1
  34. package/src/LinearApolloDisplay/stateModel/getGlyph.ts +1 -1
  35. package/src/LinearApolloDisplay/stateModel/glyphs.ts +1 -1
  36. package/src/LinearApolloDisplay/stateModel/layouts.ts +1 -1
  37. package/src/LinearApolloDisplay/stateModel/mouseEvents.ts +1 -1
  38. package/src/LinearApolloDisplay/stateModel/rendering.ts +35 -3
  39. package/src/OntologyManager/util.ts +33 -0
  40. package/src/SixFrameFeatureDisplay/stateModel.ts +1 -1
  41. package/src/TabularEditor/HybridGrid/ChangeHandling.ts +2 -2
  42. package/src/TabularEditor/HybridGrid/Feature.tsx +3 -3
  43. package/src/TabularEditor/HybridGrid/FeatureAttributes.tsx +1 -1
  44. package/src/TabularEditor/HybridGrid/featureContextMenuItems.ts +1 -1
  45. package/src/components/AddAssembly.tsx +5 -5
  46. package/src/components/AddChildFeature.tsx +13 -29
  47. package/src/components/AddFeature.tsx +1 -1
  48. package/src/components/CopyFeature.tsx +5 -2
  49. package/src/components/DeleteAssembly.tsx +1 -1
  50. package/src/components/DeleteFeature.tsx +2 -2
  51. package/src/components/DownloadGFF3.tsx +2 -2
  52. package/src/components/ImportFeatures.tsx +1 -1
  53. package/src/components/ManageUsers.tsx +1 -1
  54. package/src/components/ModifyFeatureAttribute.tsx +2 -2
  55. package/src/components/ViewChangeLog.tsx +7 -5
  56. package/src/extensions/annotationFromPileup.ts +2 -2
  57. package/src/index.ts +26 -8
  58. package/src/makeDisplayComponent.tsx +1 -2
  59. package/src/session/ClientDataStore.ts +6 -6
  60. package/src/session/session.ts +6 -3
  61. package/src/util/loadAssemblyIntoClient.ts +6 -3
@@ -1,3 +1,4 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
1
2
  import { ConfigurationReference, getConf } from '@jbrowse/core/configuration'
2
3
  import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration/configurationSchema'
3
4
  import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes'
@@ -10,7 +11,6 @@ import {
10
11
  import { getParentRenderProps } from '@jbrowse/core/util/tracks'
11
12
  // import type LinearGenomeViewPlugin from '@jbrowse/plugin-linear-genome-view'
12
13
  import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
13
- import { AnnotationFeatureI } from 'apollo-mst'
14
14
  import { autorun } from 'mobx'
15
15
  import { addDisposer, getRoot, types } from 'mobx-state-tree'
16
16
 
@@ -1,4 +1,4 @@
1
- import { AnnotationFeatureI } from 'apollo-mst'
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
2
 
3
3
  import {
4
4
  BoxGlyph,
@@ -1,4 +1,4 @@
1
- import { AnnotationFeatureI } from 'apollo-mst'
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
2
  import { ObservableMap, observable } from 'mobx'
3
3
  import { types } from 'mobx-state-tree'
4
4
 
@@ -1,7 +1,7 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
1
2
  import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration/configurationSchema'
2
3
  import PluginManager from '@jbrowse/core/PluginManager'
3
4
  import { AbstractSessionModel, doesIntersect2 } from '@jbrowse/core/util'
4
- import { AnnotationFeatureI } from 'apollo-mst'
5
5
  import { autorun, observable } from 'mobx'
6
6
  import { addDisposer, isAlive } from 'mobx-state-tree'
7
7
 
@@ -1,9 +1,9 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
1
2
  import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration/configurationSchema'
2
3
  import PluginManager from '@jbrowse/core/PluginManager'
3
4
  import { MenuItem } from '@jbrowse/core/ui'
4
5
  import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
5
6
  import { Theme } from '@mui/material'
6
- import { AnnotationFeatureI } from 'apollo-mst'
7
7
  import { autorun } from 'mobx'
8
8
  import { Instance, addDisposer } from 'mobx-state-tree'
9
9
  import type { CSSProperties } from 'react'
@@ -9,6 +9,29 @@ import { ApolloSessionModel } from '../../session'
9
9
  import { getGlyph } from './getGlyph'
10
10
  import { layoutsModelFactory } from './layouts'
11
11
 
12
+ export type Frame = 1 | 2 | 3 | -1 | -2 | -3
13
+
14
+ export function getFrame(
15
+ start: number,
16
+ end: number,
17
+ strand: 1 | -1,
18
+ phase: 0 | 1 | 2,
19
+ ): Frame {
20
+ return strand === 1
21
+ ? ((((start + phase) % 3) + 1) as 1 | 2 | 3)
22
+ : ((-1 * ((end - phase) % 3) - 1) as -1 | -2 | -3)
23
+ }
24
+
25
+ export const frameColors: [
26
+ null,
27
+ string,
28
+ string,
29
+ string,
30
+ string,
31
+ string,
32
+ string,
33
+ ] = [null, '#FF8080', '#80FF80', '#8080FF', '#8080FF', '#80FF80', '#FF8080']
34
+
12
35
  export function renderingModelIntermediateFactory(
13
36
  pluginManager: PluginManager,
14
37
  configSchema: AnyConfigurationSchemaType,
@@ -145,13 +168,17 @@ function colorCode(letter: string, theme?: Theme) {
145
168
  )
146
169
  }
147
170
 
148
- function codonColorCode(letter: string) {
171
+ function codonColorCode(letter: string, rowColorCode: string, bpPerPx: number) {
149
172
  const colorMap: Record<string, string> = {
150
173
  M: '#33ee33',
151
174
  '*': '#f44336',
152
175
  }
153
176
 
154
- return colorMap[letter?.toUpperCase()] || 'lightgray'
177
+ if (colorMap[letter?.toUpperCase()] !== undefined) {
178
+ return colorMap[letter?.toUpperCase()]
179
+ }
180
+
181
+ return bpPerPx <= 0.1 ? rowColorCode : 'lightgray'
155
182
  }
156
183
 
157
184
  function reverseCodonSeq(seq: string): string {
@@ -186,6 +213,7 @@ function drawTranslation(
186
213
  seq: string,
187
214
  i: number,
188
215
  reverse: boolean,
216
+ rowColorCode: string,
189
217
  ) {
190
218
  let codonSeq: string = seq.slice(i, i + 3).toUpperCase()
191
219
  if (reverse) {
@@ -197,7 +225,7 @@ function drawTranslation(
197
225
  return
198
226
  }
199
227
  seqTrackctx.beginPath()
200
- seqTrackctx.fillStyle = codonColorCode(codonLetter)
228
+ seqTrackctx.fillStyle = codonColorCode(codonLetter, rowColorCode, bpPerPx)
201
229
  seqTrackctx.rect(trnslStartPx, trnslY, trnslWidthPx, sequenceRowHeight)
202
230
  seqTrackctx.fill()
203
231
  if (bpPerPx <= 0.1) {
@@ -266,6 +294,7 @@ export function sequenceRenderingModelFactory(
266
294
 
267
295
  // Draw translation forward
268
296
  for (let j = 2; j >= 0; j--) {
297
+ const color = frameColors.at(j + 1) ?? '#ffffff'
269
298
  if ((region.start + i) % 3 === j) {
270
299
  drawTranslation(
271
300
  seqTrackctx,
@@ -277,6 +306,7 @@ export function sequenceRenderingModelFactory(
277
306
  seq,
278
307
  i,
279
308
  false,
309
+ color,
280
310
  )
281
311
  }
282
312
  }
@@ -339,6 +369,7 @@ export function sequenceRenderingModelFactory(
339
369
 
340
370
  // Draw translation reverse
341
371
  for (let k = 0; k <= 2; k++) {
372
+ const color = frameColors.at(-(k + 1)) ?? '#ffffff'
342
373
  const rowOffset = self.lgv.bpPerPx <= 1 ? 5 : 3
343
374
  if ((region.start + i) % 3 === k) {
344
375
  drawTranslation(
@@ -351,6 +382,7 @@ export function sequenceRenderingModelFactory(
351
382
  seq,
352
383
  i,
353
384
  true,
385
+ color,
354
386
  )
355
387
  }
356
388
  }
@@ -0,0 +1,33 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
+
3
+ import OntologyStore from './OntologyStore'
4
+ import { isOntologyClass } from '.'
5
+
6
+ export async function fetchValidDescendantTerms(
7
+ parentFeature: AnnotationFeatureI | undefined,
8
+ ontologyStore: OntologyStore,
9
+ _signal: AbortSignal,
10
+ ) {
11
+ if (!parentFeature) {
12
+ return
13
+ }
14
+ // since this is a child of an existing feature, restrict the autocomplete choices to valid
15
+ // parts of that feature
16
+ const parentTypeTerms = await ontologyStore.getTermsWithLabelOrSynonym(
17
+ parentFeature.type,
18
+ { includeSubclasses: false },
19
+ )
20
+ // eslint-disable-next-line unicorn/no-array-callback-reference
21
+ const parentTypeClassTerms = parentTypeTerms.filter(isOntologyClass)
22
+ if (parentTypeTerms.length === 0) {
23
+ return
24
+ }
25
+ const subpartTerms = await ontologyStore.getClassesThat(
26
+ 'part_of',
27
+ parentTypeClassTerms,
28
+ )
29
+ if (subpartTerms.length === 0) {
30
+ return
31
+ }
32
+ return subpartTerms
33
+ }
@@ -1,3 +1,4 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
1
2
  import { ConfigurationReference } from '@jbrowse/core/configuration'
2
3
  import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration/configurationSchema'
3
4
  import PluginManager from '@jbrowse/core/PluginManager'
@@ -13,7 +14,6 @@ import { BaseBlock } from '@jbrowse/core/util/blockTypes'
13
14
  import { getParentRenderProps } from '@jbrowse/core/util/tracks'
14
15
  import type LinearGenomeViewPlugin from '@jbrowse/plugin-linear-genome-view'
15
16
  import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
16
- import { AnnotationFeatureI } from 'apollo-mst'
17
17
  import { autorun } from 'mobx'
18
18
  import { Instance, addDisposer, types } from 'mobx-state-tree'
19
19
 
@@ -1,11 +1,11 @@
1
- import type { AnnotationFeatureI } from 'apollo-mst'
1
+ import type { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
2
  import {
3
3
  DiscontinuousLocationEndChange,
4
4
  DiscontinuousLocationStartChange,
5
5
  LocationEndChange,
6
6
  LocationStartChange,
7
7
  TypeChange,
8
- } from 'apollo-shared'
8
+ } from '@apollo-annotation/apollo-shared'
9
9
 
10
10
  import type { ChangeManager } from '../../ChangeManager'
11
11
 
@@ -1,5 +1,5 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
1
2
  import { AbstractSessionModel } from '@jbrowse/core/util'
2
- import { AnnotationFeatureI } from 'apollo-mst'
3
3
  import { observer } from 'mobx-react'
4
4
  import React from 'react'
5
5
  import { makeStyles } from 'tss-react/mui'
@@ -144,8 +144,8 @@ export const Feature = observer(function Feature({
144
144
  (isSelected
145
145
  ? ` ${selectedFeatureClass}`
146
146
  : isHovered
147
- ? ` ${classes.hoveredFeature}`
148
- : '')
147
+ ? ` ${classes.hoveredFeature}`
148
+ : '')
149
149
  }
150
150
  onClick={(e) => {
151
151
  e.stopPropagation()
@@ -1,4 +1,4 @@
1
- import { AnnotationFeatureI } from 'apollo-mst'
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
2
  import { observer } from 'mobx-react'
3
3
  import { getSnapshot } from 'mobx-state-tree'
4
4
  import React from 'react'
@@ -1,6 +1,6 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
1
2
  import { MenuItem } from '@jbrowse/core/ui'
2
3
  import { AbstractSessionModel } from '@jbrowse/core/util'
3
- import { AnnotationFeatureI } from 'apollo-mst'
4
4
 
5
5
  import { ChangeManager } from '../../ChangeManager'
6
6
  import {
@@ -1,3 +1,8 @@
1
+ import {
2
+ AddAssemblyAndFeaturesFromFileChange,
3
+ AddAssemblyFromExternalChange,
4
+ AddAssemblyFromFileChange,
5
+ } from '@apollo-annotation/apollo-shared'
1
6
  import { readConfObject } from '@jbrowse/core/configuration'
2
7
  import { AbstractSessionModel } from '@jbrowse/core/util'
3
8
  import LinkIcon from '@mui/icons-material/Link'
@@ -22,11 +27,6 @@ import {
22
27
  } from '@mui/material'
23
28
  import InputAdornment from '@mui/material/InputAdornment'
24
29
  import LinearProgress from '@mui/material/LinearProgress'
25
- import {
26
- AddAssemblyAndFeaturesFromFileChange,
27
- AddAssemblyFromExternalChange,
28
- AddAssemblyFromFileChange,
29
- } from 'apollo-shared'
30
30
  import ObjectID from 'bson-objectid'
31
31
  import { getRoot } from 'mobx-state-tree'
32
32
  import React, { useState } from 'react'
@@ -1,3 +1,5 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
+ import { AddFeatureChange } from '@apollo-annotation/apollo-shared'
1
3
  import { AbstractSessionModel } from '@jbrowse/core/util'
2
4
  import {
3
5
  Button,
@@ -11,14 +13,13 @@ import {
11
13
  SelectChangeEvent,
12
14
  TextField,
13
15
  } from '@mui/material'
14
- import { AnnotationFeatureI } from 'apollo-mst'
15
- import { AddFeatureChange } from 'apollo-shared'
16
16
  import ObjectID from 'bson-objectid'
17
17
  import React, { useState } from 'react'
18
18
 
19
19
  import { ChangeManager } from '../ChangeManager'
20
20
  import { isOntologyClass } from '../OntologyManager'
21
21
  import OntologyStore from '../OntologyManager/OntologyStore'
22
+ import { fetchValidDescendantTerms } from '../OntologyManager/util'
22
23
  import { ApolloSessionModel } from '../session'
23
24
  import { Dialog } from './Dialog'
24
25
  import { OntologyTermAutocomplete } from './OntologyTermAutocomplete'
@@ -54,37 +55,23 @@ export function AddChildFeature({
54
55
  const [errorMessage, setErrorMessage] = useState('')
55
56
  const [typeWarningText, setTypeWarningText] = useState('')
56
57
 
57
- async function fetchValidDescendantTerms(
58
+ async function fetchValidTerms(
58
59
  parentFeature: AnnotationFeatureI | undefined,
59
60
  ontologyStore: OntologyStore,
60
61
  _signal: AbortSignal,
61
62
  ) {
62
- if (!parentFeature) {
63
- return
64
- }
65
- // since this is a child of an existing feature, restrict the autocomplete choices to valid
66
- // parts of that feature
67
- const parentTypeTerms = await ontologyStore.getTermsWithLabelOrSynonym(
68
- parentFeature.type,
69
- { includeSubclasses: false },
70
- )
71
- // eslint-disable-next-line unicorn/no-array-callback-reference
72
- const parentTypeClassTerms = parentTypeTerms.filter(isOntologyClass)
73
- if (parentTypeTerms.length === 0) {
74
- return
75
- }
76
- const subpartTerms = await ontologyStore.getClassesThat(
77
- 'part_of',
78
- parentTypeClassTerms,
63
+ const terms = await fetchValidDescendantTerms(
64
+ parentFeature,
65
+ ontologyStore,
66
+ _signal,
79
67
  )
80
- if (subpartTerms.length > 0) {
81
- setTypeWarningText('')
82
- } else {
68
+ if (!terms) {
83
69
  setTypeWarningText(
84
- `Type "${parentFeature.type}" does not have any children in the ontology`,
70
+ `Type "${parentFeature?.type}" does not have any children in the ontology`,
85
71
  )
72
+ return
86
73
  }
87
- return subpartTerms
74
+ return terms
88
75
  }
89
76
 
90
77
  async function onSubmit(event: React.FormEvent<HTMLFormElement>) {
@@ -193,10 +180,7 @@ export function AddChildFeature({
193
180
  style={{ width: 170 }}
194
181
  value={type}
195
182
  filterTerms={isOntologyClass}
196
- fetchValidTerms={fetchValidDescendantTerms.bind(
197
- null,
198
- sourceFeature,
199
- )}
183
+ fetchValidTerms={fetchValidTerms.bind(null, sourceFeature)}
200
184
  renderInput={(params) => (
201
185
  <TextField
202
186
  {...params}
@@ -1,3 +1,4 @@
1
+ import { AddFeatureChange } from '@apollo-annotation/apollo-shared'
1
2
  import { AbstractSessionModel, Region } from '@jbrowse/core/util/types'
2
3
  import {
3
4
  Button,
@@ -11,7 +12,6 @@ import {
11
12
  SelectChangeEvent,
12
13
  TextField,
13
14
  } from '@mui/material'
14
- import { AddFeatureChange } from 'apollo-shared'
15
15
  import ObjectID from 'bson-objectid'
16
16
  import React, { useState } from 'react'
17
17
 
@@ -1,3 +1,8 @@
1
+ import {
2
+ AnnotationFeatureI,
3
+ AnnotationFeatureSnapshot,
4
+ } from '@apollo-annotation/apollo-mst'
5
+ import { AddFeatureChange } from '@apollo-annotation/apollo-shared'
1
6
  import { readConfObject } from '@jbrowse/core/configuration'
2
7
  import { AbstractSessionModel } from '@jbrowse/core/util'
3
8
  import {
@@ -10,8 +15,6 @@ import {
10
15
  SelectChangeEvent,
11
16
  TextField,
12
17
  } from '@mui/material'
13
- import { AnnotationFeatureI, AnnotationFeatureSnapshot } from 'apollo-mst'
14
- import { AddFeatureChange } from 'apollo-shared'
15
18
  import ObjectID from 'bson-objectid'
16
19
  import { IKeyValueMap } from 'mobx'
17
20
  import { getSnapshot } from 'mobx-state-tree'
@@ -1,3 +1,4 @@
1
+ import { DeleteAssemblyChange } from '@apollo-annotation/apollo-shared'
1
2
  import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
2
3
  import {
3
4
  Button,
@@ -11,7 +12,6 @@ import {
11
12
  Select,
12
13
  SelectChangeEvent,
13
14
  } from '@mui/material'
14
- import { DeleteAssemblyChange } from 'apollo-shared'
15
15
  import { getRoot } from 'mobx-state-tree'
16
16
  import React, { useEffect, useState } from 'react'
17
17
 
@@ -1,3 +1,5 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
+ import { DeleteFeatureChange } from '@apollo-annotation/apollo-shared'
1
3
  import { AbstractSessionModel } from '@jbrowse/core/util'
2
4
  import {
3
5
  Button,
@@ -5,8 +7,6 @@ import {
5
7
  DialogContent,
6
8
  DialogContentText,
7
9
  } from '@mui/material'
8
- import { AnnotationFeatureI } from 'apollo-mst'
9
- import { DeleteFeatureChange } from 'apollo-shared'
10
10
  import { getSnapshot } from 'mobx-state-tree'
11
11
  import React, { useState } from 'react'
12
12
 
@@ -1,3 +1,5 @@
1
+ import { ApolloAssembly } from '@apollo-annotation/apollo-mst'
2
+ import { makeGFF3Feature } from '@apollo-annotation/apollo-shared'
1
3
  import gff, { GFF3Item } from '@gmod/gff'
2
4
  import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
3
5
  import { getConf } from '@jbrowse/core/configuration'
@@ -10,8 +12,6 @@ import {
10
12
  Select,
11
13
  SelectChangeEvent,
12
14
  } from '@mui/material'
13
- import { ApolloAssembly } from 'apollo-mst'
14
- import { makeGFF3Feature } from 'apollo-shared'
15
15
  import { saveAs } from 'file-saver'
16
16
  import { IMSTMap, getSnapshot } from 'mobx-state-tree'
17
17
  import React, { useState } from 'react'
@@ -1,3 +1,4 @@
1
+ import { AddFeaturesFromFileChange } from '@apollo-annotation/apollo-shared'
1
2
  import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
2
3
  import { getConf } from '@jbrowse/core/configuration'
3
4
  import {
@@ -12,7 +13,6 @@ import {
12
13
  import Checkbox from '@mui/material/Checkbox'
13
14
  import FormControlLabel from '@mui/material/FormControlLabel'
14
15
  import LinearProgress from '@mui/material/LinearProgress'
15
- import { AddFeaturesFromFileChange } from 'apollo-shared'
16
16
  import React, { useEffect, useState } from 'react'
17
17
 
18
18
  import {
@@ -1,3 +1,4 @@
1
+ import { DeleteUserChange, UserChange } from '@apollo-annotation/apollo-shared'
1
2
  import { AbstractRootModel } from '@jbrowse/core/util'
2
3
  import DeleteIcon from '@mui/icons-material/Delete'
3
4
  import {
@@ -19,7 +20,6 @@ import {
19
20
  GridRowParams,
20
21
  GridToolbar,
21
22
  } from '@mui/x-data-grid'
22
- import { DeleteUserChange, UserChange } from 'apollo-shared'
23
23
  import { getRoot } from 'mobx-state-tree'
24
24
  import React, { useCallback, useEffect, useState } from 'react'
25
25
 
@@ -1,3 +1,5 @@
1
+ import { AnnotationFeatureI } from '@apollo-annotation/apollo-mst'
2
+ import { FeatureAttributeChange } from '@apollo-annotation/apollo-shared'
1
3
  import { AbstractSessionModel } from '@jbrowse/core/util'
2
4
  import DeleteIcon from '@mui/icons-material/Delete'
3
5
  import {
@@ -16,8 +18,6 @@ import {
16
18
  TextField,
17
19
  Typography,
18
20
  } from '@mui/material'
19
- import { AnnotationFeatureI } from 'apollo-mst'
20
- import { FeatureAttributeChange } from 'apollo-shared'
21
21
  import { getRoot, getSnapshot } from 'mobx-state-tree'
22
22
  import React, { useMemo, useState } from 'react'
23
23
  import { makeStyles } from 'tss-react/mui'
@@ -1,3 +1,4 @@
1
+ import { changeRegistry } from '@apollo-annotation/apollo-common'
1
2
  import {
2
3
  Button,
3
4
  DialogActions,
@@ -13,7 +14,6 @@ import {
13
14
  GridRowsProp,
14
15
  GridToolbar,
15
16
  } from '@mui/x-data-grid'
16
- import { changeRegistry } from 'apollo-common'
17
17
  import { getRoot } from 'mobx-state-tree'
18
18
  import React, { useEffect, useState } from 'react'
19
19
  import { makeStyles } from 'tss-react/mui'
@@ -76,9 +76,11 @@ export function ViewChangeLog({ handleClose, session }: ViewChangeLogProps) {
76
76
  headerName: 'Change JSON',
77
77
  width: 600,
78
78
  renderCell: ({ value }) => (
79
- <textarea className={classes.changeTextarea} readOnly>
80
- {JSON.stringify(value)}
81
- </textarea>
79
+ <textarea
80
+ className={classes.changeTextarea}
81
+ value={JSON.stringify(value)}
82
+ readOnly
83
+ />
82
84
  ),
83
85
  valueFormatter: ({ value }) => JSON.stringify(value),
84
86
  },
@@ -88,7 +90,7 @@ export function ViewChangeLog({ handleClose, session }: ViewChangeLogProps) {
88
90
  headerName: 'Time',
89
91
  width: 160,
90
92
  type: 'dateTime',
91
- valueGetter: ({ value }) => value && new Date(value),
93
+ valueGetter: (value) => value && new Date(value),
92
94
  },
93
95
  ]
94
96
 
@@ -1,11 +1,11 @@
1
+ import { AnnotationFeatureSnapshot } from '@apollo-annotation/apollo-mst'
2
+ import { AddFeatureChange } from '@apollo-annotation/apollo-shared'
1
3
  import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
2
4
  import { DisplayType } from '@jbrowse/core/pluggableElementTypes'
3
5
  import PluggableElementBase from '@jbrowse/core/pluggableElementTypes/PluggableElementBase'
4
6
  import { getContainingView, getSession } from '@jbrowse/core/util'
5
7
  import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
6
8
  import AddIcon from '@mui/icons-material/Add'
7
- import { AnnotationFeatureSnapshot } from 'apollo-mst'
8
- import { AddFeatureChange } from 'apollo-shared'
9
9
  import ObjectID from 'bson-objectid'
10
10
 
11
11
  import { ApolloSessionModel } from '../session'
package/src/index.ts CHANGED
@@ -1,3 +1,11 @@
1
+ import { changeRegistry, checkRegistry } from '@apollo-annotation/apollo-common'
2
+ import {
3
+ CDSCheck,
4
+ CoreValidation,
5
+ ParentChildValidation,
6
+ changes,
7
+ validationRegistry,
8
+ } from '@apollo-annotation/apollo-shared'
1
9
  import { ConfigurationSchema } from '@jbrowse/core/configuration'
2
10
  import {
3
11
  DisplayType,
@@ -5,6 +13,7 @@ import {
5
13
  PluggableElementType,
6
14
  TrackType,
7
15
  ViewType,
16
+ WidgetType,
8
17
  createBaseTrackConfig,
9
18
  createBaseTrackModel,
10
19
  } from '@jbrowse/core/pluggableElementTypes'
@@ -18,14 +27,6 @@ import {
18
27
  } from '@jbrowse/core/util'
19
28
  import { LinearGenomeViewStateModel } from '@jbrowse/plugin-linear-genome-view'
20
29
  import AddIcon from '@mui/icons-material/Add'
21
- import { changeRegistry, checkRegistry } from 'apollo-common'
22
- import {
23
- CDSCheck,
24
- CoreValidation,
25
- ParentChildValidation,
26
- changes,
27
- validationRegistry,
28
- } from 'apollo-shared'
29
30
 
30
31
  import { version } from '../package.json'
31
32
  import {
@@ -50,6 +51,10 @@ import { AddFeature } from './components/AddFeature'
50
51
  import { ViewCheckResults } from './components/ViewCheckResults'
51
52
  import ApolloPluginConfigurationSchema from './config'
52
53
  import { annotationFromPileup } from './extensions'
54
+ import {
55
+ ApolloFeatureDetailsWidget,
56
+ ApolloFeatureDetailsWidgetModel,
57
+ } from './FeatureDetailsWidget'
53
58
  import {
54
59
  stateModelFactory as LinearApolloDisplayStateModelFactory,
55
60
  configSchemaFactory as linearApolloDisplayConfigSchemaFactory,
@@ -106,6 +111,19 @@ export default class ApolloPlugin extends Plugin {
106
111
  install(pluginManager: PluginManager) {
107
112
  installApolloSequenceAdapter(pluginManager)
108
113
  installApolloTextSearchAdapter(pluginManager)
114
+
115
+ pluginManager.addWidgetType(() => {
116
+ const configSchema = ConfigurationSchema('ApolloFeatureDetailsWidget', {})
117
+ const widgetType = new WidgetType({
118
+ name: 'ApolloFeatureDetailsWidget',
119
+ heading: 'Apollo feature details',
120
+ configSchema,
121
+ stateModel: ApolloFeatureDetailsWidgetModel,
122
+ ReactComponent: ApolloFeatureDetailsWidget,
123
+ })
124
+ return widgetType
125
+ })
126
+
109
127
  pluginManager.addTrackType(() => {
110
128
  const configSchema = ConfigurationSchema(
111
129
  'ApolloTrack',
@@ -2,8 +2,7 @@ import PluginManager from '@jbrowse/core/PluginManager'
2
2
  import type LinearGenomeViewPlugin from '@jbrowse/plugin-linear-genome-view'
3
3
  import ExpandLessIcon from '@mui/icons-material/ExpandLess'
4
4
  import ExpandMoreIcon from '@mui/icons-material/ExpandMore'
5
- import { Typography } from '@mui/material'
6
- import { alpha } from '@mui/material/styles'
5
+ import { Typography, alpha } from '@mui/material'
7
6
  import { observer } from 'mobx-react'
8
7
  import React, { useCallback, useEffect, useRef } from 'react'
9
8
  import { makeStyles } from 'tss-react/mui'
@@ -1,8 +1,4 @@
1
- import { getConf, readConfObject } from '@jbrowse/core/configuration'
2
- import { ConfigurationModel } from '@jbrowse/core/configuration/types'
3
- import { Region, getSession, isElectron } from '@jbrowse/core/util'
4
- import { LocalPathLocation, UriLocation } from '@jbrowse/core/util/types/mst'
5
- import { ClientDataStore as ClientDataStoreType } from 'apollo-common'
1
+ import { ClientDataStore as ClientDataStoreType } from '@apollo-annotation/apollo-common'
6
2
  import {
7
3
  AnnotationFeature,
8
4
  AnnotationFeatureSnapshot,
@@ -10,7 +6,11 @@ import {
10
6
  ApolloRefSeq,
11
7
  CheckResult,
12
8
  CheckResultSnapshot,
13
- } from 'apollo-mst'
9
+ } from '@apollo-annotation/apollo-mst'
10
+ import { getConf, readConfObject } from '@jbrowse/core/configuration'
11
+ import { ConfigurationModel } from '@jbrowse/core/configuration/types'
12
+ import { Region, getSession, isElectron } from '@jbrowse/core/util'
13
+ import { LocalPathLocation, UriLocation } from '@jbrowse/core/util/types/mst'
14
14
  import {
15
15
  Instance,
16
16
  SnapshotOut,
@@ -1,3 +1,9 @@
1
+ import { ClientDataStore as ClientDataStoreType } from '@apollo-annotation/apollo-common'
2
+ import {
3
+ AnnotationFeature,
4
+ AnnotationFeatureI,
5
+ } from '@apollo-annotation/apollo-mst'
6
+ import { UserLocation } from '@apollo-annotation/apollo-shared'
1
7
  import { AssemblyModel } from '@jbrowse/core/assemblyManager/assembly'
2
8
  import { getConf } from '@jbrowse/core/configuration'
3
9
  import { BaseInternetAccountModel } from '@jbrowse/core/pluggableElementTypes'
@@ -7,9 +13,6 @@ import {
7
13
  SessionWithConfigEditing,
8
14
  } from '@jbrowse/core/util'
9
15
  import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
10
- import { ClientDataStore as ClientDataStoreType } from 'apollo-common'
11
- import { AnnotationFeature, AnnotationFeatureI } from 'apollo-mst'
12
- import { UserLocation } from 'apollo-shared'
13
16
  import { autorun, observable } from 'mobx'
14
17
  import { Instance, flow, getRoot, types } from 'mobx-state-tree'
15
18
 
@@ -1,10 +1,13 @@
1
- import gff, { GFF3Comment, GFF3Feature, GFF3Sequence } from '@gmod/gff'
2
- import { ClientDataStore, checkRegistry } from 'apollo-common'
1
+ import {
2
+ ClientDataStore,
3
+ checkRegistry,
4
+ } from '@apollo-annotation/apollo-common'
3
5
  import {
4
6
  AnnotationFeatureSnapshot,
5
7
  ApolloAssemblyI,
6
8
  CheckResultSnapshot,
7
- } from 'apollo-mst'
9
+ } from '@apollo-annotation/apollo-mst'
10
+ import gff, { GFF3Comment, GFF3Feature, GFF3Sequence } from '@gmod/gff'
8
11
  import { getSnapshot } from 'mobx-state-tree'
9
12
  import { nanoid } from 'nanoid'
10
13