react-msaview 4.0.3 → 4.1.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.
- package/bundle/index.js +281 -103
- package/dist/colorSchemes.js +1 -1
- package/dist/colorSchemes.js.map +1 -1
- package/dist/components/Checkbox2.js.map +1 -1
- package/dist/components/Loading.js +4 -5
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/MSAView.js +3 -4
- package/dist/components/MSAView.js.map +1 -1
- package/dist/components/ResizeHandles.js.map +1 -1
- package/dist/components/SequenceTextArea.js +1 -2
- package/dist/components/SequenceTextArea.js.map +1 -1
- package/dist/components/TextTrack.d.ts +1 -1
- package/dist/components/TextTrack.js +1 -1
- package/dist/components/TextTrack.js.map +1 -1
- package/dist/components/Track.js +4 -5
- package/dist/components/Track.js.map +1 -1
- package/dist/components/VerticalScrollbar.js +1 -1
- package/dist/components/VerticalScrollbar.js.map +1 -1
- package/dist/components/dialogs/AboutDialog.js +4 -4
- package/dist/components/dialogs/AboutDialog.js.map +1 -1
- package/dist/components/dialogs/AddTrackDialog.js +1 -1
- package/dist/components/dialogs/AddTrackDialog.js.map +1 -1
- package/dist/components/dialogs/DomainDialog.js +1 -2
- package/dist/components/dialogs/DomainDialog.js.map +1 -1
- package/dist/components/dialogs/ExportSVGDialog.js +1 -1
- package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
- package/dist/components/dialogs/FeatureDialog.js +1 -1
- package/dist/components/dialogs/FeatureDialog.js.map +1 -1
- package/dist/components/dialogs/InterProScanDialog.js +3 -3
- package/dist/components/dialogs/InterProScanDialog.js.map +1 -1
- package/dist/components/dialogs/MetadataDialog.js +3 -3
- package/dist/components/dialogs/MetadataDialog.js.map +1 -1
- package/dist/components/dialogs/SettingsDialog.js +3 -3
- package/dist/components/dialogs/SettingsDialog.js.map +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js +2 -2
- package/dist/components/dialogs/TrackInfoDialog.js.map +1 -1
- package/dist/components/dialogs/TracklistDialog.js +1 -1
- package/dist/components/dialogs/TracklistDialog.js.map +1 -1
- package/dist/components/dialogs/UserProvidedDomainsDialog.js +3 -3
- package/dist/components/dialogs/UserProvidedDomainsDialog.js.map +1 -1
- package/dist/components/header/Header.js +5 -7
- package/dist/components/header/Header.js.map +1 -1
- package/dist/components/header/HeaderInfoArea.js.map +1 -1
- package/dist/components/header/HeaderMenu.js +3 -4
- package/dist/components/header/HeaderMenu.js.map +1 -1
- package/dist/components/header/HeaderMenuExtra.js +8 -9
- package/dist/components/header/HeaderMenuExtra.js.map +1 -1
- package/dist/components/header/HeaderStatusArea.js +1 -1
- package/dist/components/header/HeaderStatusArea.js.map +1 -1
- package/dist/components/header/MultiAlignmentSelector.js +1 -1
- package/dist/components/header/MultiAlignmentSelector.js.map +1 -1
- package/dist/components/header/ZoomControls.js +11 -5
- package/dist/components/header/ZoomControls.js.map +1 -1
- package/dist/components/import/ImportForm.js +19 -15
- package/dist/components/import/ImportForm.js.map +1 -1
- package/dist/components/import/ImportFormExamples.js +2 -2
- package/dist/components/import/ImportFormExamples.js.map +1 -1
- package/dist/components/import/util.d.ts +1 -1
- package/dist/components/minimap/Minimap.js.map +1 -1
- package/dist/components/minimap/MinimapSVG.js.map +1 -1
- package/dist/components/msa/Loading.js +1 -1
- package/dist/components/msa/Loading.js.map +1 -1
- package/dist/components/msa/MSACanvas.js +2 -2
- package/dist/components/msa/MSACanvas.js.map +1 -1
- package/dist/components/msa/MSACanvasBlock.js +2 -3
- package/dist/components/msa/MSACanvasBlock.js.map +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
- package/dist/components/msa/MSAPanel.js +0 -1
- package/dist/components/msa/MSAPanel.js.map +1 -1
- package/dist/components/msa/renderBoxFeatureCanvasBlock.js.map +1 -1
- package/dist/components/msa/renderMSABlock.d.ts +1 -1
- package/dist/components/msa/renderMSABlock.js.map +1 -1
- package/dist/components/tree/TreeBranchMenu.js.map +1 -1
- package/dist/components/tree/TreeCanvas.js +1 -2
- package/dist/components/tree/TreeCanvas.js.map +1 -1
- package/dist/components/tree/TreeCanvasBlock.js +4 -5
- package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
- package/dist/components/tree/TreeNodeMenu.js.map +1 -1
- package/dist/components/tree/TreePanel.js.map +1 -1
- package/dist/components/tree/TreeRuler.js.map +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +2 -2
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
- package/dist/components/tree/renderTreeCanvas.d.ts +2 -2
- package/dist/components/tree/renderTreeCanvas.js +5 -5
- package/dist/components/tree/renderTreeCanvas.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/launchInterProScan.js.map +1 -1
- package/dist/model/DialogQueue.js.map +1 -1
- package/dist/model.d.ts +20 -20
- package/dist/model.js +41 -29
- package/dist/model.js.map +1 -1
- package/dist/parsers/ClustalMSA.js.map +1 -1
- package/dist/parsers/EmfMSA.js.map +1 -1
- package/dist/parsers/StockholmMSA.js.map +1 -1
- package/dist/renderToSvg.d.ts +1 -1
- package/dist/renderToSvg.js +5 -6
- package/dist/renderToSvg.js.map +1 -1
- package/dist/rowCoordinateCalculations.test.js.map +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/util.js +1 -1
- package/dist/util.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/src/colorSchemes.ts +2 -1
- package/src/components/Checkbox2.tsx +1 -0
- package/src/components/Loading.tsx +6 -5
- package/src/components/MSAView.tsx +6 -5
- package/src/components/ResizeHandles.tsx +1 -1
- package/src/components/SequenceTextArea.tsx +2 -2
- package/src/components/TextTrack.tsx +5 -3
- package/src/components/Track.tsx +5 -5
- package/src/components/VerticalScrollbar.tsx +5 -2
- package/src/components/dialogs/AboutDialog.tsx +6 -7
- package/src/components/dialogs/AddTrackDialog.tsx +7 -5
- package/src/components/dialogs/DomainDialog.tsx +3 -2
- package/src/components/dialogs/ExportSVGDialog.tsx +7 -5
- package/src/components/dialogs/FeatureDialog.tsx +4 -3
- package/src/components/dialogs/InterProScanDialog.tsx +6 -5
- package/src/components/dialogs/MetadataDialog.tsx +5 -5
- package/src/components/dialogs/SettingsDialog.tsx +10 -10
- package/src/components/dialogs/TrackInfoDialog.tsx +3 -2
- package/src/components/dialogs/TracklistDialog.tsx +4 -4
- package/src/components/dialogs/UserProvidedDomainsDialog.tsx +7 -6
- package/src/components/header/Header.tsx +8 -11
- package/src/components/header/HeaderInfoArea.tsx +1 -1
- package/src/components/header/HeaderMenu.tsx +4 -6
- package/src/components/header/HeaderMenuExtra.tsx +9 -11
- package/src/components/header/HeaderStatusArea.tsx +2 -2
- package/src/components/header/MultiAlignmentSelector.tsx +2 -2
- package/src/components/header/ZoomControls.tsx +13 -6
- package/src/components/import/ImportForm.tsx +31 -24
- package/src/components/import/ImportFormExamples.tsx +5 -4
- package/src/components/import/util.ts +1 -1
- package/src/components/minimap/Minimap.tsx +2 -0
- package/src/components/minimap/MinimapSVG.tsx +2 -0
- package/src/components/msa/Loading.tsx +2 -1
- package/src/components/msa/MSACanvas.tsx +5 -4
- package/src/components/msa/MSACanvasBlock.tsx +5 -4
- package/src/components/msa/MSAMouseoverCanvas.tsx +4 -3
- package/src/components/msa/MSAPanel.tsx +2 -1
- package/src/components/msa/renderBoxFeatureCanvasBlock.ts +1 -3
- package/src/components/msa/renderMSABlock.ts +3 -4
- package/src/components/tree/TreeBranchMenu.tsx +1 -1
- package/src/components/tree/TreeCanvas.tsx +4 -4
- package/src/components/tree/TreeCanvasBlock.tsx +7 -7
- package/src/components/tree/TreeNodeMenu.tsx +1 -1
- package/src/components/tree/TreePanel.tsx +3 -1
- package/src/components/tree/TreeRuler.tsx +1 -1
- package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +5 -4
- package/src/components/tree/renderTreeCanvas.ts +7 -9
- package/src/index.ts +1 -1
- package/src/launchInterProScan.ts +2 -0
- package/src/model/DialogQueue.ts +2 -1
- package/src/model.ts +59 -47
- package/src/parsers/ClustalMSA.ts +1 -0
- package/src/parsers/EmfMSA.ts +1 -0
- package/src/parsers/StockholmMSA.ts +1 -1
- package/src/renderToSvg.tsx +7 -9
- package/src/rowCoordinateCalculations.test.ts +1 -0
- package/src/util.ts +4 -3
- package/src/version.ts +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { ErrorMessage, FileSelector } from '@jbrowse/core/ui'
|
|
4
|
+
import { Button, Container, Typography } from '@mui/material'
|
|
2
5
|
import { observer } from 'mobx-react'
|
|
3
|
-
import { Button, Container, Grid, Typography } from '@mui/material'
|
|
4
|
-
import { FileSelector } from '@jbrowse/core/ui'
|
|
5
|
-
import type { FileLocation } from '@jbrowse/core/util/types'
|
|
6
6
|
|
|
7
|
-
// locals
|
|
8
|
-
import type { MsaViewModel } from '../../model'
|
|
9
|
-
import { load } from './util'
|
|
10
7
|
import ImportFormExamples from './ImportFormExamples'
|
|
8
|
+
import { load } from './util'
|
|
9
|
+
|
|
10
|
+
import type { MsaViewModel } from '../../model'
|
|
11
|
+
import type { FileLocation } from '@jbrowse/core/util/types'
|
|
11
12
|
|
|
12
13
|
const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
|
|
13
14
|
const [msaFile, setMsaFile] = useState<FileLocation>()
|
|
@@ -17,11 +18,7 @@ const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
17
18
|
return (
|
|
18
19
|
<Container>
|
|
19
20
|
<div style={{ width: '50%' }}>
|
|
20
|
-
{error ?
|
|
21
|
-
<div style={{ padding: 20 }}>
|
|
22
|
-
<Typography color="error">Error: {`${error}`}</Typography>
|
|
23
|
-
</div>
|
|
24
|
-
) : null}
|
|
21
|
+
{error ? <ErrorMessage error={error} /> : null}
|
|
25
22
|
<Typography>
|
|
26
23
|
Open an MSA file (stockholm or clustal format) and/or a tree file
|
|
27
24
|
(newick format).
|
|
@@ -34,15 +31,25 @@ const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
34
31
|
</Typography>
|
|
35
32
|
</div>
|
|
36
33
|
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
34
|
+
<div
|
|
35
|
+
style={{
|
|
36
|
+
display: 'flex',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
gap: 40,
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<div>
|
|
43
|
+
<div>
|
|
44
|
+
<Typography>MSA file or URL</Typography>
|
|
45
|
+
<FileSelector location={msaFile} setLocation={setMsaFile} />
|
|
46
|
+
</div>
|
|
47
|
+
<div>
|
|
48
|
+
<Typography>Tree file or URL</Typography>
|
|
49
|
+
<FileSelector location={treeFile} setLocation={setTreeFile} />
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div>
|
|
46
53
|
<Button
|
|
47
54
|
onClick={() => {
|
|
48
55
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
@@ -61,13 +68,13 @@ const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
61
68
|
>
|
|
62
69
|
Open
|
|
63
70
|
</Button>
|
|
64
|
-
</
|
|
71
|
+
</div>
|
|
65
72
|
|
|
66
|
-
<
|
|
73
|
+
<div>
|
|
67
74
|
<Typography>Examples</Typography>
|
|
68
75
|
<ImportFormExamples model={model} />
|
|
69
|
-
</
|
|
70
|
-
</
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
71
78
|
</Container>
|
|
72
79
|
)
|
|
73
80
|
})
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { Link, Typography } from '@mui/material'
|
|
3
4
|
import { observer } from 'mobx-react'
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
import type { MsaViewModel } from '../../model'
|
|
7
|
-
import { smallTree, smallMSA, smallMSAOnly } from './data/seq2'
|
|
6
|
+
import { smallMSA, smallMSAOnly, smallTree } from './data/seq2'
|
|
8
7
|
import { load } from './util'
|
|
9
8
|
|
|
9
|
+
import type { MsaViewModel } from '../../model'
|
|
10
|
+
|
|
10
11
|
function ListItem({
|
|
11
12
|
onClick,
|
|
12
13
|
model,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
+
|
|
2
3
|
import { observer } from 'mobx-react'
|
|
3
4
|
|
|
4
|
-
// locals
|
|
5
|
-
import type { MsaViewModel } from '../../model'
|
|
6
|
-
import MSACanvasBlock from './MSACanvasBlock'
|
|
7
5
|
import Loading from './Loading'
|
|
6
|
+
import MSACanvasBlock from './MSACanvasBlock'
|
|
7
|
+
|
|
8
|
+
import type { MsaViewModel } from '../../model'
|
|
8
9
|
|
|
9
10
|
const MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {
|
|
10
11
|
const {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useMemo, useRef } from 'react'
|
|
2
|
+
|
|
2
3
|
import { useTheme } from '@mui/material'
|
|
3
4
|
import { autorun } from 'mobx'
|
|
4
5
|
import { observer } from 'mobx-react'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
import { renderBoxFeatureCanvasBlock } from './renderBoxFeatureCanvasBlock'
|
|
7
8
|
import { renderMSABlock } from './renderMSABlock'
|
|
8
|
-
import type { MsaViewModel } from '../../model'
|
|
9
9
|
import { colorContrast } from '../../util'
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
import type { MsaViewModel } from '../../model'
|
|
11
12
|
|
|
12
13
|
const MSACanvasBlock = observer(function ({
|
|
13
14
|
model,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react'
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { autorun } from 'mobx'
|
|
4
|
+
import { observer } from 'mobx-react'
|
|
4
5
|
|
|
5
|
-
// locals
|
|
6
|
-
import type { MsaViewModel } from '../../model'
|
|
7
6
|
import { renderMouseover } from './renderMSAMouseover'
|
|
8
7
|
|
|
8
|
+
import type { MsaViewModel } from '../../model'
|
|
9
|
+
|
|
9
10
|
const MSAMouseoverCanvas = observer(function ({
|
|
10
11
|
model,
|
|
11
12
|
}: {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { HierarchyNode } from 'd3-hierarchy'
|
|
2
|
-
|
|
3
|
-
// locals
|
|
4
1
|
import type { MsaViewModel } from '../../model'
|
|
5
2
|
import type { NodeWithIdsAndLength } from '../../util'
|
|
3
|
+
import type { HierarchyNode } from 'd3-hierarchy'
|
|
6
4
|
|
|
7
5
|
export function renderBoxFeatureCanvasBlock({
|
|
8
6
|
model,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Theme } from '@mui/material'
|
|
1
|
+
import { getClustalXColor, getPercentIdentityColor } from '../../colorSchemes'
|
|
3
2
|
|
|
4
|
-
// locals
|
|
5
3
|
import type { MsaViewModel } from '../../model'
|
|
6
|
-
import { getClustalXColor, getPercentIdentityColor } from '../../colorSchemes'
|
|
7
4
|
import type { NodeWithIdsAndLength } from '../../util'
|
|
5
|
+
import type { Theme } from '@mui/material'
|
|
6
|
+
import type { HierarchyNode } from 'd3-hierarchy'
|
|
8
7
|
|
|
9
8
|
export function renderMSABlock({
|
|
10
9
|
model,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
3
|
import { observer } from 'mobx-react'
|
|
4
4
|
|
|
5
|
-
// locals
|
|
6
|
-
import type { MsaViewModel } from '../../model'
|
|
7
5
|
import TreeCanvasBlock from './TreeCanvasBlock'
|
|
8
6
|
import { padding } from './renderTreeCanvas'
|
|
9
7
|
|
|
8
|
+
import type { MsaViewModel } from '../../model'
|
|
9
|
+
|
|
10
10
|
const TreeCanvas = observer(function ({ model }: { model: MsaViewModel }) {
|
|
11
11
|
const ref = useRef<HTMLDivElement>(null)
|
|
12
12
|
const scheduled = useRef(false)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { useTheme } from '@mui/material'
|
|
3
4
|
import { autorun } from 'mobx'
|
|
4
5
|
import { observer } from 'mobx-react'
|
|
5
|
-
import { useTheme } from '@mui/material'
|
|
6
6
|
import RBush from 'rbush'
|
|
7
7
|
|
|
8
|
-
// locals
|
|
9
|
-
import type { MsaViewModel } from '../../model'
|
|
10
|
-
import TreeNodeMenu from './TreeNodeMenu'
|
|
11
8
|
import TreeBranchMenu from './TreeBranchMenu'
|
|
9
|
+
import TreeNodeMenu from './TreeNodeMenu'
|
|
12
10
|
import { padding, renderTreeCanvas } from './renderTreeCanvas'
|
|
13
11
|
|
|
12
|
+
import type { MsaViewModel } from '../../model'
|
|
13
|
+
|
|
14
14
|
interface TooltipData {
|
|
15
15
|
name: string
|
|
16
16
|
id: string
|
|
@@ -36,7 +36,7 @@ const TreeCanvasBlock = observer(function ({
|
|
|
36
36
|
offsetY: number
|
|
37
37
|
}) {
|
|
38
38
|
const theme = useTheme()
|
|
39
|
-
const ref = useRef<HTMLCanvasElement>()
|
|
39
|
+
const ref = useRef<HTMLCanvasElement>(null)
|
|
40
40
|
const clickMap = useRef(new RBush<ClickEntry>())
|
|
41
41
|
const mouseoverRef = useRef<HTMLCanvasElement>(null)
|
|
42
42
|
const [branchMenu, setBranchMenu] = useState<TooltipData>()
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
|
|
2
3
|
import { observer } from 'mobx-react'
|
|
3
4
|
|
|
4
|
-
import type { MsaViewModel } from '../../model'
|
|
5
5
|
import TreeCanvas from './TreeCanvas'
|
|
6
6
|
|
|
7
|
+
import type { MsaViewModel } from '../../model'
|
|
8
|
+
|
|
7
9
|
const TreePanel = observer(function ({ model }: { model: MsaViewModel }) {
|
|
8
10
|
const { treeAreaWidth } = model
|
|
9
11
|
return (
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import Attributes from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attributes'
|
|
4
|
+
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard'
|
|
2
5
|
import { Dialog } from '@jbrowse/core/ui'
|
|
3
6
|
import { DialogContent } from '@mui/material'
|
|
4
7
|
import { observer } from 'mobx-react'
|
|
5
|
-
import Attributes from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attributes'
|
|
6
|
-
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard'
|
|
7
8
|
|
|
8
|
-
// locals
|
|
9
|
-
import type { MsaViewModel } from '../../../model'
|
|
10
9
|
import SequenceTextArea from '../../SequenceTextArea'
|
|
11
10
|
|
|
11
|
+
import type { MsaViewModel } from '../../../model'
|
|
12
|
+
|
|
12
13
|
const TreeNodeInfoDialog = observer(function ({
|
|
13
14
|
info,
|
|
14
15
|
model,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type RBush from 'rbush'
|
|
2
|
-
import type { Theme } from '@mui/material'
|
|
3
|
-
|
|
4
|
-
// locals
|
|
5
1
|
import type { MsaViewModel } from '../../model'
|
|
2
|
+
import type { Theme } from '@mui/material'
|
|
3
|
+
import type RBush from 'rbush'
|
|
6
4
|
|
|
7
5
|
export const padding = 600
|
|
8
6
|
|
|
@@ -255,11 +253,11 @@ export function renderTreeCanvas({
|
|
|
255
253
|
|
|
256
254
|
ctx.resetTransform()
|
|
257
255
|
|
|
258
|
-
// this is a bogus use of nref, it is never less than 0. we just are using
|
|
259
|
-
// in this statement because otherwise it would be an unused variable,
|
|
260
|
-
// just need to use nref to indicate a redraw in an autorun when canvas
|
|
261
|
-
// is updated and in order to convince bundlers like not to delete
|
|
262
|
-
// usage with propertyReadSideEffects
|
|
256
|
+
// this is a bogus use of nref, it is never less than 0. we just are using
|
|
257
|
+
// it in this statement because otherwise it would be an unused variable,
|
|
258
|
+
// we just need to use nref to indicate a redraw in an autorun when canvas
|
|
259
|
+
// ref is updated and in order to convince bundlers like not to delete
|
|
260
|
+
// unused usage with propertyReadSideEffects
|
|
263
261
|
const k =
|
|
264
262
|
nref < 0
|
|
265
263
|
? Number.NEGATIVE_INFINITY
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as MSAView } from './components/Loading'
|
|
2
|
-
export { default as MSAModelF
|
|
2
|
+
export { type MsaViewModel, default as MSAModelF } from './model'
|
package/src/model/DialogQueue.ts
CHANGED
package/src/model.ts
CHANGED
|
@@ -1,64 +1,53 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
|
|
3
|
+
import { groupBy, notEmpty, sum } from '@jbrowse/core/util'
|
|
4
|
+
import { openLocation } from '@jbrowse/core/util/io'
|
|
5
|
+
import { ElementId, FileLocation } from '@jbrowse/core/util/types/mst'
|
|
6
|
+
import { colord } from 'colord'
|
|
6
7
|
import { ascending } from 'd3-array'
|
|
7
|
-
import
|
|
8
|
+
import { cluster, hierarchy } from 'd3-hierarchy'
|
|
8
9
|
import { saveAs } from 'file-saver'
|
|
9
|
-
import
|
|
10
|
+
import { autorun, transaction } from 'mobx'
|
|
11
|
+
import { addDisposer, cast, types } from 'mobx-state-tree'
|
|
10
12
|
import { ungzip } from 'pako'
|
|
13
|
+
import Stockholm from 'stockholm-js'
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
import { blocksX, blocksY } from './calculateBlocks'
|
|
16
|
+
import colorSchemes from './colorSchemes'
|
|
17
|
+
import TextTrack from './components/TextTrack'
|
|
18
|
+
import palettes from './ggplotPalettes'
|
|
19
|
+
import { measureTextCanvas } from './measureTextCanvas'
|
|
20
|
+
import { DataModelF } from './model/DataModel'
|
|
21
|
+
import { DialogQueueSessionMixin } from './model/DialogQueue'
|
|
22
|
+
import { MSAModelF } from './model/msaModel'
|
|
23
|
+
import { TreeModelF } from './model/treeModel'
|
|
24
|
+
import parseNewick from './parseNewick'
|
|
25
|
+
import ClustalMSA from './parsers/ClustalMSA'
|
|
26
|
+
import EmfMSA from './parsers/EmfMSA'
|
|
27
|
+
import EmfTree from './parsers/EmfTree'
|
|
28
|
+
import FastaMSA from './parsers/FastaMSA'
|
|
29
|
+
import StockholmMSA from './parsers/StockholmMSA'
|
|
30
|
+
import { reparseTree } from './reparseTree'
|
|
31
|
+
import {
|
|
32
|
+
globalCoordToRowSpecificCoord,
|
|
33
|
+
mouseOverCoordToGlobalCoord,
|
|
34
|
+
} from './rowCoordinateCalculations'
|
|
23
35
|
import {
|
|
24
36
|
clamp,
|
|
25
37
|
collapse,
|
|
26
38
|
generateNodeIds,
|
|
39
|
+
len,
|
|
27
40
|
maxLength,
|
|
28
41
|
setBrLength,
|
|
29
42
|
skipBlanks,
|
|
30
|
-
type NodeWithIds,
|
|
31
|
-
type NodeWithIdsAndLength,
|
|
32
|
-
len,
|
|
33
43
|
} from './util'
|
|
34
|
-
import { colord } from 'colord'
|
|
35
|
-
import { reparseTree } from './reparseTree'
|
|
36
|
-
import { blocksX, blocksY } from './calculateBlocks'
|
|
37
|
-
import { measureTextCanvas } from './measureTextCanvas'
|
|
38
|
-
import palettes from './ggplotPalettes'
|
|
39
44
|
|
|
40
|
-
// components
|
|
41
|
-
import TextTrack from './components/TextTrack'
|
|
42
|
-
|
|
43
|
-
// parsers
|
|
44
|
-
import ClustalMSA from './parsers/ClustalMSA'
|
|
45
|
-
import EmfMSA from './parsers/EmfMSA'
|
|
46
|
-
import StockholmMSA from './parsers/StockholmMSA'
|
|
47
|
-
import FastaMSA from './parsers/FastaMSA'
|
|
48
|
-
import parseNewick from './parseNewick'
|
|
49
|
-
import colorSchemes from './colorSchemes'
|
|
50
|
-
|
|
51
|
-
// models
|
|
52
|
-
import { DataModelF } from './model/DataModel'
|
|
53
|
-
import { DialogQueueSessionMixin } from './model/DialogQueue'
|
|
54
|
-
import { TreeModelF } from './model/treeModel'
|
|
55
|
-
import { MSAModelF } from './model/msaModel'
|
|
56
45
|
import type { InterProScanResults } from './launchInterProScan'
|
|
57
|
-
import {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} from '
|
|
61
|
-
import
|
|
46
|
+
import type { NodeWithIds, NodeWithIdsAndLength } from './util'
|
|
47
|
+
import type { FileLocation as FileLocationType } from '@jbrowse/core/util/types'
|
|
48
|
+
import type { Theme } from '@mui/material'
|
|
49
|
+
import type { HierarchyNode } from 'd3-hierarchy'
|
|
50
|
+
import type { Instance } from 'mobx-state-tree'
|
|
62
51
|
|
|
63
52
|
export interface Accession {
|
|
64
53
|
accession: string
|
|
@@ -84,6 +73,10 @@ export interface ITextTrack {
|
|
|
84
73
|
|
|
85
74
|
export type BasicTrack = ITextTrack
|
|
86
75
|
|
|
76
|
+
export function isGzip(buf: Uint8Array) {
|
|
77
|
+
return buf[0] === 31 && buf[1] === 139 && buf[2] === 8
|
|
78
|
+
}
|
|
79
|
+
|
|
87
80
|
/**
|
|
88
81
|
* #stateModel MsaView
|
|
89
82
|
* extends
|
|
@@ -758,6 +751,12 @@ function stateModelFactory() {
|
|
|
758
751
|
.map(leaf => [leaf.data.name, MSA?.getRow(leaf.data.name)] as const)
|
|
759
752
|
.filter((f): f is [string, string] => !!f[1])
|
|
760
753
|
},
|
|
754
|
+
/**
|
|
755
|
+
* #getter
|
|
756
|
+
*/
|
|
757
|
+
get numRows() {
|
|
758
|
+
return this.rows.length
|
|
759
|
+
},
|
|
761
760
|
|
|
762
761
|
/**
|
|
763
762
|
* #getter
|
|
@@ -917,7 +916,11 @@ function stateModelFactory() {
|
|
|
917
916
|
* #getter
|
|
918
917
|
*/
|
|
919
918
|
get showMsaLetters() {
|
|
920
|
-
return
|
|
919
|
+
return (
|
|
920
|
+
self.drawMsaLetters &&
|
|
921
|
+
self.rowHeight >= 5 &&
|
|
922
|
+
self.colWidth > self.rowHeight / 2
|
|
923
|
+
)
|
|
921
924
|
},
|
|
922
925
|
/**
|
|
923
926
|
* #getter
|
|
@@ -1356,6 +1359,15 @@ function stateModelFactory() {
|
|
|
1356
1359
|
setFilter(arg: string, flag: boolean) {
|
|
1357
1360
|
self.featureFilters.set(arg, flag)
|
|
1358
1361
|
},
|
|
1362
|
+
/**
|
|
1363
|
+
* #action
|
|
1364
|
+
*/
|
|
1365
|
+
showEntire() {
|
|
1366
|
+
self.rowHeight = self.msaAreaHeight / self.numRows
|
|
1367
|
+
self.colWidth = self.msaAreaWidth / self.numColumns
|
|
1368
|
+
self.scrollX = 0
|
|
1369
|
+
self.scrollY = 0
|
|
1370
|
+
},
|
|
1359
1371
|
|
|
1360
1372
|
afterCreate() {
|
|
1361
1373
|
addDisposer(
|
package/src/parsers/EmfMSA.ts
CHANGED
package/src/renderToSvg.tsx
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
/* eslint-disable react-refresh/only-export-components */
|
|
2
2
|
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { when } from 'mobx'
|
|
3
|
+
|
|
5
4
|
import { renderToStaticMarkup } from '@jbrowse/core/util'
|
|
6
|
-
import
|
|
5
|
+
import { when } from 'mobx'
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import { renderTreeCanvas } from './components/tree/renderTreeCanvas'
|
|
7
|
+
import MinimapSVG from './components/minimap/MinimapSVG'
|
|
8
|
+
import { renderBoxFeatureCanvasBlock } from './components/msa/renderBoxFeatureCanvasBlock'
|
|
11
9
|
import { renderMSABlock } from './components/msa/renderMSABlock'
|
|
10
|
+
import { renderTreeCanvas } from './components/tree/renderTreeCanvas'
|
|
12
11
|
import { colorContrast } from './util'
|
|
13
12
|
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
13
|
+
import type { MsaViewModel } from './model'
|
|
14
|
+
import type { Theme } from '@mui/material'
|
|
16
15
|
|
|
17
16
|
export async function renderToSvg(
|
|
18
17
|
model: MsaViewModel,
|
|
@@ -81,7 +80,6 @@ async function render({
|
|
|
81
80
|
/>
|
|
82
81
|
</Wrapper>
|
|
83
82
|
</SvgWrapper>,
|
|
84
|
-
createRoot,
|
|
85
83
|
)
|
|
86
84
|
}
|
|
87
85
|
|
package/src/util.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { HierarchyNode } from 'd3-hierarchy'
|
|
2
|
-
import { max } from 'd3-array'
|
|
3
|
-
import type { Theme } from '@mui/material'
|
|
4
1
|
import { colord, extend } from 'colord'
|
|
5
2
|
import namesPlugin from 'colord/plugins/names'
|
|
3
|
+
import { max } from 'd3-array'
|
|
4
|
+
|
|
5
|
+
import type { Theme } from '@mui/material'
|
|
6
|
+
import type { HierarchyNode } from 'd3-hierarchy'
|
|
6
7
|
|
|
7
8
|
extend([namesPlugin])
|
|
8
9
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.0
|
|
1
|
+
export const version = '4.1.0'
|