@apollo-annotation/jbrowse-plugin-apollo 0.3.5 → 0.3.7
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.
- package/dist/index.esm.js +6964 -4598
- package/dist/index.esm.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.development.js +6610 -4261
- package/dist/jbrowse-plugin-apollo.cjs.development.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.production.min.js +1 -1
- package/dist/jbrowse-plugin-apollo.cjs.production.min.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.umd.development.js +11563 -7493
- package/dist/jbrowse-plugin-apollo.umd.development.js.map +1 -1
- package/dist/jbrowse-plugin-apollo.umd.production.min.js +1 -1
- package/dist/jbrowse-plugin-apollo.umd.production.min.js.map +1 -1
- package/package.json +4 -4
- package/src/ApolloInternetAccount/addMenuItems.ts +23 -2
- package/src/ApolloInternetAccount/components/AuthTypeSelector.tsx +1 -0
- package/src/ApolloInternetAccount/components/LoginButtons.tsx +1 -1
- package/src/ApolloInternetAccount/components/LoginIcons.tsx +1 -1
- package/src/ApolloInternetAccount/configSchema.ts +1 -1
- package/src/ApolloInternetAccount/model.ts +11 -10
- package/src/ApolloJobModel.ts +1 -1
- package/src/ApolloRefNameAliasAdapter/ApolloRefNameAliasAdapter.ts +8 -6
- package/src/ApolloRefNameAliasAdapter/index.ts +2 -2
- package/src/ApolloSequenceAdapter/ApolloSequenceAdapter.ts +4 -4
- package/src/ApolloSequenceAdapter/index.ts +1 -1
- package/src/ApolloTextSearchAdapter/ApolloTextSearchAdapter.ts +8 -7
- package/src/ApolloTextSearchAdapter/index.ts +1 -1
- package/src/BackendDrivers/BackendDriver.ts +7 -7
- package/src/BackendDrivers/CollaborationServerDriver.ts +14 -10
- package/src/BackendDrivers/DesktopFileDriver.ts +11 -10
- package/src/BackendDrivers/InMemoryFileDriver.ts +10 -6
- package/src/ChangeManager.ts +15 -11
- package/src/FeatureDetailsWidget/ApolloFeatureDetailsWidget.tsx +8 -7
- package/src/FeatureDetailsWidget/ApolloTranscriptDetailsWidget.tsx +35 -14
- package/src/FeatureDetailsWidget/AttributeKey.tsx +50 -0
- package/src/FeatureDetailsWidget/AttributeKeySelector.tsx +104 -0
- package/src/FeatureDetailsWidget/Attributes.tsx +215 -367
- package/src/FeatureDetailsWidget/BasicInformation.tsx +6 -5
- package/src/FeatureDetailsWidget/DefaultAttributeEditor.tsx +104 -0
- package/src/FeatureDetailsWidget/DefaultAttributeViewer.tsx +22 -0
- package/src/FeatureDetailsWidget/FeatureDetailsNavigation.tsx +4 -4
- package/src/FeatureDetailsWidget/NumberTextField.tsx +1 -1
- package/src/FeatureDetailsWidget/Sequence.tsx +2 -2
- package/src/FeatureDetailsWidget/StringTextField.tsx +1 -1
- package/src/FeatureDetailsWidget/TranscriptSequence.tsx +15 -23
- package/src/FeatureDetailsWidget/TranscriptWidgetEditLocation.tsx +950 -196
- package/src/FeatureDetailsWidget/TranscriptWidgetSummary.tsx +8 -4
- package/src/FeatureDetailsWidget/model.ts +8 -3
- package/src/LinearApolloDisplay/components/LinearApolloDisplay.tsx +7 -7
- package/src/LinearApolloDisplay/glyphs/BoxGlyph.ts +59 -72
- package/src/LinearApolloDisplay/glyphs/GeneGlyph.ts +253 -60
- package/src/LinearApolloDisplay/glyphs/GenericChildGlyph.ts +52 -6
- package/src/LinearApolloDisplay/glyphs/Glyph.ts +16 -8
- package/src/LinearApolloDisplay/stateModel/base.ts +81 -10
- package/src/LinearApolloDisplay/stateModel/index.ts +4 -3
- package/src/LinearApolloDisplay/stateModel/layouts.ts +8 -39
- package/src/LinearApolloDisplay/stateModel/mouseEvents.ts +63 -46
- package/src/LinearApolloDisplay/stateModel/rendering.ts +60 -31
- package/src/LinearApolloSixFrameDisplay/components/LinearApolloSixFrameDisplay.tsx +226 -0
- package/src/LinearApolloSixFrameDisplay/components/TrackLines.tsx +32 -0
- package/src/LinearApolloSixFrameDisplay/components/index.ts +2 -0
- package/src/LinearApolloSixFrameDisplay/configSchema.ts +7 -0
- package/src/LinearApolloSixFrameDisplay/glyphs/GeneGlyph.ts +940 -0
- package/src/LinearApolloSixFrameDisplay/glyphs/Glyph.ts +63 -0
- package/src/LinearApolloSixFrameDisplay/glyphs/index.ts +1 -0
- package/src/LinearApolloSixFrameDisplay/index.ts +2 -0
- package/src/LinearApolloSixFrameDisplay/stateModel/base.ts +302 -0
- package/src/LinearApolloSixFrameDisplay/stateModel/index.ts +27 -0
- package/src/LinearApolloSixFrameDisplay/stateModel/layouts.ts +252 -0
- package/src/LinearApolloSixFrameDisplay/stateModel/mouseEvents.ts +368 -0
- package/src/LinearApolloSixFrameDisplay/stateModel/rendering.ts +201 -0
- package/src/LinearApolloSixFrameDisplay/types.ts +1 -0
- package/src/OntologyManager/OntologyStore/fulltext.test.ts +1 -1
- package/src/OntologyManager/OntologyStore/fulltext.ts +8 -3
- package/src/OntologyManager/OntologyStore/index.test.ts +3 -1
- package/src/OntologyManager/OntologyStore/index.ts +19 -14
- package/src/OntologyManager/OntologyStore/indexeddb-schema.ts +6 -5
- package/src/OntologyManager/OntologyStore/indexeddb-storage.ts +11 -5
- package/src/OntologyManager/index.ts +12 -7
- package/src/OntologyManager/util.ts +3 -2
- package/src/TabularEditor/HybridGrid/ChangeHandling.ts +2 -2
- package/src/TabularEditor/HybridGrid/Feature.tsx +13 -7
- package/src/TabularEditor/HybridGrid/FeatureAttributes.tsx +1 -1
- package/src/TabularEditor/HybridGrid/HybridGrid.tsx +3 -2
- package/src/TabularEditor/HybridGrid/ToolBar.tsx +1 -1
- package/src/TabularEditor/HybridGrid/featureContextMenuItems.ts +114 -22
- package/src/TabularEditor/TabularEditorPane.tsx +1 -1
- package/src/TabularEditor/model.ts +2 -2
- package/src/TabularEditor/types.ts +5 -2
- package/src/components/AddAssembly.tsx +182 -179
- package/src/components/AddAssemblyAliases.tsx +114 -0
- package/src/components/AddChildFeature.tsx +8 -10
- package/src/components/AddFeature.tsx +216 -44
- package/src/components/AddRefSeqAliases.tsx +14 -12
- package/src/components/CopyFeature.tsx +10 -11
- package/src/components/CreateApolloAnnotation.tsx +342 -158
- package/src/components/DeleteAssembly.tsx +9 -8
- package/src/components/DeleteFeature.tsx +362 -14
- package/src/components/Dialog.tsx +1 -1
- package/src/components/DownloadGFF3.tsx +31 -11
- package/src/components/FilterFeatures.tsx +6 -4
- package/src/components/FilterTranscripts.tsx +86 -0
- package/src/components/ImportFeatures.tsx +7 -6
- package/src/components/LogOut.tsx +5 -4
- package/src/components/ManageChecks.tsx +9 -8
- package/src/components/ManageUsers.tsx +11 -10
- package/src/components/MergeExons.tsx +193 -0
- package/src/components/MergeTranscripts.tsx +185 -0
- package/src/components/OntologyTermAutocomplete.tsx +5 -5
- package/src/components/OntologyTermMultiSelect.tsx +6 -6
- package/src/components/OpenLocalFile.tsx +4 -3
- package/src/components/SplitExon.tsx +134 -0
- package/src/components/ViewChangeLog.tsx +7 -6
- package/src/components/ViewCheckResults.tsx +8 -7
- package/src/components/index.ts +3 -0
- package/src/config.ts +5 -0
- package/src/extensions/annotationFromJBrowseFeature.test.ts +1 -0
- package/src/extensions/annotationFromJBrowseFeature.ts +13 -10
- package/src/extensions/annotationFromPileup.ts +104 -94
- package/src/index.ts +33 -50
- package/src/makeDisplayComponent.tsx +90 -37
- package/src/session/ClientDataStore.ts +21 -17
- package/src/session/session.ts +46 -39
- package/src/types.ts +4 -4
- package/src/util/annotationFeatureUtils.ts +66 -1
- package/src/util/copyToClipboard.ts +21 -0
- package/src/util/glyphUtils.ts +49 -0
- package/src/util/index.ts +5 -3
- package/src/util/loadAssemblyIntoClient.ts +10 -3
- package/src/util/mouseEventsUtils.ts +113 -0
- package/src/ApolloSixFrameRenderer/ApolloSixFrameRenderer.tsx +0 -13
- package/src/ApolloSixFrameRenderer/components/ApolloRendering.tsx +0 -707
- package/src/ApolloSixFrameRenderer/configSchema.ts +0 -7
- package/src/ApolloSixFrameRenderer/index.ts +0 -3
- package/src/SixFrameFeatureDisplay/components/TrackLines.tsx +0 -19
- package/src/SixFrameFeatureDisplay/components/index.ts +0 -1
- package/src/SixFrameFeatureDisplay/configSchema.ts +0 -21
- package/src/SixFrameFeatureDisplay/index.ts +0 -2
- package/src/SixFrameFeatureDisplay/stateModel.ts +0 -443
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import AddBoxIcon from '@mui/icons-material/AddBox'
|
|
2
|
+
import DeleteIcon from '@mui/icons-material/Delete'
|
|
3
|
+
import { Button, DialogActions, IconButton } from '@mui/material'
|
|
4
|
+
import { observer } from 'mobx-react'
|
|
5
|
+
import React, { useState } from 'react'
|
|
6
|
+
|
|
7
|
+
import { type ApolloSessionModel } from '../session'
|
|
8
|
+
|
|
9
|
+
import { StringTextField } from './StringTextField'
|
|
10
|
+
|
|
11
|
+
export interface AttributeEditorProps {
|
|
12
|
+
session: ApolloSessionModel
|
|
13
|
+
attributeValues?: string[]
|
|
14
|
+
setAttribute: (newAttribute?: string[]) => void
|
|
15
|
+
isNew?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const DefaultAttributeEditor = observer(function DefaultAttributeEditor({
|
|
19
|
+
attributeValues,
|
|
20
|
+
setAttribute,
|
|
21
|
+
isNew = false,
|
|
22
|
+
}: AttributeEditorProps) {
|
|
23
|
+
const [newValues, setNewValues] = useState<string[]>(
|
|
24
|
+
attributeValues && attributeValues.length > 0 ? attributeValues : [''],
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
function updateValue(idx: number, newValue: string) {
|
|
28
|
+
setNewValues((oldValues) => {
|
|
29
|
+
const newValues = [...oldValues]
|
|
30
|
+
newValues[idx] = newValue
|
|
31
|
+
return newValues
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
function deleteValue(idx: number) {
|
|
35
|
+
setNewValues((oldValues) => {
|
|
36
|
+
const newValues = [...oldValues]
|
|
37
|
+
newValues.splice(idx, 1)
|
|
38
|
+
return newValues
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
function addValue() {
|
|
42
|
+
setNewValues((oldValues) => {
|
|
43
|
+
const newValues = [...oldValues]
|
|
44
|
+
newValues.push('')
|
|
45
|
+
return newValues
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
{newValues.map((value, idx) => (
|
|
52
|
+
<div key={`${idx}-${value}`} style={{ display: 'flex' }}>
|
|
53
|
+
<StringTextField
|
|
54
|
+
value={value}
|
|
55
|
+
onChangeCommitted={(editedValue) => {
|
|
56
|
+
updateValue(idx, editedValue)
|
|
57
|
+
}}
|
|
58
|
+
variant="outlined"
|
|
59
|
+
fullWidth
|
|
60
|
+
/>
|
|
61
|
+
<IconButton
|
|
62
|
+
aria-label="delete"
|
|
63
|
+
size="medium"
|
|
64
|
+
edge="end"
|
|
65
|
+
onClick={() => {
|
|
66
|
+
deleteValue(idx)
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<DeleteIcon fontSize="inherit" />
|
|
70
|
+
</IconButton>
|
|
71
|
+
</div>
|
|
72
|
+
))}
|
|
73
|
+
<IconButton
|
|
74
|
+
aria-label="add"
|
|
75
|
+
size="medium"
|
|
76
|
+
color="secondary"
|
|
77
|
+
edge="start"
|
|
78
|
+
onClick={addValue}
|
|
79
|
+
>
|
|
80
|
+
<AddBoxIcon fontSize="inherit" />
|
|
81
|
+
</IconButton>
|
|
82
|
+
<DialogActions>
|
|
83
|
+
<Button
|
|
84
|
+
color="primary"
|
|
85
|
+
variant="contained"
|
|
86
|
+
onClick={() => {
|
|
87
|
+
setAttribute(newValues.filter(Boolean))
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{isNew ? 'Add' : 'Update'}
|
|
91
|
+
</Button>
|
|
92
|
+
<Button
|
|
93
|
+
variant="outlined"
|
|
94
|
+
type="submit"
|
|
95
|
+
onClick={() => {
|
|
96
|
+
setAttribute()
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
Cancel
|
|
100
|
+
</Button>
|
|
101
|
+
</DialogActions>
|
|
102
|
+
</>
|
|
103
|
+
)
|
|
104
|
+
})
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Typography } from '@mui/material'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
export interface AttributeViewerProps {
|
|
5
|
+
values: string[] | undefined
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function DefaultAttributeViewer({ values }: AttributeViewerProps) {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
{values?.map((value, idx) => (
|
|
12
|
+
<Typography
|
|
13
|
+
key={`${idx}.${value}`}
|
|
14
|
+
variant="body2"
|
|
15
|
+
color="textSecondary"
|
|
16
|
+
>
|
|
17
|
+
{value}
|
|
18
|
+
</Typography>
|
|
19
|
+
))}
|
|
20
|
+
</>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { type AnnotationFeature } from '@apollo-annotation/mst'
|
|
3
2
|
import { Button, Typography } from '@mui/material'
|
|
4
3
|
import { observer } from 'mobx-react'
|
|
4
|
+
import React from 'react'
|
|
5
5
|
|
|
6
|
-
import { AnnotationFeature } from '@apollo-annotation/mst'
|
|
7
|
-
import { ApolloFeatureDetailsWidget as ApolloFeatureDetails } from './model'
|
|
8
6
|
import { getFeatureNameOrId } from '../util'
|
|
9
7
|
|
|
8
|
+
import { type ApolloFeatureDetailsWidget as ApolloFeatureDetails } from './model'
|
|
9
|
+
|
|
10
10
|
export const FeatureDetailsNavigation = observer(
|
|
11
11
|
function FeatureDetailsNavigation(props: {
|
|
12
12
|
model: ApolloFeatureDetails
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
3
|
-
import { TextField, TextFieldProps } from '@mui/material'
|
|
3
|
+
import { TextField, type TextFieldProps } from '@mui/material'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
import React, { useEffect, useState } from 'react'
|
|
6
6
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
|
2
|
-
import { AnnotationFeature } from '@apollo-annotation/mst'
|
|
2
|
+
import { type AnnotationFeature } from '@apollo-annotation/mst'
|
|
3
3
|
import { splitStringIntoChunks } from '@apollo-annotation/shared'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
import React from 'react'
|
|
6
6
|
import { makeStyles } from 'tss-react/mui'
|
|
7
7
|
|
|
8
|
-
import { ApolloSessionModel } from '../session'
|
|
8
|
+
import { type ApolloSessionModel } from '../session'
|
|
9
9
|
|
|
10
10
|
function formatSequence(
|
|
11
11
|
seq: string,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/unbound-method */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
3
|
-
import { TextField, TextFieldProps } from '@mui/material'
|
|
3
|
+
import { TextField, type TextFieldProps } from '@mui/material'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
import React, { useEffect, useState } from 'react'
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnnotationFeature } from '@apollo-annotation/mst'
|
|
1
|
+
import { type AnnotationFeature } from '@apollo-annotation/mst'
|
|
2
2
|
import { splitStringIntoChunks } from '@apollo-annotation/shared'
|
|
3
3
|
import { defaultCodonTable, revcom } from '@jbrowse/core/util'
|
|
4
4
|
import {
|
|
@@ -6,13 +6,14 @@ import {
|
|
|
6
6
|
MenuItem,
|
|
7
7
|
Paper,
|
|
8
8
|
Select,
|
|
9
|
-
SelectChangeEvent,
|
|
9
|
+
type SelectChangeEvent,
|
|
10
10
|
useTheme,
|
|
11
11
|
} from '@mui/material'
|
|
12
12
|
import { observer } from 'mobx-react'
|
|
13
13
|
import React, { useEffect, useRef, useState } from 'react'
|
|
14
14
|
|
|
15
|
-
import { ApolloSessionModel } from '../session'
|
|
15
|
+
import { type ApolloSessionModel } from '../session'
|
|
16
|
+
import { copyToClipboard } from '../util/copyToClipboard'
|
|
16
17
|
|
|
17
18
|
const SEQUENCE_WRAP_LENGTH = 60
|
|
18
19
|
|
|
@@ -112,13 +113,12 @@ function getSequenceSegments(
|
|
|
112
113
|
const [firstLocation] = cdsLocations
|
|
113
114
|
const locs: { min: number; max: number }[] = []
|
|
114
115
|
for (const loc of firstLocation) {
|
|
115
|
-
|
|
116
|
-
if (strand === -1) {
|
|
117
|
-
sequence = revcom(sequence)
|
|
118
|
-
}
|
|
119
|
-
wholeSequence += sequence
|
|
116
|
+
wholeSequence += getSequence(loc.min, loc.max)
|
|
120
117
|
locs.push({ min: loc.min, max: loc.max })
|
|
121
118
|
}
|
|
119
|
+
if (strand === -1) {
|
|
120
|
+
wholeSequence = revcom(wholeSequence)
|
|
121
|
+
}
|
|
122
122
|
const sequenceLines = splitStringIntoChunks(
|
|
123
123
|
wholeSequence,
|
|
124
124
|
SEQUENCE_WRAP_LENGTH,
|
|
@@ -131,13 +131,12 @@ function getSequenceSegments(
|
|
|
131
131
|
const [firstLocation] = cdsLocations
|
|
132
132
|
const locs: { min: number; max: number }[] = []
|
|
133
133
|
for (const loc of firstLocation) {
|
|
134
|
-
|
|
135
|
-
if (strand === -1) {
|
|
136
|
-
sequence = revcom(sequence)
|
|
137
|
-
}
|
|
138
|
-
wholeSequence += sequence
|
|
134
|
+
wholeSequence += getSequence(loc.min, loc.max)
|
|
139
135
|
locs.push({ min: loc.min, max: loc.max })
|
|
140
136
|
}
|
|
137
|
+
if (strand === -1) {
|
|
138
|
+
wholeSequence = revcom(wholeSequence)
|
|
139
|
+
}
|
|
141
140
|
let protein = ''
|
|
142
141
|
for (let i = 0; i < wholeSequence.length; i += 3) {
|
|
143
142
|
const codonSeq: string = wholeSequence.slice(i, i + 3).toUpperCase()
|
|
@@ -275,19 +274,12 @@ export const TranscriptSequence = observer(function TranscriptSequence({
|
|
|
275
274
|
setLocationIntervals(locIntervals)
|
|
276
275
|
}
|
|
277
276
|
|
|
278
|
-
|
|
279
|
-
const copyToClipboard = () => {
|
|
277
|
+
const onCopyClick = () => {
|
|
280
278
|
const seqDiv = seqRef.current
|
|
281
279
|
if (!seqDiv) {
|
|
282
280
|
return
|
|
283
281
|
}
|
|
284
|
-
|
|
285
|
-
const htmlBlob = new Blob([seqDiv.outerHTML], { type: 'text/html' })
|
|
286
|
-
const clipboardItem = new ClipboardItem({
|
|
287
|
-
[textBlob.type]: textBlob,
|
|
288
|
-
[htmlBlob.type]: htmlBlob,
|
|
289
|
-
})
|
|
290
|
-
void navigator.clipboard.write([clipboardItem])
|
|
282
|
+
void copyToClipboard(seqDiv)
|
|
291
283
|
}
|
|
292
284
|
|
|
293
285
|
return (
|
|
@@ -306,7 +298,7 @@ export const TranscriptSequence = observer(function TranscriptSequence({
|
|
|
306
298
|
</Select>
|
|
307
299
|
<Button
|
|
308
300
|
variant="contained"
|
|
309
|
-
onClick={
|
|
301
|
+
onClick={onCopyClick}
|
|
310
302
|
style={{ marginLeft: 10 }}
|
|
311
303
|
size="medium"
|
|
312
304
|
>
|