@apollo-annotation/jbrowse-plugin-apollo 0.1.18 → 0.1.20

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 (85) hide show
  1. package/dist/index.esm.js +3189 -3575
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/jbrowse-plugin-apollo.cjs.development.js +3185 -3570
  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 +14884 -15905
  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 +33 -33
  12. package/src/ApolloInternetAccount/addMenuItems.ts +18 -0
  13. package/src/ApolloInternetAccount/components/AuthTypeSelector.tsx +1 -0
  14. package/src/ApolloInternetAccount/configSchema.ts +5 -2
  15. package/src/ApolloInternetAccount/model.ts +14 -5
  16. package/src/ApolloRefNameAliasAdapter/ApolloRefNameAliasAdapter.ts +94 -0
  17. package/src/ApolloRefNameAliasAdapter/configSchema.ts +12 -0
  18. package/src/ApolloRefNameAliasAdapter/index.ts +21 -0
  19. package/src/ApolloSequenceAdapter/ApolloSequenceAdapter.ts +1 -0
  20. package/src/ApolloSixFrameRenderer/components/ApolloRendering.tsx +10 -10
  21. package/src/ApolloTextSearchAdapter/ApolloTextSearchAdapter.ts +35 -32
  22. package/src/BackendDrivers/BackendDriver.ts +8 -0
  23. package/src/BackendDrivers/CollaborationServerDriver.ts +49 -1
  24. package/src/BackendDrivers/DesktopFileDriver.ts +14 -1
  25. package/src/BackendDrivers/InMemoryFileDriver.ts +17 -1
  26. package/src/ChangeManager.ts +1 -1
  27. package/src/FeatureDetailsWidget/ApolloFeatureDetailsWidget.tsx +5 -25
  28. package/src/FeatureDetailsWidget/ApolloTranscriptDetailsWidget.tsx +82 -0
  29. package/src/FeatureDetailsWidget/Attributes.tsx +11 -3
  30. package/src/FeatureDetailsWidget/BasicInformation.tsx +38 -30
  31. package/src/FeatureDetailsWidget/Sequence.tsx +7 -7
  32. package/src/FeatureDetailsWidget/TranscriptBasic.tsx +446 -0
  33. package/src/FeatureDetailsWidget/TranscriptSequence.tsx +365 -0
  34. package/src/FeatureDetailsWidget/index.ts +2 -0
  35. package/src/FeatureDetailsWidget/model.ts +77 -9
  36. package/src/LinearApolloDisplay/components/LinearApolloDisplay.tsx +0 -2
  37. package/src/LinearApolloDisplay/glyphs/BoxGlyph.ts +453 -380
  38. package/src/LinearApolloDisplay/glyphs/GeneGlyph.ts +520 -0
  39. package/src/LinearApolloDisplay/glyphs/GenericChildGlyph.ts +138 -134
  40. package/src/LinearApolloDisplay/glyphs/Glyph.ts +38 -370
  41. package/src/LinearApolloDisplay/glyphs/index.ts +1 -2
  42. package/src/LinearApolloDisplay/stateModel/base.ts +3 -6
  43. package/src/LinearApolloDisplay/stateModel/getGlyph.ts +30 -30
  44. package/src/LinearApolloDisplay/stateModel/index.ts +5 -1
  45. package/src/LinearApolloDisplay/stateModel/layouts.ts +32 -24
  46. package/src/LinearApolloDisplay/stateModel/mouseEvents.ts +206 -217
  47. package/src/LinearApolloDisplay/stateModel/rendering.ts +43 -67
  48. package/src/OntologyManager/OntologyStore/fulltext.ts +1 -1
  49. package/src/OntologyManager/OntologyStore/index.ts +2 -1
  50. package/src/OntologyManager/index.ts +6 -2
  51. package/src/OntologyManager/util.ts +2 -2
  52. package/src/SixFrameFeatureDisplay/stateModel.ts +15 -10
  53. package/src/TabularEditor/HybridGrid/ChangeHandling.ts +21 -46
  54. package/src/TabularEditor/HybridGrid/Feature.tsx +31 -82
  55. package/src/TabularEditor/HybridGrid/FeatureAttributes.tsx +3 -2
  56. package/src/TabularEditor/HybridGrid/HybridGrid.tsx +2 -3
  57. package/src/TabularEditor/HybridGrid/NumberCell.tsx +1 -0
  58. package/src/TabularEditor/HybridGrid/featureContextMenuItems.ts +46 -5
  59. package/src/TabularEditor/model.ts +5 -3
  60. package/src/components/AddAssembly.tsx +15 -9
  61. package/src/components/AddChildFeature.tsx +7 -73
  62. package/src/components/AddFeature.tsx +2 -57
  63. package/src/components/AddRefSeqAliases.tsx +285 -0
  64. package/src/components/CopyFeature.tsx +16 -33
  65. package/src/components/DeleteFeature.tsx +4 -6
  66. package/src/components/ImportFeatures.tsx +6 -3
  67. package/src/components/LogOut.tsx +105 -0
  68. package/src/components/ManageChecks.tsx +1 -0
  69. package/src/components/ManageUsers.tsx +21 -1
  70. package/src/components/ModifyFeatureAttribute.tsx +2 -2
  71. package/src/components/OntologyTermAutocomplete.tsx +0 -2
  72. package/src/components/OntologyTermMultiSelect.tsx +1 -0
  73. package/src/components/OpenLocalFile.tsx +6 -5
  74. package/src/components/ViewChangeLog.tsx +1 -0
  75. package/src/components/ViewCheckResults.tsx +1 -0
  76. package/src/components/index.ts +4 -0
  77. package/src/extensions/annotationFromPileup.ts +10 -16
  78. package/src/index.ts +57 -3
  79. package/src/session/ClientDataStore.ts +49 -46
  80. package/src/session/session.ts +186 -114
  81. package/src/util/loadAssemblyIntoClient.ts +4 -210
  82. package/src/FeatureDetailsWidget/RelatedFeature.tsx +0 -97
  83. package/src/LinearApolloDisplay/glyphs/CanonicalGeneGlyph.ts +0 -1204
  84. package/src/LinearApolloDisplay/glyphs/ImplicitExonGeneGlyph.ts +0 -716
  85. package/src/LinearApolloDisplay/stateModel/glyphs.ts +0 -47
@@ -46,7 +46,7 @@ export class ChangeManager {
46
46
  ) as unknown as ApolloSessionModel
47
47
 
48
48
  const job = {
49
- name: `${change.typeName}`,
49
+ name: change.typeName,
50
50
  statusMessage: 'Pre-validating',
51
51
  progressPct: 0,
52
52
  cancelCallback: () => {
@@ -1,17 +1,12 @@
1
- import { BaseInternetAccountModel } from '@jbrowse/core/pluggableElementTypes'
2
1
  import { getSession } from '@jbrowse/core/util'
3
2
  import { observer } from 'mobx-react'
4
- import { getRoot } from 'mobx-state-tree'
5
- import React, { useMemo } from 'react'
3
+ import React from 'react'
6
4
  import { makeStyles } from 'tss-react/mui'
7
5
 
8
- import { ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
9
6
  import { ApolloSessionModel } from '../session'
10
- import { ApolloRootModel } from '../types'
11
7
  import { Attributes } from './Attributes'
12
8
  import { BasicInformation } from './BasicInformation'
13
9
  import { ApolloFeatureDetailsWidget as ApolloFeatureDetails } from './model'
14
- import { RelatedFeatures } from './RelatedFeature'
15
10
  import { Sequence } from './Sequence'
16
11
 
17
12
  const useStyles = makeStyles()((theme) => ({
@@ -27,14 +22,6 @@ export const ApolloFeatureDetailsWidget = observer(
27
22
  const session = getSession(model) as unknown as ApolloSessionModel
28
23
  const currentAssembly = session.apolloDataStore.assemblies.get(assembly)
29
24
  const { classes } = useStyles()
30
- const { internetAccounts } = getRoot<ApolloRootModel>(session)
31
- const internetAccount = useMemo(() => {
32
- return internetAccounts.find(
33
- (ia: BaseInternetAccountModel) => ia.type === 'ApolloInternetAccount',
34
- ) as ApolloInternetAccountModel | undefined
35
- }, [internetAccounts])
36
- const role = internetAccount ? internetAccount.role : 'admin'
37
- const editable = ['admin', 'user'].includes(role ?? '')
38
25
 
39
26
  if (!(feature && currentAssembly)) {
40
27
  return null
@@ -43,11 +30,11 @@ export const ApolloFeatureDetailsWidget = observer(
43
30
  if (!refSeq) {
44
31
  return null
45
32
  }
46
- const { end, start } = feature
47
- const sequence = refSeq.getSequence(start, end)
33
+ const { max, min } = feature
34
+ const sequence = refSeq.getSequence(min, max)
48
35
  if (!sequence) {
49
36
  void session.apolloDataStore.loadRefSeq([
50
- { assemblyName: assembly, refName, start, end },
37
+ { assemblyName: assembly, refName, start: min, end: max },
51
38
  ])
52
39
  }
53
40
 
@@ -63,7 +50,7 @@ export const ApolloFeatureDetailsWidget = observer(
63
50
  feature={feature}
64
51
  session={session}
65
52
  assembly={currentAssembly._id}
66
- editable={editable}
53
+ editable={true}
67
54
  />
68
55
  <hr />
69
56
  <Sequence
@@ -72,13 +59,6 @@ export const ApolloFeatureDetailsWidget = observer(
72
59
  assembly={currentAssembly._id}
73
60
  refName={refName}
74
61
  />
75
- <hr />
76
- <RelatedFeatures
77
- feature={feature}
78
- refName={refName}
79
- session={session}
80
- assembly={currentAssembly._id}
81
- />
82
62
  </div>
83
63
  )
84
64
  },
@@ -0,0 +1,82 @@
1
+ import { AbstractSessionModel, getSession } from '@jbrowse/core/util'
2
+ import { observer } from 'mobx-react'
3
+ import { getRoot } from 'mobx-state-tree'
4
+ import React from 'react'
5
+ import { makeStyles } from 'tss-react/mui'
6
+
7
+ import { ApolloInternetAccountModel } from '../ApolloInternetAccount/model'
8
+ import { ApolloSessionModel } from '../session'
9
+ import { ApolloRootModel } from '../types'
10
+ import { Attributes } from './Attributes'
11
+ import { TranscriptBasicInformation } from './TranscriptBasic'
12
+ import { TranscriptSequence } from './TranscriptSequence'
13
+ import { ApolloTranscriptDetailsWidget as ApolloTranscriptDetailsWidgetState } from './model'
14
+
15
+ const useStyles = makeStyles()((theme) => ({
16
+ root: {
17
+ padding: theme.spacing(2),
18
+ },
19
+ }))
20
+
21
+ export const ApolloTranscriptDetailsWidget = observer(
22
+ function ApolloTranscriptDetails(props: {
23
+ model: ApolloTranscriptDetailsWidgetState
24
+ }) {
25
+ const { classes } = useStyles()
26
+ const { model } = props
27
+ const { assembly, feature, refName } = model
28
+ const session = getSession(model) as unknown as AbstractSessionModel
29
+ const apolloSession = getSession(model) as unknown as ApolloSessionModel
30
+ const currentAssembly =
31
+ apolloSession.apolloDataStore.assemblies.get(assembly)
32
+ const { internetAccounts } = getRoot<ApolloRootModel>(session)
33
+
34
+ const apolloInternetAccount = internetAccounts.find(
35
+ (ia) => ia.type === 'ApolloInternetAccount',
36
+ ) as ApolloInternetAccountModel | undefined
37
+ const role = apolloInternetAccount ? apolloInternetAccount.role : 'admin'
38
+ const editable = ['admin', 'user'].includes(role ?? '')
39
+
40
+ if (!(feature && currentAssembly)) {
41
+ return null
42
+ }
43
+ const refSeq = currentAssembly.getByRefName(refName)
44
+ if (!refSeq) {
45
+ return null
46
+ }
47
+ const { max, min } = feature
48
+
49
+ const sequence = refSeq.getSequence(min, max)
50
+ if (!sequence) {
51
+ void apolloSession.apolloDataStore.loadRefSeq([
52
+ { assemblyName: assembly, refName, start: min, end: max },
53
+ ])
54
+ }
55
+
56
+ return (
57
+ <div className={classes.root}>
58
+ <TranscriptBasicInformation
59
+ feature={feature}
60
+ session={apolloSession}
61
+ assembly={currentAssembly._id || ''}
62
+ refName={refName}
63
+ />
64
+ <hr />
65
+ <Attributes
66
+ feature={feature}
67
+ session={apolloSession}
68
+ assembly={currentAssembly._id || ''}
69
+ editable={editable}
70
+ />
71
+ <hr />
72
+ <TranscriptSequence
73
+ feature={feature}
74
+ session={apolloSession}
75
+ assembly={currentAssembly._id || ''}
76
+ refName={refName}
77
+ />
78
+ </div>
79
+ )
80
+ },
81
+ )
82
+ export default ApolloTranscriptDetailsWidget
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/unbound-method */
2
2
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
3
3
  /* eslint-disable @typescript-eslint/no-misused-promises */
4
- import { AnnotationFeatureI } from '@apollo-annotation/mst'
4
+ import { AnnotationFeature } from '@apollo-annotation/mst'
5
5
  import { FeatureAttributeChange } from '@apollo-annotation/shared'
6
6
  import { AbstractSessionModel } from '@jbrowse/core/util'
7
7
  import DeleteIcon from '@mui/icons-material/Delete'
@@ -91,7 +91,7 @@ export const Attributes = observer(function Attributes({
91
91
  feature,
92
92
  session,
93
93
  }: {
94
- feature: AnnotationFeatureI
94
+ feature: AnnotationFeature
95
95
  session: ApolloSessionModel
96
96
  assembly: string
97
97
  editable: boolean
@@ -242,9 +242,17 @@ export const Attributes = observer(function Attributes({
242
242
 
243
243
  return (
244
244
  <>
245
- <Typography variant="h4">Attributes</Typography>
245
+ <Typography
246
+ style={{ display: 'inline', marginLeft: '15px' }}
247
+ variant="h5"
248
+ >
249
+ Attributes
250
+ </Typography>
246
251
  <Grid container direction="column" spacing={1}>
247
252
  {Object.entries(attributes).map(([key, value]) => {
253
+ if (key === '') {
254
+ return null
255
+ }
248
256
  const EditorComponent =
249
257
  reservedKeys.get(key) ?? CustomAttributeValueEditor
250
258
  return (
@@ -1,5 +1,6 @@
1
+ /* eslint-disable @typescript-eslint/use-unknown-in-catch-callback-variable */
1
2
  /* eslint-disable @typescript-eslint/no-misused-promises */
2
- import { AnnotationFeatureI } from '@apollo-annotation/mst'
3
+ import { AnnotationFeature } from '@apollo-annotation/mst'
3
4
  import {
4
5
  LocationEndChange,
5
6
  LocationStartChange,
@@ -7,15 +8,7 @@ import {
7
8
  TypeChange,
8
9
  } from '@apollo-annotation/shared'
9
10
  import { AbstractSessionModel } from '@jbrowse/core/util'
10
- import {
11
- FormControl,
12
- FormControlLabel,
13
- FormLabel,
14
- Radio,
15
- RadioGroup,
16
- TextField,
17
- Typography,
18
- } from '@mui/material'
11
+ import { TextField, Typography } from '@mui/material'
19
12
  import { observer } from 'mobx-react'
20
13
  import React, { useState } from 'react'
21
14
 
@@ -31,14 +24,14 @@ export const BasicInformation = observer(function BasicInformation({
31
24
  feature,
32
25
  session,
33
26
  }: {
34
- feature: AnnotationFeatureI
27
+ feature: AnnotationFeature
35
28
  session: ApolloSessionModel
36
29
  assembly: string
37
30
  }) {
38
31
  const [errorMessage, setErrorMessage] = useState('')
39
32
  const [typeWarningText, setTypeWarningText] = useState('')
40
33
 
41
- const { _id, assemblyId, end, start, strand, type } = feature
34
+ const { _id, assemblyId, max, min, strand, type } = feature
42
35
 
43
36
  const notifyError = (e: Error) => {
44
37
  ;(session as unknown as AbstractSessionModel).notify(e.message, 'error')
@@ -79,7 +72,7 @@ export const BasicInformation = observer(function BasicInformation({
79
72
  typeName: 'LocationStartChange',
80
73
  changedIds: [_id],
81
74
  featureId: _id,
82
- oldStart: start,
75
+ oldStart: min,
83
76
  newStart,
84
77
  assembly,
85
78
  })
@@ -91,7 +84,7 @@ export const BasicInformation = observer(function BasicInformation({
91
84
  typeName: 'LocationEndChange',
92
85
  changedIds: [_id],
93
86
  featureId: _id,
94
- oldEnd: end,
87
+ oldEnd: max,
95
88
  newEnd,
96
89
  assembly,
97
90
  })
@@ -99,7 +92,7 @@ export const BasicInformation = observer(function BasicInformation({
99
92
  }
100
93
 
101
94
  async function fetchValidTerms(
102
- parentFeature: AnnotationFeatureI | undefined,
95
+ parentFeature: undefined | AnnotationFeature,
103
96
  ontologyStore: OntologyStore,
104
97
  _signal: AbortSignal,
105
98
  ) {
@@ -119,14 +112,14 @@ export const BasicInformation = observer(function BasicInformation({
119
112
 
120
113
  return (
121
114
  <>
122
- <Typography variant="h4">Basic information</Typography>
115
+ <Typography variant="h5">Basic information</Typography>
123
116
  <NumberTextField
124
117
  margin="dense"
125
118
  id="start"
126
119
  label="Start"
127
120
  fullWidth
128
121
  variant="outlined"
129
- value={start + 1}
122
+ value={min + 1}
130
123
  onChangeCommitted={handleStartChange}
131
124
  />
132
125
  <NumberTextField
@@ -135,7 +128,7 @@ export const BasicInformation = observer(function BasicInformation({
135
128
  label="End"
136
129
  fullWidth
137
130
  variant="outlined"
138
- value={end}
131
+ value={max}
139
132
  onChangeCommitted={handleEndChange}
140
133
  />
141
134
  <OntologyTermAutocomplete
@@ -160,18 +153,33 @@ export const BasicInformation = observer(function BasicInformation({
160
153
  }
161
154
  }}
162
155
  />
163
- <FormControl>
164
- <FormLabel>Strand</FormLabel>
165
- <RadioGroup row value={strand ?? ''} onChange={handleStrandChange}>
166
- <FormControlLabel value="1" control={<Radio />} label="Forward (+)" />
167
- <FormControlLabel
168
- value="-1"
169
- control={<Radio />}
170
- label="Reverse (-)"
171
- />
172
- <FormControlLabel value="" control={<Radio />} label="None" />
173
- </RadioGroup>
174
- </FormControl>
156
+ <label>
157
+ <input
158
+ type="radio"
159
+ value="1"
160
+ checked={strand === 1}
161
+ onChange={handleStrandChange}
162
+ />
163
+ Positive Strand (+)
164
+ </label>
165
+ <label>
166
+ <input
167
+ type="radio"
168
+ value="-1"
169
+ checked={strand === -1}
170
+ onChange={handleStrandChange}
171
+ />
172
+ Negative Strand (-)
173
+ </label>
174
+ <label>
175
+ <input
176
+ type="radio"
177
+ value=""
178
+ checked={strand === undefined}
179
+ onChange={handleStrandChange}
180
+ />
181
+ No Strand Information
182
+ </label>
175
183
  {errorMessage ? (
176
184
  <Typography color="error">{errorMessage}</Typography>
177
185
  ) : null}
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
2
- import { AnnotationFeatureI } from '@apollo-annotation/mst'
2
+ import { AnnotationFeature } from '@apollo-annotation/mst'
3
3
  import { splitStringIntoChunks } from '@apollo-annotation/shared'
4
4
  import { Button, Typography } from '@mui/material'
5
5
  import { observer } from 'mobx-react'
@@ -35,7 +35,7 @@ export const Sequence = observer(function Sequence({
35
35
  session,
36
36
  }: {
37
37
  assembly: string
38
- feature: AnnotationFeatureI
38
+ feature: AnnotationFeature
39
39
  refName: string
40
40
  session: ApolloSessionModel
41
41
  }) {
@@ -54,22 +54,22 @@ export const Sequence = observer(function Sequence({
54
54
  if (!refSeq) {
55
55
  return null
56
56
  }
57
- const { end, start } = feature
57
+ const { max, min } = feature
58
58
  let sequence = ''
59
59
  if (showSequence) {
60
- sequence = refSeq.getSequence(start, end)
60
+ sequence = refSeq.getSequence(min, max)
61
61
  if (sequence) {
62
- sequence = formatSequence(sequence, refName, start, end)
62
+ sequence = formatSequence(sequence, refName, min, max)
63
63
  } else {
64
64
  void session.apolloDataStore.loadRefSeq([
65
- { assemblyName: assembly, refName, start, end },
65
+ { assemblyName: assembly, refName, start: min, end: max },
66
66
  ])
67
67
  }
68
68
  }
69
69
 
70
70
  return (
71
71
  <>
72
- <Typography variant="h4">Sequence</Typography>
72
+ <Typography variant="h5">Sequence</Typography>
73
73
  <Button variant="contained" onClick={onButtonClick}>
74
74
  {showSequence ? 'Hide sequence' : 'Show sequence'}
75
75
  </Button>