react-msaview 5.0.1 → 5.0.3
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 +79 -79
- package/bundle/index.js.LICENSE.txt +0 -15
- package/bundle/index.js.map +1 -1
- package/dist/colorSchemes.js +1 -1
- package/dist/colorSchemes.js.map +1 -1
- package/dist/components/ConservationTrack.d.ts +2 -2
- package/dist/components/Loading.d.ts +1 -1
- package/dist/components/Loading.js +2 -2
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/MSAView.d.ts +1 -1
- package/dist/components/MSAView.js +8 -8
- package/dist/components/MSAView.js.map +1 -1
- package/dist/components/ResizeHandles.d.ts +1 -1
- package/dist/components/SequenceTextArea.js +2 -2
- package/dist/components/SequenceTextArea.js.map +1 -1
- package/dist/components/TextTrack.d.ts +2 -2
- package/dist/components/TextTrack.js +1 -1
- package/dist/components/TextTrack.js.map +1 -1
- package/dist/components/Track.d.ts +1 -1
- package/dist/components/Track.js +1 -1
- package/dist/components/Track.js.map +1 -1
- package/dist/components/VerticalScrollbar.d.ts +1 -1
- package/dist/components/dialogs/AboutDialog.js +1 -1
- package/dist/components/dialogs/AboutDialog.js.map +1 -1
- package/dist/components/dialogs/AddTrackDialog.d.ts +1 -1
- package/dist/components/dialogs/DomainDialog.d.ts +1 -1
- package/dist/components/dialogs/DomainDialog.js +3 -3
- package/dist/components/dialogs/DomainDialog.js.map +1 -1
- package/dist/components/dialogs/ExportSVGDialog.d.ts +1 -1
- package/dist/components/dialogs/ExportSVGDialog.js +1 -1
- package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
- package/dist/components/dialogs/FeatureDialog.d.ts +1 -1
- package/dist/components/dialogs/FeatureDialog.js +1 -1
- package/dist/components/dialogs/FeatureDialog.js.map +1 -1
- package/dist/components/dialogs/InterProScanDialog.d.ts +1 -1
- package/dist/components/dialogs/InterProScanDialog.js +1 -1
- package/dist/components/dialogs/InterProScanDialog.js.map +1 -1
- package/dist/components/dialogs/MetadataDialog.d.ts +1 -1
- package/dist/components/dialogs/MetadataDialog.js +1 -1
- package/dist/components/dialogs/MetadataDialog.js.map +1 -1
- package/dist/components/dialogs/SettingsDialog.d.ts +1 -1
- package/dist/components/dialogs/SettingsDialog.js +2 -2
- package/dist/components/dialogs/SettingsDialog.js.map +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js.map +1 -1
- package/dist/components/dialogs/UserProvidedDomainsDialog.d.ts +1 -1
- package/dist/components/dialogs/UserProvidedDomainsDialog.js +1 -1
- package/dist/components/dialogs/UserProvidedDomainsDialog.js.map +1 -1
- package/dist/components/header/GappynessSlider.d.ts +1 -1
- package/dist/components/header/Header.d.ts +1 -1
- package/dist/components/header/Header.js +10 -10
- package/dist/components/header/Header.js.map +1 -1
- package/dist/components/header/HeaderInfoArea.d.ts +1 -1
- package/dist/components/header/HeaderMenu.d.ts +1 -1
- package/dist/components/header/HeaderMenu.js +6 -6
- package/dist/components/header/HeaderMenu.js.map +1 -1
- package/dist/components/header/HeaderStatusArea.d.ts +1 -1
- package/dist/components/header/MultiAlignmentSelector.d.ts +1 -1
- package/dist/components/header/SettingsMenu.d.ts +1 -1
- package/dist/components/header/SettingsMenu.js +1 -1
- package/dist/components/header/SettingsMenu.js.map +1 -1
- package/dist/components/header/ZoomControls.d.ts +1 -1
- package/dist/components/header/ZoomMenu.d.ts +1 -1
- package/dist/components/header/ZoomStar.d.ts +1 -1
- package/dist/components/import/ImportForm.d.ts +1 -1
- package/dist/components/import/ImportForm.js +2 -2
- package/dist/components/import/ImportForm.js.map +1 -1
- package/dist/components/import/ImportFormExamples.d.ts +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.d.ts +1 -1
- package/dist/components/minimap/MinimapSVG.d.ts +1 -1
- package/dist/components/msa/MSACanvas.d.ts +1 -1
- package/dist/components/msa/MSACanvas.js +2 -2
- package/dist/components/msa/MSACanvas.js.map +1 -1
- package/dist/components/msa/MSACanvasBlock.d.ts +1 -1
- package/dist/components/msa/MSACanvasBlock.js +3 -3
- package/dist/components/msa/MSACanvasBlock.js.map +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.d.ts +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
- package/dist/components/msa/MSAPanel.d.ts +1 -1
- package/dist/components/msa/MSAPanel.js +2 -2
- package/dist/components/msa/MSAPanel.js.map +1 -1
- package/dist/components/msa/renderBoxFeatureCanvasBlock.d.ts +1 -1
- package/dist/components/msa/renderMSABlock.d.ts +1 -1
- package/dist/components/msa/renderMSAMouseover.d.ts +1 -1
- package/dist/components/tracks/renderTracksSvg.d.ts +2 -2
- package/dist/components/tree/TreeBranchMenu.d.ts +1 -1
- package/dist/components/tree/TreeCanvas.d.ts +1 -1
- package/dist/components/tree/TreeCanvas.js +2 -2
- package/dist/components/tree/TreeCanvas.js.map +1 -1
- package/dist/components/tree/TreeCanvasBlock.d.ts +1 -1
- package/dist/components/tree/TreeCanvasBlock.js +3 -3
- package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
- package/dist/components/tree/TreeNodeMenu.d.ts +1 -1
- package/dist/components/tree/TreeNodeMenu.js +1 -1
- package/dist/components/tree/TreeNodeMenu.js.map +1 -1
- package/dist/components/tree/TreePanel.d.ts +1 -1
- package/dist/components/tree/TreePanel.js +1 -1
- package/dist/components/tree/TreePanel.js.map +1 -1
- package/dist/components/tree/TreeRuler.d.ts +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.d.ts +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
- package/dist/components/tree/renderTreeCanvas.d.ts +1 -1
- package/dist/createPaletteMap.d.ts +7 -0
- package/dist/createPaletteMap.js +11 -0
- package/dist/createPaletteMap.js.map +1 -0
- package/dist/createPaletteMap.test.d.ts +1 -0
- package/dist/createPaletteMap.test.js +49 -0
- package/dist/createPaletteMap.test.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/launchInterProScan.d.ts +1 -1
- package/dist/launchInterProScan.js +1 -1
- package/dist/launchInterProScan.js.map +1 -1
- package/dist/model/msaModel.js +1 -1
- package/dist/model/msaModel.js.map +1 -1
- package/dist/model/treeModel.js +1 -1
- package/dist/model/treeModel.js.map +1 -1
- package/dist/model.d.ts +11 -3
- package/dist/model.js +54 -35
- package/dist/model.js.map +1 -1
- package/dist/neighborJoining.test.js +1 -1
- package/dist/neighborJoining.test.js.map +1 -1
- package/dist/parseAsn1.test.js +1 -1
- package/dist/parseAsn1.test.js.map +1 -1
- package/dist/renderToSvg.d.ts +1 -1
- package/dist/renderToSvg.js +10 -10
- package/dist/renderToSvg.js.map +1 -1
- package/dist/reparseTree.d.ts +1 -1
- package/dist/rowCoordinateCalculations.js +1 -1
- package/dist/rowCoordinateCalculations.js.map +1 -1
- package/dist/rowCoordinateCalculations.test.js +1 -1
- package/dist/rowCoordinateCalculations.test.js.map +1 -1
- package/dist/seqPosToGlobalCol.js +1 -1
- package/dist/seqPosToGlobalCol.js.map +1 -1
- package/dist/seqPosToGlobalCol.test.js +1 -1
- package/dist/seqPosToGlobalCol.test.js.map +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/vendor/copyToClipboard.d.ts +10 -0
- package/dist/vendor/copyToClipboard.js +113 -0
- package/dist/vendor/copyToClipboard.js.map +1 -0
- package/dist/vendor/fileSaver.d.ts +11 -0
- package/dist/vendor/fileSaver.js +80 -0
- package/dist/vendor/fileSaver.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +2 -2
- package/dist/webpack.js.map +1 -1
- package/package.json +25 -22
- package/src/colorSchemes.ts +1 -1
- package/src/components/ConservationTrack.tsx +2 -2
- package/src/components/Loading.tsx +3 -3
- package/src/components/MSAView.tsx +12 -9
- package/src/components/ResizeHandles.tsx +1 -1
- package/src/components/SequenceTextArea.tsx +2 -2
- package/src/components/TextTrack.tsx +3 -3
- package/src/components/Track.tsx +2 -2
- package/src/components/VerticalScrollbar.tsx +1 -1
- package/src/components/dialogs/AboutDialog.tsx +1 -1
- package/src/components/dialogs/AddTrackDialog.tsx +1 -1
- package/src/components/dialogs/DomainDialog.tsx +4 -4
- package/src/components/dialogs/ExportSVGDialog.tsx +2 -2
- package/src/components/dialogs/FeatureDialog.tsx +2 -2
- package/src/components/dialogs/InterProScanDialog.tsx +2 -2
- package/src/components/dialogs/MetadataDialog.tsx +2 -2
- package/src/components/dialogs/SettingsDialog.tsx +3 -3
- package/src/components/dialogs/TrackInfoDialog.tsx +2 -1
- package/src/components/dialogs/UserProvidedDomainsDialog.tsx +3 -3
- package/src/components/header/GappynessSlider.tsx +1 -1
- package/src/components/header/Header.tsx +11 -11
- package/src/components/header/HeaderInfoArea.tsx +1 -1
- package/src/components/header/HeaderMenu.tsx +9 -7
- package/src/components/header/HeaderStatusArea.tsx +1 -1
- package/src/components/header/MultiAlignmentSelector.tsx +1 -1
- package/src/components/header/SettingsMenu.tsx +2 -2
- package/src/components/header/ZoomControls.tsx +1 -1
- package/src/components/header/ZoomMenu.tsx +1 -1
- package/src/components/header/ZoomStar.tsx +1 -1
- package/src/components/import/ImportForm.tsx +3 -3
- package/src/components/import/ImportFormExamples.tsx +3 -3
- package/src/components/import/util.ts +1 -1
- package/src/components/minimap/Minimap.tsx +1 -1
- package/src/components/minimap/MinimapSVG.tsx +1 -1
- package/src/components/msa/MSACanvas.tsx +3 -3
- package/src/components/msa/MSACanvasBlock.tsx +4 -4
- package/src/components/msa/MSAMouseoverCanvas.tsx +2 -2
- package/src/components/msa/MSAPanel.tsx +3 -3
- package/src/components/msa/renderBoxFeatureCanvasBlock.ts +2 -2
- package/src/components/msa/renderMSABlock.ts +2 -2
- package/src/components/msa/renderMSAMouseover.ts +1 -1
- package/src/components/tracks/renderTracksSvg.ts +2 -2
- package/src/components/tree/TreeBranchMenu.tsx +1 -1
- package/src/components/tree/TreeCanvas.tsx +3 -3
- package/src/components/tree/TreeCanvasBlock.tsx +4 -4
- package/src/components/tree/TreeNodeMenu.tsx +4 -2
- package/src/components/tree/TreePanel.tsx +2 -2
- package/src/components/tree/TreeRuler.tsx +1 -1
- package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +2 -2
- package/src/components/tree/renderTreeCanvas.ts +1 -1
- package/src/createPaletteMap.test.ts +57 -0
- package/src/createPaletteMap.ts +11 -0
- package/src/index.ts +2 -2
- package/src/launchInterProScan.ts +2 -2
- package/src/model/msaModel.ts +1 -1
- package/src/model/treeModel.ts +1 -1
- package/src/model.ts +57 -37
- package/src/neighborJoining.test.ts +1 -1
- package/src/parseAsn1.test.ts +1 -1
- package/src/renderToSvg.tsx +17 -19
- package/src/reparseTree.ts +1 -1
- package/src/rowCoordinateCalculations.test.ts +1 -1
- package/src/rowCoordinateCalculations.ts +1 -1
- package/src/seqPosToGlobalCol.test.ts +1 -1
- package/src/seqPosToGlobalCol.ts +1 -1
- package/src/util.ts +1 -1
- package/src/vendor/copyToClipboard.ts +125 -0
- package/src/vendor/fileSaver.ts +107 -0
- package/src/version.ts +1 -1
- package/src/webpack.ts +2 -2
- package/src/declare.d.ts +0 -1
|
@@ -4,10 +4,10 @@ import { ErrorMessage, FileSelector } from '@jbrowse/core/ui'
|
|
|
4
4
|
import { Button, Container, Typography } from '@mui/material'
|
|
5
5
|
import { observer } from 'mobx-react'
|
|
6
6
|
|
|
7
|
-
import ImportFormExamples from './ImportFormExamples'
|
|
8
|
-
import { load } from './util'
|
|
7
|
+
import ImportFormExamples from './ImportFormExamples.tsx'
|
|
8
|
+
import { load } from './util.ts'
|
|
9
9
|
|
|
10
|
-
import type { MsaViewModel } from '../../model'
|
|
10
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
11
11
|
import type { FileLocation } from '@jbrowse/core/util/types'
|
|
12
12
|
|
|
13
13
|
const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
|
|
@@ -3,10 +3,10 @@ import React from 'react'
|
|
|
3
3
|
import { Link, Typography } from '@mui/material'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
|
|
6
|
-
import { smallMSA, smallMSAOnly, smallTree } from './data/seq2'
|
|
7
|
-
import { load } from './util'
|
|
6
|
+
import { smallMSA, smallMSAOnly, smallTree } from './data/seq2.ts'
|
|
7
|
+
import { load } from './util.ts'
|
|
8
8
|
|
|
9
|
-
import type { MsaViewModel } from '../../model'
|
|
9
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
10
10
|
|
|
11
11
|
function ListItem({
|
|
12
12
|
onClick,
|
|
@@ -2,10 +2,10 @@ import React, { useEffect, useRef, useState } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { observer } from 'mobx-react'
|
|
4
4
|
|
|
5
|
-
import Loading from './Loading'
|
|
6
|
-
import MSACanvasBlock from './MSACanvasBlock'
|
|
5
|
+
import Loading from './Loading.tsx'
|
|
6
|
+
import MSACanvasBlock from './MSACanvasBlock.tsx'
|
|
7
7
|
|
|
8
|
-
import type { MsaViewModel } from '../../model'
|
|
8
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
9
9
|
|
|
10
10
|
const MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {
|
|
11
11
|
const {
|
|
@@ -5,11 +5,11 @@ import { useTheme } from '@mui/material'
|
|
|
5
5
|
import { autorun } from 'mobx'
|
|
6
6
|
import { observer } from 'mobx-react'
|
|
7
7
|
|
|
8
|
-
import { renderBoxFeatureCanvasBlock } from './renderBoxFeatureCanvasBlock'
|
|
9
|
-
import { renderMSABlock } from './renderMSABlock'
|
|
10
|
-
import { colorContrast } from '../../util'
|
|
8
|
+
import { renderBoxFeatureCanvasBlock } from './renderBoxFeatureCanvasBlock.ts'
|
|
9
|
+
import { renderMSABlock } from './renderMSABlock.ts'
|
|
10
|
+
import { colorContrast } from '../../util.ts'
|
|
11
11
|
|
|
12
|
-
import type { MsaViewModel } from '../../model'
|
|
12
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
13
13
|
|
|
14
14
|
const MSACanvasBlock = observer(function ({
|
|
15
15
|
model,
|
|
@@ -4,9 +4,9 @@ import { isAlive } from '@jbrowse/mobx-state-tree'
|
|
|
4
4
|
import { autorun } from 'mobx'
|
|
5
5
|
import { observer } from 'mobx-react'
|
|
6
6
|
|
|
7
|
-
import { renderMouseover } from './renderMSAMouseover'
|
|
7
|
+
import { renderMouseover } from './renderMSAMouseover.ts'
|
|
8
8
|
|
|
9
|
-
import type { MsaViewModel } from '../../model'
|
|
9
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
10
10
|
|
|
11
11
|
const MSAMouseoverCanvas = observer(function ({
|
|
12
12
|
model,
|
|
@@ -2,11 +2,11 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { observer } from 'mobx-react'
|
|
4
4
|
|
|
5
|
-
import MSACanvas from './MSACanvas'
|
|
6
|
-
import MSAMouseoverCanvas from './MSAMouseoverCanvas'
|
|
5
|
+
import MSACanvas from './MSACanvas.tsx'
|
|
6
|
+
import MSAMouseoverCanvas from './MSAMouseoverCanvas.tsx'
|
|
7
7
|
|
|
8
8
|
// types
|
|
9
|
-
import type { MsaViewModel } from '../../model'
|
|
9
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
10
10
|
|
|
11
11
|
const MSAPanel = observer(function ({ model }: { model: MsaViewModel }) {
|
|
12
12
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MsaViewModel } from '../../model'
|
|
2
|
-
import type { NodeWithIdsAndLength } from '../../types'
|
|
1
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
2
|
+
import type { NodeWithIdsAndLength } from '../../types.ts'
|
|
3
3
|
import type { HierarchyNode } from 'd3-hierarchy'
|
|
4
4
|
|
|
5
5
|
export function renderBoxFeatureCanvasBlock({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MsaViewModel } from '../../model'
|
|
2
|
-
import type { NodeWithIdsAndLength } from '../../types'
|
|
1
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
2
|
+
import type { NodeWithIdsAndLength } from '../../types.ts'
|
|
3
3
|
import type { Theme } from '@mui/material'
|
|
4
4
|
import type { HierarchyNode } from 'd3-hierarchy'
|
|
5
5
|
|
|
@@ -4,10 +4,10 @@ import { isAlive } from '@jbrowse/mobx-state-tree'
|
|
|
4
4
|
import { autorun } from 'mobx'
|
|
5
5
|
import { observer } from 'mobx-react'
|
|
6
6
|
|
|
7
|
-
import TreeCanvasBlock from './TreeCanvasBlock'
|
|
8
|
-
import { padding } from './renderTreeCanvas'
|
|
7
|
+
import TreeCanvasBlock from './TreeCanvasBlock.tsx'
|
|
8
|
+
import { padding } from './renderTreeCanvas.ts'
|
|
9
9
|
|
|
10
|
-
import type { MsaViewModel } from '../../model'
|
|
10
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
11
11
|
|
|
12
12
|
const TreeCanvas = observer(function ({ model }: { model: MsaViewModel }) {
|
|
13
13
|
const ref = useRef<HTMLDivElement>(null)
|
|
@@ -5,11 +5,11 @@ import Flatbush from 'flatbush'
|
|
|
5
5
|
import { autorun } from 'mobx'
|
|
6
6
|
import { observer } from 'mobx-react'
|
|
7
7
|
|
|
8
|
-
import TreeBranchMenu from './TreeBranchMenu'
|
|
9
|
-
import TreeNodeMenu from './TreeNodeMenu'
|
|
10
|
-
import { padding, renderTreeCanvas } from './renderTreeCanvas'
|
|
8
|
+
import TreeBranchMenu from './TreeBranchMenu.tsx'
|
|
9
|
+
import TreeNodeMenu from './TreeNodeMenu.tsx'
|
|
10
|
+
import { padding, renderTreeCanvas } from './renderTreeCanvas.ts'
|
|
11
11
|
|
|
12
|
-
import type { MsaViewModel } from '../../model'
|
|
12
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
13
13
|
|
|
14
14
|
interface TooltipData {
|
|
15
15
|
name: string
|
|
@@ -3,10 +3,12 @@ import React, { lazy } from 'react'
|
|
|
3
3
|
import { Menu, MenuItem } from '@mui/material'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
|
|
6
|
-
import type { MsaViewModel } from '../../model'
|
|
6
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
7
7
|
|
|
8
8
|
// lazies
|
|
9
|
-
const TreeNodeInfoDialog = lazy(
|
|
9
|
+
const TreeNodeInfoDialog = lazy(
|
|
10
|
+
() => import('./dialogs/TreeNodeInfoDialog.tsx'),
|
|
11
|
+
)
|
|
10
12
|
|
|
11
13
|
const TreeMenu = observer(function ({
|
|
12
14
|
node,
|
|
@@ -2,9 +2,9 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { observer } from 'mobx-react'
|
|
4
4
|
|
|
5
|
-
import TreeCanvas from './TreeCanvas'
|
|
5
|
+
import TreeCanvas from './TreeCanvas.tsx'
|
|
6
6
|
|
|
7
|
-
import type { MsaViewModel } from '../../model'
|
|
7
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
8
8
|
|
|
9
9
|
const TreePanel = observer(function ({ model }: { model: MsaViewModel }) {
|
|
10
10
|
const { treeAreaWidth } = model
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { observer } from 'mobx-react'
|
|
4
4
|
|
|
5
|
-
import type { MsaViewModel } from '../../model'
|
|
5
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
6
6
|
|
|
7
7
|
const TreeRuler = observer(({ model }: { model: MsaViewModel }) => {
|
|
8
8
|
const { treeAreaWidth } = model
|
|
@@ -6,9 +6,9 @@ import { Dialog } from '@jbrowse/core/ui'
|
|
|
6
6
|
import { DialogContent } from '@mui/material'
|
|
7
7
|
import { observer } from 'mobx-react'
|
|
8
8
|
|
|
9
|
-
import SequenceTextArea from '../../SequenceTextArea'
|
|
9
|
+
import SequenceTextArea from '../../SequenceTextArea.tsx'
|
|
10
10
|
|
|
11
|
-
import type { MsaViewModel } from '../../../model'
|
|
11
|
+
import type { MsaViewModel } from '../../../model.ts'
|
|
12
12
|
|
|
13
13
|
const TreeNodeInfoDialog = observer(function ({
|
|
14
14
|
info,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { expect, test } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import { createPaletteMap } from './createPaletteMap.ts'
|
|
4
|
+
import palettes from './ggplotPalettes.ts'
|
|
5
|
+
|
|
6
|
+
// Original implementation for comparison
|
|
7
|
+
function originalFillPalette(keys: string[]) {
|
|
8
|
+
let i = 0
|
|
9
|
+
const map = {} as Record<string, string>
|
|
10
|
+
for (const key of keys) {
|
|
11
|
+
const k = Math.min(keys.length - 1, palettes.length - 1)
|
|
12
|
+
map[key] = palettes[k]![i]!
|
|
13
|
+
i++
|
|
14
|
+
}
|
|
15
|
+
return map
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
test('createPaletteMap matches original implementation with 1 key', () => {
|
|
19
|
+
const keys = ['IPR001234']
|
|
20
|
+
expect(createPaletteMap(keys)).toEqual(originalFillPalette(keys))
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
test('createPaletteMap matches original implementation with 3 keys', () => {
|
|
24
|
+
const keys = ['IPR001234', 'IPR005678', 'IPR009012']
|
|
25
|
+
expect(createPaletteMap(keys)).toEqual(originalFillPalette(keys))
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
test('createPaletteMap matches original implementation with 8 keys (max palette size)', () => {
|
|
29
|
+
const keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
|
|
30
|
+
expect(createPaletteMap(keys)).toEqual(originalFillPalette(keys))
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
test('createPaletteMap matches original implementation with more keys than palette colors', () => {
|
|
34
|
+
const keys = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
|
|
35
|
+
expect(createPaletteMap(keys)).toEqual(originalFillPalette(keys))
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
test('createPaletteMap returns correct colors for 3 keys', () => {
|
|
39
|
+
const keys = ['X', 'Y', 'Z']
|
|
40
|
+
const result = createPaletteMap(keys)
|
|
41
|
+
// With 3 keys, uses palette index 2 (0-indexed)
|
|
42
|
+
expect(result).toEqual({
|
|
43
|
+
X: '#F8766D',
|
|
44
|
+
Y: '#00BA38',
|
|
45
|
+
Z: '#619CFF',
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
test('createPaletteMap returns empty object for empty keys', () => {
|
|
50
|
+
expect(createPaletteMap([])).toEqual({})
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
test('createPaletteMap preserves key order', () => {
|
|
54
|
+
const keys = ['Z', 'A', 'M']
|
|
55
|
+
const result = createPaletteMap(keys)
|
|
56
|
+
expect(Object.keys(result)).toEqual(['Z', 'A', 'M'])
|
|
57
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import palettes from './ggplotPalettes.ts'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a map from keys to colors using ggplot-style palettes.
|
|
5
|
+
* The palette is selected based on the number of keys.
|
|
6
|
+
*/
|
|
7
|
+
export function createPaletteMap(keys: string[]) {
|
|
8
|
+
const k = Math.min(keys.length - 1, palettes.length - 1)
|
|
9
|
+
const palette = palettes[k]!
|
|
10
|
+
return Object.fromEntries(keys.map((key, i) => [key, palette[i]!]))
|
|
11
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as MSAView } from './components/Loading'
|
|
2
|
-
export { type MsaViewModel, default as MSAModelF } from './model'
|
|
1
|
+
export { default as MSAView } from './components/Loading.tsx'
|
|
2
|
+
export { type MsaViewModel, default as MSAModelF } from './model.ts'
|
|
3
3
|
export type { MSAParserType } from 'msa-parsers'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getSession } from '@jbrowse/core/util'
|
|
2
2
|
|
|
3
|
-
import { jsonfetch, textfetch, timeout } from './fetchUtils'
|
|
3
|
+
import { jsonfetch, textfetch, timeout } from './fetchUtils.ts'
|
|
4
4
|
|
|
5
|
-
import type { MsaViewModel } from './model'
|
|
5
|
+
import type { MsaViewModel } from './model.ts'
|
|
6
6
|
|
|
7
7
|
const base = 'https://www.ebi.ac.uk/Tools/services/rest'
|
|
8
8
|
|
package/src/model/msaModel.ts
CHANGED
package/src/model/treeModel.ts
CHANGED
package/src/model.ts
CHANGED
|
@@ -13,7 +13,6 @@ import { addDisposer, cast, types } from '@jbrowse/mobx-state-tree'
|
|
|
13
13
|
import { colord } from 'colord'
|
|
14
14
|
import { ascending } from 'd3-array'
|
|
15
15
|
import { cluster, hierarchy } from 'd3-hierarchy'
|
|
16
|
-
import { saveAs } from 'file-saver'
|
|
17
16
|
import { autorun, transaction } from 'mobx'
|
|
18
17
|
import {
|
|
19
18
|
A3mMSA,
|
|
@@ -29,10 +28,10 @@ import {
|
|
|
29
28
|
stockholmSniff,
|
|
30
29
|
} from 'msa-parsers'
|
|
31
30
|
|
|
32
|
-
import { blocksX, blocksY } from './calculateBlocks'
|
|
33
|
-
import colorSchemes from './colorSchemes'
|
|
34
|
-
import ConservationTrack from './components/ConservationTrack'
|
|
35
|
-
import TextTrack from './components/TextTrack'
|
|
31
|
+
import { blocksX, blocksY } from './calculateBlocks.ts'
|
|
32
|
+
import colorSchemes from './colorSchemes.ts'
|
|
33
|
+
import ConservationTrack from './components/ConservationTrack.tsx'
|
|
34
|
+
import TextTrack from './components/TextTrack.tsx'
|
|
36
35
|
import {
|
|
37
36
|
defaultAllowedGappyness,
|
|
38
37
|
defaultBgColor,
|
|
@@ -56,33 +55,34 @@ import {
|
|
|
56
55
|
defaultTreeAreaWidth,
|
|
57
56
|
defaultTreeWidth,
|
|
58
57
|
defaultTreeWidthMatchesArea,
|
|
59
|
-
} from './constants'
|
|
60
|
-
import {
|
|
61
|
-
import
|
|
62
|
-
import { measureTextCanvas } from './measureTextCanvas'
|
|
63
|
-
import { DataModelF } from './model/DataModel'
|
|
64
|
-
import { DialogQueueSessionMixin } from './model/DialogQueue'
|
|
65
|
-
import { MSAModelF } from './model/msaModel'
|
|
66
|
-
import { TreeModelF } from './model/treeModel'
|
|
67
|
-
import { calculateNeighborJoiningTree } from './neighborJoining'
|
|
68
|
-
import { parseAsn1 } from './parseAsn1'
|
|
69
|
-
import { reparseTree } from './reparseTree'
|
|
58
|
+
} from './constants.ts'
|
|
59
|
+
import { createPaletteMap } from './createPaletteMap.ts'
|
|
60
|
+
import { flatToTree } from './flatToTree.ts'
|
|
61
|
+
import { measureTextCanvas } from './measureTextCanvas.ts'
|
|
62
|
+
import { DataModelF } from './model/DataModel.ts'
|
|
63
|
+
import { DialogQueueSessionMixin } from './model/DialogQueue.ts'
|
|
64
|
+
import { MSAModelF } from './model/msaModel.ts'
|
|
65
|
+
import { TreeModelF } from './model/treeModel.ts'
|
|
66
|
+
import { calculateNeighborJoiningTree } from './neighborJoining.ts'
|
|
67
|
+
import { parseAsn1 } from './parseAsn1.ts'
|
|
68
|
+
import { reparseTree } from './reparseTree.ts'
|
|
70
69
|
import {
|
|
71
70
|
globalColToVisibleCol,
|
|
72
71
|
visibleColToGlobalCol,
|
|
73
72
|
visibleColToSeqPosForRow,
|
|
74
|
-
} from './rowCoordinateCalculations'
|
|
75
|
-
import { seqPosToGlobalCol } from './seqPosToGlobalCol'
|
|
76
|
-
import { collapse, len, maxLength, setBrLength, skipBlanks } from './util'
|
|
73
|
+
} from './rowCoordinateCalculations.ts'
|
|
74
|
+
import { seqPosToGlobalCol } from './seqPosToGlobalCol.ts'
|
|
75
|
+
import { collapse, len, maxLength, setBrLength, skipBlanks } from './util.ts'
|
|
76
|
+
import { saveAs } from './vendor/fileSaver.ts'
|
|
77
77
|
|
|
78
|
-
import type { InterProScanResults } from './launchInterProScan'
|
|
78
|
+
import type { InterProScanResults } from './launchInterProScan.ts'
|
|
79
79
|
import type {
|
|
80
80
|
Accession,
|
|
81
81
|
BasicTrack,
|
|
82
82
|
NodeWithIds,
|
|
83
83
|
NodeWithIdsAndLength,
|
|
84
84
|
TextTrackModel,
|
|
85
|
-
} from './types'
|
|
85
|
+
} from './types.ts'
|
|
86
86
|
import type { FileLocation as FileLocationType } from '@jbrowse/core/util/types'
|
|
87
87
|
import type { Instance } from '@jbrowse/mobx-state-tree'
|
|
88
88
|
import type { Theme } from '@mui/material'
|
|
@@ -460,7 +460,7 @@ function stateModelFactory() {
|
|
|
460
460
|
}
|
|
461
461
|
|
|
462
462
|
// Get all descendant leaf names
|
|
463
|
-
const descendantNames = node.leaves().map(
|
|
463
|
+
const descendantNames = node.leaves().map(leaf => leaf.data.name)
|
|
464
464
|
|
|
465
465
|
self.hoveredTreeNode = { nodeId, descendantNames }
|
|
466
466
|
},
|
|
@@ -999,6 +999,34 @@ function stateModelFactory() {
|
|
|
999
999
|
return this.colStats.map(val => sum(Object.values(val)))
|
|
1000
1000
|
},
|
|
1001
1001
|
|
|
1002
|
+
/**
|
|
1003
|
+
* #getter
|
|
1004
|
+
* Detects sequence type based on letters present in the alignment.
|
|
1005
|
+
* Returns 'dna', 'rna', or 'amino'.
|
|
1006
|
+
*/
|
|
1007
|
+
get sequenceType(): 'dna' | 'rna' | 'amino' {
|
|
1008
|
+
const letters = new Set<string>()
|
|
1009
|
+
for (const stats of this.colStats) {
|
|
1010
|
+
for (const letter of Object.keys(stats)) {
|
|
1011
|
+
const upper = letter.toUpperCase()
|
|
1012
|
+
if (upper !== '-' && upper !== '.') {
|
|
1013
|
+
letters.add(upper)
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
const dna = new Set(['A', 'C', 'G', 'T', 'N'])
|
|
1018
|
+
const rna = new Set(['A', 'C', 'G', 'U', 'N'])
|
|
1019
|
+
const isDna = [...letters].every(l => dna.has(l))
|
|
1020
|
+
const isRna = [...letters].every(l => rna.has(l))
|
|
1021
|
+
if (isDna && !letters.has('U')) {
|
|
1022
|
+
return 'dna'
|
|
1023
|
+
}
|
|
1024
|
+
if (isRna && !letters.has('T')) {
|
|
1025
|
+
return 'rna'
|
|
1026
|
+
}
|
|
1027
|
+
return 'amino'
|
|
1028
|
+
},
|
|
1029
|
+
|
|
1002
1030
|
/**
|
|
1003
1031
|
* #getter
|
|
1004
1032
|
* Pre-computed consensus letter and percent identity color per column.
|
|
@@ -1175,8 +1203,8 @@ function stateModelFactory() {
|
|
|
1175
1203
|
* Returns values 0-1 where 1 = fully conserved, 0 = no conservation.
|
|
1176
1204
|
*/
|
|
1177
1205
|
get conservation() {
|
|
1178
|
-
const { colStats, colStatsSums } = this
|
|
1179
|
-
const alphabetSize = 20
|
|
1206
|
+
const { colStats, colStatsSums, sequenceType } = this
|
|
1207
|
+
const alphabetSize = sequenceType === 'amino' ? 20 : 4
|
|
1180
1208
|
const maxEntropy = Math.log2(alphabetSize)
|
|
1181
1209
|
|
|
1182
1210
|
return colStats.map((stats, i) => {
|
|
@@ -1617,9 +1645,9 @@ function stateModelFactory() {
|
|
|
1617
1645
|
* @returns The global column index in the full MSA
|
|
1618
1646
|
*/
|
|
1619
1647
|
seqPosToGlobalCol(rowName: string, seqPos: number) {
|
|
1620
|
-
const {
|
|
1621
|
-
const index =
|
|
1622
|
-
return index !==
|
|
1648
|
+
const { rows } = self
|
|
1649
|
+
const index = this.rowNamesSet.get(rowName)
|
|
1650
|
+
return index !== undefined && rows[index]
|
|
1623
1651
|
? seqPosToGlobalCol({
|
|
1624
1652
|
row: rows[index][1],
|
|
1625
1653
|
seqPos,
|
|
@@ -1733,15 +1761,7 @@ function stateModelFactory() {
|
|
|
1733
1761
|
* #getter
|
|
1734
1762
|
*/
|
|
1735
1763
|
get fillPalette() {
|
|
1736
|
-
|
|
1737
|
-
let i = 0
|
|
1738
|
-
const map = {} as Record<string, string>
|
|
1739
|
-
for (const key of arr) {
|
|
1740
|
-
const k = Math.min(arr.length - 1, palettes.length - 1)
|
|
1741
|
-
map[key] = palettes[k]![i]!
|
|
1742
|
-
i++
|
|
1743
|
-
}
|
|
1744
|
-
return map
|
|
1764
|
+
return createPaletteMap([...self.tidyInterProAnnotationTypes.keys()])
|
|
1745
1765
|
},
|
|
1746
1766
|
/**
|
|
1747
1767
|
* #getter
|
|
@@ -1797,7 +1817,7 @@ function stateModelFactory() {
|
|
|
1797
1817
|
includeTracks?: boolean
|
|
1798
1818
|
exportType: string
|
|
1799
1819
|
}) {
|
|
1800
|
-
const { renderToSvg } = await import('./renderToSvg')
|
|
1820
|
+
const { renderToSvg } = await import('./renderToSvg.tsx')
|
|
1801
1821
|
const html = await renderToSvg(self as MsaViewModel, opts)
|
|
1802
1822
|
const blob = new Blob([html], { type: 'image/svg+xml' })
|
|
1803
1823
|
saveAs(blob, 'image.svg')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { calculateNeighborJoiningTree } from './neighborJoining'
|
|
3
|
+
import { calculateNeighborJoiningTree } from './neighborJoining.ts'
|
|
4
4
|
|
|
5
5
|
describe('calculateNeighborJoiningTree', () => {
|
|
6
6
|
test('generates valid Newick tree for 2 sequences', () => {
|
package/src/parseAsn1.test.ts
CHANGED
package/src/renderToSvg.tsx
CHANGED
|
@@ -4,15 +4,16 @@ import React from 'react'
|
|
|
4
4
|
import { renderToStaticMarkup } from '@jbrowse/core/util'
|
|
5
5
|
import { when } from 'mobx'
|
|
6
6
|
|
|
7
|
-
import MinimapSVG from './components/minimap/MinimapSVG'
|
|
8
|
-
import { renderBoxFeatureCanvasBlock } from './components/msa/renderBoxFeatureCanvasBlock'
|
|
9
|
-
import { renderMSABlock } from './components/msa/renderMSABlock'
|
|
10
|
-
import { renderAllTracks } from './components/tracks/renderTracksSvg'
|
|
11
|
-
import { renderTreeCanvas } from './components/tree/renderTreeCanvas'
|
|
12
|
-
import { colorContrast } from './util'
|
|
7
|
+
import MinimapSVG from './components/minimap/MinimapSVG.tsx'
|
|
8
|
+
import { renderBoxFeatureCanvasBlock } from './components/msa/renderBoxFeatureCanvasBlock.ts'
|
|
9
|
+
import { renderMSABlock } from './components/msa/renderMSABlock.ts'
|
|
10
|
+
import { renderAllTracks } from './components/tracks/renderTracksSvg.ts'
|
|
11
|
+
import { renderTreeCanvas } from './components/tree/renderTreeCanvas.ts'
|
|
12
|
+
import { colorContrast } from './util.ts'
|
|
13
13
|
|
|
14
|
-
import type { MsaViewModel } from './model'
|
|
14
|
+
import type { MsaViewModel } from './model.ts'
|
|
15
15
|
import type { Theme } from '@mui/material'
|
|
16
|
+
import type { Context as ContextType } from '@jbrowse/svgcanvas'
|
|
16
17
|
|
|
17
18
|
export interface ExportSvgOptions {
|
|
18
19
|
theme: Theme
|
|
@@ -80,7 +81,7 @@ async function render({
|
|
|
80
81
|
includeMinimap?: boolean
|
|
81
82
|
includeTracks?: boolean
|
|
82
83
|
}) {
|
|
83
|
-
const { Context } = await import('svgcanvas')
|
|
84
|
+
const { Context } = await import('@jbrowse/svgcanvas')
|
|
84
85
|
const Wrapper = includeMinimap ? MinimapWrapper : NullWrapper
|
|
85
86
|
|
|
86
87
|
return renderToStaticMarkup(
|
|
@@ -131,17 +132,16 @@ function CoreRendering({
|
|
|
131
132
|
contentHeight: number
|
|
132
133
|
offsetX: number
|
|
133
134
|
offsetY: number
|
|
134
|
-
Context:
|
|
135
|
-
width: number,
|
|
136
|
-
height: number,
|
|
137
|
-
) => CanvasRenderingContext2D & { getSvg: () => { innerHTML: string } }
|
|
135
|
+
Context: typeof ContextType
|
|
138
136
|
}) {
|
|
139
137
|
const { treeAreaWidth, colorScheme, id } = model
|
|
140
138
|
const clipId1 = `tree-${id}`
|
|
141
139
|
const clipId2 = `msa-${id}`
|
|
142
140
|
const contrastScheme = colorContrast(colorScheme, theme)
|
|
143
|
-
|
|
144
|
-
const
|
|
141
|
+
|
|
142
|
+
const ctx1 = new Context(width, contentHeight) as any
|
|
143
|
+
|
|
144
|
+
const ctx2 = new Context(width, contentHeight) as any
|
|
145
145
|
renderBoxFeatureCanvasBlock({
|
|
146
146
|
ctx: ctx2,
|
|
147
147
|
offsetX,
|
|
@@ -209,16 +209,14 @@ function TrackRendering({
|
|
|
209
209
|
width: number
|
|
210
210
|
trackHeight: number
|
|
211
211
|
offsetX: number
|
|
212
|
-
Context:
|
|
213
|
-
width: number,
|
|
214
|
-
height: number,
|
|
215
|
-
) => CanvasRenderingContext2D & { getSvg: () => { innerHTML: string } }
|
|
212
|
+
Context: typeof ContextType
|
|
216
213
|
}) {
|
|
217
214
|
const { treeAreaWidth, colorScheme, id } = model
|
|
218
215
|
const clipId = `tracks-${id}`
|
|
219
216
|
const contrastScheme = colorContrast(colorScheme, theme)
|
|
220
217
|
const msaAreaWidth = width - treeAreaWidth
|
|
221
|
-
|
|
218
|
+
|
|
219
|
+
const ctx = new Context(msaAreaWidth, trackHeight) as any
|
|
222
220
|
|
|
223
221
|
renderAllTracks({
|
|
224
222
|
model,
|
package/src/reparseTree.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
globalColToVisibleCol,
|
|
6
6
|
visibleColToGlobalCol,
|
|
7
7
|
visibleColToSeqPos,
|
|
8
|
-
} from './rowCoordinateCalculations'
|
|
8
|
+
} from './rowCoordinateCalculations.ts'
|
|
9
9
|
|
|
10
10
|
// Tests for visibleColToGlobalCol (visible → global)
|
|
11
11
|
test('visibleColToGlobalCol with blanks at positions [2, 5, 8]', () => {
|