From 015769cd73437ecfa0119ce0018f1c7f61717e1f Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 9 Feb 2024 10:43:59 -0500 Subject: [PATCH 1/2] Squash updates Remove clone. It seems to be unneeded, even though it will mutate the original object, this doesn't seem like it should matter Another optimization to the track selector Use structuredClone Misc lint fixes Misc --- packages/app-core/src/JBrowseConfig/index.ts | 8 +- packages/app-core/src/JBrowseModel/index.ts | 23 ++-- .../core/configuration/configurationSchema.ts | 50 +++++++++ packages/core/util/tracks.ts | 101 +++++++++++++++++- packages/core/util/types/index.ts | 5 +- packages/product-core/src/Session/Tracks.ts | 7 ++ packages/product-core/src/ui/AboutDialog.tsx | 14 ++- .../src/ui/AboutDialogContents.tsx | 14 ++- .../product-core/src/ui/FileInfoPanel.tsx | 5 +- .../product-core/src/ui/RefNameInfoDialog.tsx | 6 +- packages/web-core/src/BaseWebSession/index.ts | 7 ++ .../circular-view/src/CircularView/model.ts | 44 ++------ .../HierarchicalTrackSelector.test.tsx.snap | 20 ++-- .../components/tree/TrackLabel.tsx | 2 +- .../components/tree/TrackListNode.tsx | 18 ++-- .../components/tree/util.ts | 45 ++++++++ .../facetedModel.ts | 5 +- .../facetedUtil.ts | 2 +- .../filterTracks.ts | 12 ++- .../generateHierarchy.ts | 15 ++- plugins/dotplot-view/src/DotplotView/model.ts | 47 ++------ .../stateModelFactory.ts | 62 ++--------- .../src/LinearGenomeView/model.ts | 73 +++---------- .../sv-inspector/src/SvInspectorView/model.ts | 6 +- products/jbrowse-desktop/src/jbrowseModel.ts | 3 +- .../jbrowse-react-app/src/jbrowseModel.ts | 4 +- products/jbrowse-web/src/jbrowseModel.test.ts | 1 + products/jbrowse-web/src/jbrowseModel.ts | 8 +- .../__snapshots__/rootModel.test.ts.snap | 10 -- .../jbrowse-web/src/rootModel/rootModel.ts | 1 + 30 files changed, 358 insertions(+), 260 deletions(-) create mode 100644 plugins/data-management/src/HierarchicalTrackSelectorWidget/components/tree/util.ts diff --git a/packages/app-core/src/JBrowseConfig/index.ts b/packages/app-core/src/JBrowseConfig/index.ts index dc78e98a1c..3e25670e95 100644 --- a/packages/app-core/src/JBrowseConfig/index.ts +++ b/packages/app-core/src/JBrowseConfig/index.ts @@ -34,9 +34,11 @@ import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration' export function JBrowseConfigF({ pluginManager, assemblyConfigSchema, + adminMode, }: { pluginManager: PluginManager assemblyConfigSchema: AnyConfigurationSchemaType + adminMode: boolean }) { return types.model('JBrowseConfig', { configuration: ConfigurationSchema('Root', { @@ -119,7 +121,11 @@ export function JBrowseConfigF({ * track configuration is an array of track config schemas. multiple * instances of a track can exist that use the same configuration */ - tracks: types.array(pluginManager.pluggableConfigSchemaType('track')), + tracks: + // @ts-expect-error + adminMode || globalThis.disableFrozenTracks + ? types.array(pluginManager.pluggableConfigSchemaType('track')) + : types.frozen([] as { trackId: string; [key: string]: unknown }[]), /** * #slot * configuration for internet accounts, see InternetAccounts diff --git a/packages/app-core/src/JBrowseModel/index.ts b/packages/app-core/src/JBrowseModel/index.ts index f95c563e05..637b17995d 100644 --- a/packages/app-core/src/JBrowseModel/index.ts +++ b/packages/app-core/src/JBrowseModel/index.ts @@ -22,13 +22,15 @@ import type RpcManager from '@jbrowse/core/rpc/RpcManager' */ export function JBrowseModelF({ + adminMode, pluginManager, assemblyConfigSchema, }: { + adminMode: boolean pluginManager: PluginManager assemblyConfigSchema: BaseAssemblyConfigSchema }) { - return JBrowseConfigF({ pluginManager, assemblyConfigSchema }) + return JBrowseConfigF({ pluginManager, assemblyConfigSchema, adminMode }) .views(self => ({ /** * #getter @@ -79,13 +81,17 @@ export function JBrowseModelF({ /** * #action */ - addTrackConf(trackConf: AnyConfigurationModel) { + addTrackConf(trackConf: { trackId: string; type: string }) { const { type } = trackConf if (!type) { throw new Error(`unknown track type ${type}`) } - const length = self.tracks.push(trackConf) - return self.tracks[length - 1] + if (adminMode) { + self.tracks.push(trackConf) + } else { + self.tracks = [...self.tracks, trackConf] + } + return self.tracks.at(-1) }, /** * #action @@ -109,8 +115,13 @@ export function JBrowseModelF({ * #action */ deleteTrackConf(trackConf: AnyConfigurationModel) { - const elt = self.tracks.find(t => t.trackId === trackConf.trackId) - return self.tracks.remove(elt) + if (adminMode) { + const elt = self.tracks.find(t => t.trackId === trackConf.trackId) + // @ts-expect-error + return self.tracks.remove(elt) + } else { + return self.tracks.filter(f => f.trackId !== trackConf.trackId) + } }, /** * #action diff --git a/packages/core/configuration/configurationSchema.ts b/packages/core/configuration/configurationSchema.ts index 92df646117..8dd9f97406 100644 --- a/packages/core/configuration/configurationSchema.ts +++ b/packages/core/configuration/configurationSchema.ts @@ -1,13 +1,17 @@ import { + getEnv, + getRoot, getSnapshot, isLateType, isStateTreeNode, isType, + resolveIdentifier, types, } from 'mobx-state-tree' import ConfigSlot from './configurationSlot' import { isConfigurationSchemaType } from './util' +import { getContainingTrack, getSession } from '../util' import { ElementId } from '../util/types/mst' import type { ConfigSlotDefinition } from './configurationSlot' @@ -276,9 +280,55 @@ export function ConfigurationSchema< return schemaType } +export function TrackConfigurationReference(schemaType: IAnyType) { + const trackRef = types.reference(schemaType, { + get(id, parent) { + let ret = getSession(parent).tracksById[id] + if (!ret) { + // @ts-expect-error + ret = resolveIdentifier(schemaType, getRoot(parent), id) + } + if (!ret) { + throw new Error(`${id} not found`) + } + return isStateTreeNode(ret) ? ret : schemaType.create(ret, getEnv(parent)) + }, + set(value) { + return value.trackId + }, + }) + return types.union(trackRef, schemaType) +} + +export function DisplayConfigurationReference(schemaType: IAnyType) { + const displayRef = types.reference(schemaType, { + get(id, parent) { + const track = getContainingTrack(parent) + let ret = track.configuration.displays.find(u => u.displayId === id) + if (!ret) { + // @ts-expect-error + ret = resolveIdentifier(schemaType, getRoot(parent), id) + } + if (!ret) { + throw new Error(`${id} not found`) + } + return ret + }, + set(value) { + return value.displayId + }, + }) + return types.union(displayRef, schemaType) +} + export function ConfigurationReference< SCHEMATYPE extends AnyConfigurationSchemaType, >(schemaType: SCHEMATYPE) { + if (schemaType.name.endsWith('TrackConfigurationSchema')) { + return TrackConfigurationReference(schemaType) + } else if (schemaType.name.endsWith('DisplayConfigurationSchema')) { + return DisplayConfigurationReference(schemaType) + } // we cast this to SCHEMATYPE, because the reference *should* behave just // like the object it points to. It won't be undefined (this is a // `reference`, not a `safeReference`) diff --git a/packages/core/util/tracks.ts b/packages/core/util/tracks.ts index 5a4830e4d7..403397fda3 100644 --- a/packages/core/util/tracks.ts +++ b/packages/core/util/tracks.ts @@ -1,11 +1,16 @@ -import { getParent, isRoot } from 'mobx-state-tree' +import { getParent, getRoot, isRoot, resolveIdentifier } from 'mobx-state-tree' import { getEnv, getSession, objectHash } from './index' import { readConfObject } from '../configuration' import type { FileLocation, PreFileLocation } from './types' import type { AnyConfigurationModel } from '../configuration' -import type { IAnyStateTreeNode } from 'mobx-state-tree' +import type { + IAnyStateTreeNode, + IAnyType, + Instance, + types, +} from 'mobx-state-tree' /* utility functions for use by track models and so forth */ @@ -275,3 +280,95 @@ export function getTrackName( } return trackName } + +type MSTArray = Instance>> + +interface MinimalTrack extends IAnyType { + configuration: { trackId: string } +} + +interface GenericView { + type: string + tracks: MSTArray +} + +export function showTrackGeneric( + self: GenericView, + trackId: string, + initialSnapshot = {}, + displayInitialSnapshot = {}, +) { + const { pluginManager } = getEnv(self) + const session = getSession(self) + let conf = session.tracks.find(t => t.trackId === trackId) + if (!conf) { + const schema = pluginManager.pluggableConfigSchemaType('track') + conf = resolveIdentifier(schema, getRoot(self), trackId) + } + if (!conf) { + throw new Error(`Could not resolve identifier "${trackId}"`) + } + const trackType = pluginManager.getTrackType(conf.type) + if (!trackType) { + throw new Error(`Unknown track type ${conf.type}`) + } + const viewType = pluginManager.getViewType(self.type)! + const supportedDisplays = new Set(viewType.displayTypes.map(d => d.name)) + + const { displays = [] } = conf + const displayTypes = new Set() + + displays.forEach((d: any) => d && displayTypes.add(d.type)) + trackType.displayTypes.forEach(displayType => { + if (!displayTypes.has(displayType.name)) { + displays.push({ + displayId: `${trackId}-${displayType.name}`, + type: displayType.name, + }) + } + }) + + const displayConf = displays?.find((d: AnyConfigurationModel) => + supportedDisplays.has(d.type), + ) + if (!displayConf) { + throw new Error( + `Could not find a compatible display for view type ${self.type}`, + ) + } + + const found = self.tracks.find(t => t.configuration.trackId === trackId) + if (!found) { + const track = trackType.stateModel.create({ + ...initialSnapshot, + type: conf.type, + configuration: conf, + displays: [ + { + type: displayConf.type, + configuration: displayConf, + ...displayInitialSnapshot, + }, + ], + }) + self.tracks.push(track) + return track + } + return found +} + +export function hideTrackGeneric(self: GenericView, trackId: string) { + const t = self.tracks.find(t => t.configuration.trackId === trackId) + if (t) { + self.tracks.remove(t) + return 1 + } + return 0 +} + +export function toggleTrackGeneric(self: GenericView, trackId: string) { + const hiddenCount = hideTrackGeneric(self, trackId) + if (!hiddenCount) { + showTrackGeneric(self, trackId) + } +} diff --git a/packages/core/util/types/index.ts b/packages/core/util/types/index.ts index a3ccf37aaa..9221be99e8 100644 --- a/packages/core/util/types/index.ts +++ b/packages/core/util/types/index.ts @@ -82,6 +82,7 @@ export type DialogComponentType = /** minimum interface that all session state models must implement */ export interface AbstractSessionModel extends AbstractViewContainer { + tracksById: Record jbrowse: IAnyStateTreeNode drawerPosition?: string configuration: AnyConfigurationModel @@ -294,9 +295,11 @@ export function isViewModel(thing: unknown): thing is AbstractViewModel { ) } +type Display = { displayId: string } & AnyConfigurationModel + export interface AbstractTrackModel { displays: AbstractDisplayModel[] - configuration: AnyConfigurationModel + configuration: AnyConfigurationModel & { displays: Display[] } } export function isTrackModel(thing: unknown): thing is AbstractTrackModel { diff --git a/packages/product-core/src/Session/Tracks.ts b/packages/product-core/src/Session/Tracks.ts index ec44798bb7..a4539b7167 100644 --- a/packages/product-core/src/Session/Tracks.ts +++ b/packages/product-core/src/Session/Tracks.ts @@ -30,6 +30,13 @@ export function TracksManagerSessionMixin(pluginManager: PluginManager) { get tracks(): AnyConfigurationModel[] { return self.jbrowse.tracks }, + + /** + * #getter + */ + get tracksById(): Record { + return Object.fromEntries(this.tracks.map(t => [t.trackId, t])) + }, })) .actions(self => ({ /** diff --git a/packages/product-core/src/ui/AboutDialog.tsx b/packages/product-core/src/ui/AboutDialog.tsx index 46c8158e7e..18398db5fb 100644 --- a/packages/product-core/src/ui/AboutDialog.tsx +++ b/packages/product-core/src/ui/AboutDialog.tsx @@ -1,19 +1,22 @@ import Dialog from '@jbrowse/core/ui/Dialog' -import { getEnv, getSession } from '@jbrowse/core/util' +import { getEnv } from '@jbrowse/core/util' import { getTrackName } from '@jbrowse/core/util/tracks' +// locals import AboutContents from './AboutDialogContents' import type { AnyConfigurationModel } from '@jbrowse/core/configuration' +import type { AbstractSessionModel } from '@jbrowse/core/util' export function AboutDialog({ config, + session, handleClose, }: { config: AnyConfigurationModel + session: AbstractSessionModel handleClose: () => void }) { - const session = getSession(config) const trackName = getTrackName(config, session) const { pluginManager } = getEnv(session) @@ -21,11 +24,14 @@ export function AboutDialog({ 'Core-replaceAbout', AboutContents, { session, config }, - ) as React.FC + ) as React.FC<{ + config: AnyConfigurationModel + session: AbstractSessionModel + }> return ( - + ) } diff --git a/packages/product-core/src/ui/AboutDialogContents.tsx b/packages/product-core/src/ui/AboutDialogContents.tsx index f9dc57cb85..2b4eb10032 100644 --- a/packages/product-core/src/ui/AboutDialogContents.tsx +++ b/packages/product-core/src/ui/AboutDialogContents.tsx @@ -3,16 +3,20 @@ import { useState } from 'react' import Attributes from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attributes' import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard' import { getConf, readConfObject } from '@jbrowse/core/configuration' -import { getEnv, getSession } from '@jbrowse/core/util' +import { getEnv } from '@jbrowse/core/util' import { Button } from '@mui/material' import copy from 'copy-to-clipboard' import { observer } from 'mobx-react' +import { isStateTreeNode } from 'mobx-state-tree' import { makeStyles } from 'tss-react/mui' import FileInfoPanel from './FileInfoPanel' import RefNameInfoDialog from './RefNameInfoDialog' import type { AnyConfigurationModel } from '@jbrowse/core/configuration' +import type { AbstractSessionModel } from '@jbrowse/core/util' + +// locals const useStyles = makeStyles()({ content: { @@ -36,12 +40,13 @@ function removeAttr(obj: Record, attr: string) { const AboutDialogContents = observer(function ({ config, + session, }: { config: AnyConfigurationModel + session: AbstractSessionModel }) { const [copied, setCopied] = useState(false) - const conf = readConfObject(config) - const session = getSession(config) + const conf = isStateTreeNode(config) ? readConfObject(config) : config const { classes } = useStyles() const [showRefNames, setShowRefNames] = useState(false) @@ -120,9 +125,10 @@ const AboutDialogContents = observer(function ({ ) : null} - + {showRefNames ? ( { setShowRefNames(false) diff --git a/packages/product-core/src/ui/FileInfoPanel.tsx b/packages/product-core/src/ui/FileInfoPanel.tsx index 956cab329e..df45aa7ed5 100644 --- a/packages/product-core/src/ui/FileInfoPanel.tsx +++ b/packages/product-core/src/ui/FileInfoPanel.tsx @@ -4,20 +4,21 @@ import Attributes from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attrib import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard' import { readConfObject } from '@jbrowse/core/configuration' import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui' -import { getSession } from '@jbrowse/core/util' import type { AnyConfigurationModel } from '@jbrowse/core/configuration' +import type { AbstractSessionModel } from '@jbrowse/core/util' type FileInfo = Record | string export default function FileInfoPanel({ config, + session, }: { config: AnyConfigurationModel + session: AbstractSessionModel }) { const [error, setError] = useState() const [info, setInfo] = useState() - const session = getSession(config) const { rpcManager } = session useEffect(() => { diff --git a/packages/product-core/src/ui/RefNameInfoDialog.tsx b/packages/product-core/src/ui/RefNameInfoDialog.tsx index ab0fa5f676..5858b0971e 100644 --- a/packages/product-core/src/ui/RefNameInfoDialog.tsx +++ b/packages/product-core/src/ui/RefNameInfoDialog.tsx @@ -2,7 +2,6 @@ import { useEffect, useState } from 'react' import { readConfObject } from '@jbrowse/core/configuration' import { Dialog, ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui' -import { getSession } from '@jbrowse/core/util' import { getConfAssemblyNames } from '@jbrowse/core/util/tracks' import { Button, DialogContent } from '@mui/material' import copy from 'copy-to-clipboard' @@ -10,6 +9,7 @@ import { observer } from 'mobx-react' import { makeStyles } from 'tss-react/mui' import type { AnyConfigurationModel } from '@jbrowse/core/configuration' +import type { AbstractSessionModel } from '@jbrowse/core/util' const MAX_REF_NAMES = 10_000 @@ -27,16 +27,18 @@ const useStyles = makeStyles()(theme => ({ const RefNameInfoDialog = observer(function ({ config, + session, onClose, }: { config: AnyConfigurationModel + session: AbstractSessionModel onClose: () => void }) { const { classes } = useStyles() const [error, setError] = useState() const [refNames, setRefNames] = useState>() const [copied, setCopied] = useState(false) - const { rpcManager } = getSession(config) + const { rpcManager } = session useEffect(() => { // eslint-disable-next-line @typescript-eslint/no-floating-promises diff --git a/packages/web-core/src/BaseWebSession/index.ts b/packages/web-core/src/BaseWebSession/index.ts index f44e48ca76..08fe2801d4 100644 --- a/packages/web-core/src/BaseWebSession/index.ts +++ b/packages/web-core/src/BaseWebSession/index.ts @@ -120,6 +120,12 @@ export function BaseWebSession({ task: undefined, })) .views(self => ({ + /** + * #getter + */ + get tracksById(): Record { + return Object.fromEntries(this.tracks.map(t => [t.trackId, t])) + }, /** * #getter */ @@ -368,6 +374,7 @@ export function BaseWebSession({ { config, handleClose, + session: self, }, ]) }, diff --git a/plugins/circular-view/src/CircularView/model.ts b/plugins/circular-view/src/CircularView/model.ts index 0d45ab8b8a..0cd3bffc41 100644 --- a/plugins/circular-view/src/CircularView/model.ts +++ b/plugins/circular-view/src/CircularView/model.ts @@ -9,11 +9,15 @@ import { getSession, isSessionModelWithWidgets, } from '@jbrowse/core/util' +import { + hideTrackGeneric, + showTrackGeneric, + toggleTrackGeneric, +} from '@jbrowse/core/util/tracks' import FolderOpenIcon from '@mui/icons-material/FolderOpen' import PhotoCameraIcon from '@mui/icons-material/PhotoCamera' import { saveAs } from 'file-saver' -import { transaction } from 'mobx' -import { cast, getRoot, resolveIdentifier, types } from 'mobx-state-tree' +import { cast, types } from 'mobx-state-tree' import { calculateStaticSlices, sliceIsVisible } from './slices' import { viewportVisibleSection } from './viewportVisibleRegion' @@ -481,12 +485,7 @@ function stateModelFactory(pluginManager: PluginManager) { * #action */ toggleTrack(trackId: string) { - const hiddenCount = this.hideTrack(trackId) - if (!hiddenCount) { - this.showTrack(trackId) - return true - } - return false + toggleTrackGeneric(self, trackId) }, /** @@ -500,26 +499,7 @@ function stateModelFactory(pluginManager: PluginManager) { * #action */ showTrack(trackId: string, initialSnapshot = {}) { - const schema = pluginManager.pluggableConfigSchemaType('track') - const conf = resolveIdentifier(schema, getRoot(self), trackId) - const trackType = pluginManager.getTrackType(conf.type) - if (!trackType) { - throw new Error(`unknown track type ${conf.type}`) - } - const viewType = pluginManager.getViewType(self.type)! - const supportedDisplays = new Set( - viewType.displayTypes.map(d => d.name), - ) - const displayConf = conf.displays.find((d: AnyConfigurationModel) => - supportedDisplays.has(d.type), - ) - const track = trackType.stateModel.create({ - ...initialSnapshot, - type: conf.type, - configuration: conf, - displays: [{ type: displayConf.type, configuration: displayConf }], - }) - self.tracks.push(track) + showTrackGeneric(self, trackId, initialSnapshot) }, /** @@ -554,13 +534,7 @@ function stateModelFactory(pluginManager: PluginManager) { * #action */ hideTrack(trackId: string) { - const schema = pluginManager.pluggableConfigSchemaType('track') - const conf = resolveIdentifier(schema, getRoot(self), trackId) - const t = self.tracks.filter(t => t.configuration === conf) - transaction(() => { - t.forEach(t => self.tracks.remove(t)) - }) - return t.length + hideTrackGeneric(self, trackId) }, /** diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap index c5280685f2..e68887360b 100644 --- a/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/__snapshots__/HierarchicalTrackSelector.test.tsx.snap @@ -44,16 +44,6 @@ exports[`localstorage preference - sorting categories 1`] = ` exports[`localstorage preference - sorting track names 1`] = ` [ - "1 toplevel", - "10 toplevel", - "2 toplevel", - "3 toplevel", - "4 toplevel", - "5 toplevel", - "6 toplevel", - "7 toplevel", - "8 toplevel", - "9 toplevel", "1 cat1", "10 cat1", "2 cat1", @@ -84,6 +74,16 @@ exports[`localstorage preference - sorting track names 1`] = ` "3 cat3 cat4", "4 cat3 cat4", "5 cat3 cat4", + "1 toplevel", + "10 toplevel", + "2 toplevel", + "3 toplevel", + "4 toplevel", + "5 toplevel", + "6 toplevel", + "7 toplevel", + "8 toplevel", + "9 toplevel", ] `; diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.tsx b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.tsx index 2c82f9b74c..440ec545ce 100644 --- a/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.tsx +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/tree/TrackLabel.tsx @@ -44,7 +44,7 @@ export default function TrackLabel({ data }: { data: NodeData }) { selected, onChange, } = data - const description = readConfObject(conf, 'description') + const description = readConfObject(conf, 'description') || '' return ( <> ({ display: 'flex', paddingLeft: 5, }, + wrapper: { + whiteSpace: 'nowrap', + width: '100%', + }, })) // An individual node in the track selector. Note: manually sets cursor: @@ -48,8 +52,7 @@ export default function Node({ setOpen: (arg: boolean) => void }) { const { isLeaf, nestingLevel } = data - - const { classes } = useStyles() + const { classes, cx } = useStyles() const width = 10 const marginLeft = nestingLevel * width + (isLeaf ? width : 0) @@ -64,12 +67,11 @@ export default function Node({ /> ))}
{!isLeaf ? ( diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/tree/util.ts b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/tree/util.ts new file mode 100644 index 0000000000..6aeed9f550 --- /dev/null +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/components/tree/util.ts @@ -0,0 +1,45 @@ +// locals +import type { TreeNode } from '../../generateHierarchy' +import type { HierarchicalTrackSelectorModel } from '../../model' +import type { AnyConfigurationModel } from '@jbrowse/core/configuration' + +export function getNodeData( + node: TreeNode, + nestingLevel: number, + extra: Record, + selection: Record, +) { + const isLeaf = node.type === 'track' + const selected = isLeaf ? selection[node.trackId] : false + return { + data: { + defaultHeight: isLeaf ? 22 : 40, + isLeaf, + isOpenByDefault: true, + nestingLevel, + selected, + ...node, + ...extra, + }, + nestingLevel, + node, + } +} + +export interface NodeData { + nestingLevel: number + checked: boolean + conf: AnyConfigurationModel + drawerPosition: unknown + id: string + isLeaf: boolean + name: string + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + onChange: Function + toggleCollapse: (arg: string) => void + tree: TreeNode + selected: boolean + model: HierarchicalTrackSelectorModel +} + +export type NodeEntry = ReturnType diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedModel.ts b/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedModel.ts index 61f636d73a..e0d8f2231c 100644 --- a/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedModel.ts +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedModel.ts @@ -143,10 +143,7 @@ export function facetedStateTreeF() { ) as string, adapter: readConfObject(track, 'adapter')?.type as string, description: readConfObject(track, 'description') as string, - metadata: readConfObject(track, 'metadata') as Record< - string, - unknown - >, + metadata: (track.metadata || {}) as Record, }) as const, ) }, diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedUtil.ts b/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedUtil.ts index cdc7e1a587..0be7fe8986 100644 --- a/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedUtil.ts +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedUtil.ts @@ -9,5 +9,5 @@ export function findNonSparseKeys( export function getRootKeys(obj: Record) { return Object.entries(obj) .map(([key, val]) => (typeof val === 'string' ? key : '')) - .filter(f => !!f) + .filter((f): f is string => !!f) } diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/filterTracks.ts b/plugins/data-management/src/HierarchicalTrackSelectorWidget/filterTracks.ts index cdd1682cbd..a537c62e72 100644 --- a/plugins/data-management/src/HierarchicalTrackSelectorWidget/filterTracks.ts +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/filterTracks.ts @@ -25,6 +25,8 @@ export function filterTracks( const trackListAssemblies = self.assemblyNames .map(a => assemblyManager.get(a)) .filter(notEmpty) + const { displayTypes } = pluginManager.getViewType(view.type)! + const viewDisplays = displayTypes.map((d: { name: string }) => d.name) return tracks .filter(c => { const trackAssemblyNames = readConfObject(c, 'assemblyNames') as @@ -37,10 +39,10 @@ export function filterTracks( ? hasAnyOverlap(trackAssemblies, trackListAssemblies) : hasAllOverlap(trackAssemblies, trackListAssemblies) }) - .filter(c => { - const { displayTypes } = pluginManager.getViewType(view.type)! - const compatDisplays = displayTypes.map(d => d.name) - const trackDisplays = c.displays.map((d: { type: string }) => d.type) - return hasAnyOverlap(compatDisplays, trackDisplays) + + .filter(conf => { + const trackType = pluginManager.getTrackType(conf.type)! + const trackDisplays = trackType.displayTypes.map(d => d.name) + return hasAnyOverlap(viewDisplays, trackDisplays) }) } diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/generateHierarchy.ts b/plugins/data-management/src/HierarchicalTrackSelectorWidget/generateHierarchy.ts index 046d1e8fc8..0847dfce64 100644 --- a/plugins/data-management/src/HierarchicalTrackSelectorWidget/generateHierarchy.ts +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/generateHierarchy.ts @@ -74,7 +74,9 @@ export function generateHierarchy({ activeSortCategories: boolean collapsed: Map view?: { - tracks: { configuration: AnyConfigurationModel }[] + tracks: { + configuration: AnyConfigurationModel + }[] } } noCategories?: boolean @@ -94,8 +96,8 @@ export function generateHierarchy({ return [] } const session = getSession(model) - const viewTracks = view.tracks const confs = trackConfs.filter(conf => matches(filterText, conf, session)) + const viewTrackIds = new Set(view.tracks.map(f => f.configuration.trackId)) // uses getConf for (const conf of sortConfs( @@ -139,17 +141,14 @@ export function generateHierarchy({ } } - // uses splice to try to put all leaf nodes above "category nodes" if you - // change the splice to a simple push and open - // test_data/test_order/config.json you will see the weirdness - const r = currLevel.children.findIndex(elt => elt.children.length) - const idx = r === -1 ? currLevel.children.length : r + const r = currLevel.children.findLastIndex(elt => !elt.children.length) + const idx = r === -1 ? currLevel.children.length : r + 1 currLevel.children.splice(idx, 0, { id: [extra, conf.trackId].filter(f => !!f).join(','), trackId: conf.trackId, name: getTrackName(conf, session), conf, - checked: viewTracks.some(f => f.configuration === conf), + checked: viewTrackIds.has(conf.trackId), children: [], type: 'track' as const, }) diff --git a/plugins/dotplot-view/src/DotplotView/model.ts b/plugins/dotplot-view/src/DotplotView/model.ts index 8db403a148..33134aafb3 100644 --- a/plugins/dotplot-view/src/DotplotView/model.ts +++ b/plugins/dotplot-view/src/DotplotView/model.ts @@ -14,7 +14,12 @@ import { measureText, minmax, } from '@jbrowse/core/util' -import { getParentRenderProps } from '@jbrowse/core/util/tracks' +import { + getParentRenderProps, + hideTrackGeneric, + showTrackGeneric, + toggleTrackGeneric, +} from '@jbrowse/core/util/tracks' import { ElementId } from '@jbrowse/core/util/types/mst' import FolderOpenIcon from '@mui/icons-material/FolderOpen' import PhotoCameraIcon from '@mui/icons-material/PhotoCamera' @@ -24,9 +29,7 @@ import { addDisposer, cast, getParent, - getRoot, getSnapshot, - resolveIdentifier, types, } from 'mobx-state-tree' @@ -418,52 +421,20 @@ export default function stateModelFactory(pm: PluginManager) { * #action */ showTrack(trackId: string, initialSnapshot = {}) { - const schema = pm.pluggableConfigSchemaType('track') - const conf = resolveIdentifier(schema, getRoot(self), trackId) - const trackType = pm.getTrackType(conf.type) - if (!trackType) { - throw new Error(`unknown track type ${conf.type}`) - } - const viewType = pm.getViewType(self.type)! - const displayConf = conf.displays.find((d: AnyConfigurationModel) => - viewType.displayTypes.find(type => type.name === d.type), - ) - if (!displayConf) { - throw new Error( - `could not find a compatible display for view type ${self.type}`, - ) - } - const track = trackType.stateModel.create({ - ...initialSnapshot, - type: conf.type, - configuration: conf, - displays: [{ type: displayConf.type, configuration: displayConf }], - }) - self.tracks.push(track) + return showTrackGeneric(self, trackId, initialSnapshot) }, /** * #action */ hideTrack(trackId: string) { - const schema = pm.pluggableConfigSchemaType('track') - const conf = resolveIdentifier(schema, getRoot(self), trackId) - const t = self.tracks.filter(t => t.configuration === conf) - transaction(() => { - t.forEach(t => self.tracks.remove(t)) - }) - return t.length + return hideTrackGeneric(self, trackId) }, /** * #action */ toggleTrack(trackId: string) { - const hiddenCount = this.hideTrack(trackId) - if (!hiddenCount) { - this.showTrack(trackId) - return true - } - return false + toggleTrackGeneric(self, trackId) }, /** * #action diff --git a/plugins/linear-comparative-view/src/LinearSyntenyViewHelper/stateModelFactory.ts b/plugins/linear-comparative-view/src/LinearSyntenyViewHelper/stateModelFactory.ts index a4e922cbf7..01682cd44b 100644 --- a/plugins/linear-comparative-view/src/LinearSyntenyViewHelper/stateModelFactory.ts +++ b/plugins/linear-comparative-view/src/LinearSyntenyViewHelper/stateModelFactory.ts @@ -1,11 +1,14 @@ import { ElementId } from '@jbrowse/core/util/types/mst' -import { transaction } from 'mobx' -import { getParent, getRoot, resolveIdentifier, types } from 'mobx-state-tree' +import { getParent, types } from 'mobx-state-tree' import type PluginManager from '@jbrowse/core/PluginManager' -import type { AnyConfigurationModel } from '@jbrowse/core/configuration' import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view' import type { Instance } from 'mobx-state-tree' +import { + hideTrackGeneric, + showTrackGeneric, + toggleTrackGeneric, +} from '@jbrowse/core/util/tracks' export function linearSyntenyViewHelperModelFactory( pluginManager: PluginManager, @@ -48,67 +51,20 @@ export function linearSyntenyViewHelperModelFactory( * #action */ showTrack(trackId: string, initialSnapshot = {}) { - const schema = pluginManager.pluggableConfigSchemaType('track') - const configuration = resolveIdentifier(schema, getRoot(self), trackId) - if (!configuration) { - throw new Error(`track not found ${trackId}`) - } - const trackType = pluginManager.getTrackType(configuration.type) - if (!trackType) { - throw new Error(`unknown track type ${configuration.type}`) - } - const viewType = pluginManager.getViewType(self.type)! - const supportedDisplays = new Set( - viewType.displayTypes.map(d => d.name), - ) - const displayConf = configuration.displays.find( - (d: AnyConfigurationModel) => supportedDisplays.has(d.type), - ) - if (!displayConf) { - throw new Error( - `could not find a compatible display for view type ${self.type}`, - ) - } - - self.tracks.push( - trackType.stateModel.create({ - ...initialSnapshot, - type: configuration.type, - configuration, - displays: [ - { - type: displayConf.type, - configuration: displayConf, - }, - ], - }), - ) + return showTrackGeneric(self, trackId, initialSnapshot) }, /** * #action */ hideTrack(trackId: string) { - const schema = pluginManager.pluggableConfigSchemaType('track') - const config = resolveIdentifier(schema, getRoot(self), trackId) - const shownTracks = self.tracks.filter(t => t.configuration === config) - transaction(() => { - shownTracks.forEach(t => { - self.tracks.remove(t) - }) - }) - return shownTracks.length + return hideTrackGeneric(self, trackId) }, /** * #action */ toggleTrack(trackId: string) { - const hiddenCount = this.hideTrack(trackId) - if (!hiddenCount) { - this.showTrack(trackId) - return true - } - return false + toggleTrackGeneric(self, trackId) }, })) .views(self => ({ diff --git a/plugins/linear-genome-view/src/LinearGenomeView/model.ts b/plugins/linear-genome-view/src/LinearGenomeView/model.ts index becf98703c..df9f504f55 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/model.ts +++ b/plugins/linear-genome-view/src/LinearGenomeView/model.ts @@ -22,7 +22,12 @@ import { bpToPx, moveTo, pxToBp } from '@jbrowse/core/util/Base1DUtils' import Base1DView from '@jbrowse/core/util/Base1DViewModel' import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks' import calculateStaticBlocks from '@jbrowse/core/util/calculateStaticBlocks' -import { getParentRenderProps } from '@jbrowse/core/util/tracks' +import { + getParentRenderProps, + hideTrackGeneric, + showTrackGeneric, + toggleTrackGeneric, +} from '@jbrowse/core/util/tracks' import { ElementId } from '@jbrowse/core/util/types/mst' import FolderOpenIcon from '@mui/icons-material/FolderOpen' import LabelIcon from '@mui/icons-material/Label' @@ -34,14 +39,12 @@ import SyncAltIcon from '@mui/icons-material/SyncAlt' import VisibilityIcon from '@mui/icons-material/Visibility' import ZoomInIcon from '@mui/icons-material/ZoomIn' import { saveAs } from 'file-saver' -import { autorun, transaction, when } from 'mobx' +import { autorun, when } from 'mobx' import { addDisposer, cast, getParent, - getRoot, getSnapshot, - resolveIdentifier, types, } from 'mobx-state-tree' @@ -70,7 +73,6 @@ import type { import type PluginManager from '@jbrowse/core/PluginManager' import type BaseResult from '@jbrowse/core/TextSearch/BaseResults' import type { Assembly } from '@jbrowse/core/assemblyManager/assembly' -import type { AnyConfigurationModel } from '@jbrowse/core/configuration' import type { MenuItem } from '@jbrowse/core/ui' import type { ParsedLocString } from '@jbrowse/core/util' import type { BaseBlock, BlockSet } from '@jbrowse/core/util/blockTypes' @@ -741,58 +743,18 @@ export function stateModelFactory(pluginManager: PluginManager) { initialSnapshot = {}, displayInitialSnapshot = {}, ) { - const schema = pluginManager.pluggableConfigSchemaType('track') - const conf = resolveIdentifier(schema, getRoot(self), trackId) - if (!conf) { - throw new Error(`Could not resolve identifier "${trackId}"`) - } - const trackType = pluginManager.getTrackType(conf?.type) - if (!trackType) { - throw new Error(`Unknown track type ${conf.type}`) - } - const viewType = pluginManager.getViewType(self.type)! - const supportedDisplays = new Set( - viewType.displayTypes.map(d => d.name), - ) - const displayConf = conf.displays.find((d: AnyConfigurationModel) => - supportedDisplays.has(d.type), + return showTrackGeneric( + self, + trackId, + initialSnapshot, + displayInitialSnapshot, ) - if (!displayConf) { - throw new Error( - `Could not find a compatible display for view type ${self.type}`, - ) - } - - const t = self.tracks.filter(t => t.configuration === conf) - if (t.length === 0) { - const track = trackType.stateModel.create({ - ...initialSnapshot, - type: conf.type, - configuration: conf, - displays: [ - { - type: displayConf.type, - configuration: displayConf, - ...displayInitialSnapshot, - }, - ], - }) - self.tracks.push(track) - return track - } - return t[0] }, /** * #action */ hideTrack(trackId: string) { - const schema = pluginManager.pluggableConfigSchemaType('track') - const conf = resolveIdentifier(schema, getRoot(self), trackId) - const t = self.tracks.filter(t => t.configuration === conf) - transaction(() => { - t.forEach(t => self.tracks.remove(t)) - }) - return t.length + return hideTrackGeneric(self, trackId) }, })) .actions(self => ({ @@ -860,14 +822,7 @@ export function stateModelFactory(pluginManager: PluginManager) { * #action */ toggleTrack(trackId: string) { - // if we have any tracks with that configuration, turn them off - const hiddenCount = self.hideTrack(trackId) - // if none had that configuration, turn one on - if (!hiddenCount) { - self.showTrack(trackId) - return true - } - return false + toggleTrackGeneric(self, trackId) }, /** diff --git a/plugins/sv-inspector/src/SvInspectorView/model.ts b/plugins/sv-inspector/src/SvInspectorView/model.ts index c12ff4e8d9..297d546318 100644 --- a/plugins/sv-inspector/src/SvInspectorView/model.ts +++ b/plugins/sv-inspector/src/SvInspectorView/model.ts @@ -332,9 +332,9 @@ function SvInspectorViewF(pluginManager: PluginManager) { const { assemblyName, generatedTrackConf } = data const { circularView } = self // hide any visible tracks - circularView.tracks.forEach(t => - circularView.hideTrack(t.configuration.trackId), - ) + circularView.tracks.forEach(t => { + circularView.hideTrack(t.configuration.trackId) + }) // put our track in as the only track if (assemblyName) { diff --git a/products/jbrowse-desktop/src/jbrowseModel.ts b/products/jbrowse-desktop/src/jbrowseModel.ts index 5daf14bdce..2013040a89 100644 --- a/products/jbrowse-desktop/src/jbrowseModel.ts +++ b/products/jbrowse-desktop/src/jbrowseModel.ts @@ -18,6 +18,7 @@ window.resolveIdentifier = resolveIdentifier export default function JBrowseDesktop( pluginManager: PluginManager, assemblyConfigSchema: BaseAssemblyConfigSchema, + adminMode = true, ) { - return JBrowseModelF({ pluginManager, assemblyConfigSchema }) + return JBrowseModelF({ pluginManager, assemblyConfigSchema, adminMode }) } diff --git a/products/jbrowse-react-app/src/jbrowseModel.ts b/products/jbrowse-react-app/src/jbrowseModel.ts index 54c9706a60..5218f3fb41 100644 --- a/products/jbrowse-react-app/src/jbrowseModel.ts +++ b/products/jbrowse-react-app/src/jbrowseModel.ts @@ -11,9 +11,11 @@ import type { AnyConfigurationSchemaType } from '@jbrowse/core/configuration' export default function JBrowseWeb({ pluginManager, assemblyConfigSchema, + adminMode = false, }: { pluginManager: PluginManager assemblyConfigSchema: AnyConfigurationSchemaType + adminMode?: boolean }) { - return JBrowseModelF({ pluginManager, assemblyConfigSchema }) + return JBrowseModelF({ pluginManager, assemblyConfigSchema, adminMode }) } diff --git a/products/jbrowse-web/src/jbrowseModel.test.ts b/products/jbrowse-web/src/jbrowseModel.test.ts index 1160387d7b..71dcf4062c 100644 --- a/products/jbrowse-web/src/jbrowseModel.test.ts +++ b/products/jbrowse-web/src/jbrowseModel.test.ts @@ -16,6 +16,7 @@ describe('JBrowse model', () => { .configure() JBrowseModel = jbrowseModelFactory({ + adminMode: false, pluginManager, assemblyConfigSchema: assemblyConfigSchemasFactory(pluginManager), }) diff --git a/products/jbrowse-web/src/jbrowseModel.ts b/products/jbrowse-web/src/jbrowseModel.ts index 69f2b44f7b..55e3d57c1b 100644 --- a/products/jbrowse-web/src/jbrowseModel.ts +++ b/products/jbrowse-web/src/jbrowseModel.ts @@ -20,12 +20,18 @@ window.resolveIdentifier = resolveIdentifier export default function JBrowseWeb({ pluginManager, assemblyConfigSchema, + adminMode, }: { pluginManager: PluginManager assemblyConfigSchema: AnyConfigurationSchemaType + adminMode: boolean }) { return types.snapshotProcessor( - JBrowseModelF({ pluginManager, assemblyConfigSchema }), + JBrowseModelF({ + pluginManager, + assemblyConfigSchema, + adminMode, + }), { postProcessor(snapshot: Record) { return removeAttr(structuredClone(snapshot), 'baseUri') diff --git a/products/jbrowse-web/src/rootModel/__snapshots__/rootModel.test.ts.snap b/products/jbrowse-web/src/rootModel/__snapshots__/rootModel.test.ts.snap index eefb969dab..3b3c80f07c 100644 --- a/products/jbrowse-web/src/rootModel/__snapshots__/rootModel.test.ts.snap +++ b/products/jbrowse-web/src/rootModel/__snapshots__/rootModel.test.ts.snap @@ -404,16 +404,6 @@ exports[`adds track and connection configs to an assembly 1`] = ` exports[`adds track and connection configs to an assembly 2`] = ` { - "displays": [ - { - "displayId": "trackId0-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "trackId0-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "trackId": "trackId0", "type": "FeatureTrack", } diff --git a/products/jbrowse-web/src/rootModel/rootModel.ts b/products/jbrowse-web/src/rootModel/rootModel.ts index 08dfe46b5a..ccb887d2cd 100644 --- a/products/jbrowse-web/src/rootModel/rootModel.ts +++ b/products/jbrowse-web/src/rootModel/rootModel.ts @@ -86,6 +86,7 @@ export default function RootModel({ }) { const assemblyConfigSchema = assemblyConfigSchemaFactory(pluginManager) const jbrowseModelType = jbrowseWebFactory({ + adminMode, pluginManager, assemblyConfigSchema, }) From 15064c987ffb179fb85e1cb035bc052fbcdc47ff Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 9 Dec 2024 16:45:45 -0500 Subject: [PATCH 2/2] Update snaps --- packages/web-core/src/BaseWebSession/index.ts | 14 +- .../facetedModel.ts | 2 +- .../stateModelFactory.ts | 10 +- .../src/rootModel/rootModel.test.ts | 2 +- .../__snapshots__/rootModel.test.ts.snap | 10 - .../src/rootModel/rootModel.test.ts | 2 +- .../__snapshots__/jbrowseModel.test.ts.snap | 1389 +---------------- .../src/rootModel/rootModel.test.ts | 2 +- .../jbrowse-web/src/tests/Loader.test.tsx | 7 - 9 files changed, 33 insertions(+), 1405 deletions(-) diff --git a/packages/web-core/src/BaseWebSession/index.ts b/packages/web-core/src/BaseWebSession/index.ts index 08fe2801d4..c519c3a3e5 100644 --- a/packages/web-core/src/BaseWebSession/index.ts +++ b/packages/web-core/src/BaseWebSession/index.ts @@ -21,13 +21,7 @@ import CopyIcon from '@mui/icons-material/FileCopy' import InfoIcon from '@mui/icons-material/Info' import SettingsIcon from '@mui/icons-material/Settings' import { autorun } from 'mobx' -import { - addDisposer, - cast, - getParent, - getSnapshot, - types, -} from 'mobx-state-tree' +import { addDisposer, cast, getParent, types } from 'mobx-state-tree' import { WebSessionConnectionsMixin } from '../SessionConnections' @@ -403,13 +397,13 @@ export function BaseWebSession({ priority: 999, disabled: isRefSeq, onClick: () => { - const snap = structuredClone(getSnapshot(config)) as { + const snap = structuredClone(config) as { [key: string]: unknown - displays: Display[] + displays?: Display[] } const now = Date.now() snap.trackId += `-${now}` - snap.displays.forEach(display => { + snap.displays?.forEach(display => { display.displayId += `-${now}` }) // the -sessionTrack suffix to trackId is used as metadata for diff --git a/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedModel.ts b/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedModel.ts index e0d8f2231c..fdd2f12bd7 100644 --- a/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedModel.ts +++ b/plugins/data-management/src/HierarchicalTrackSelectorWidget/facetedModel.ts @@ -143,7 +143,7 @@ export function facetedStateTreeF() { ) as string, adapter: readConfObject(track, 'adapter')?.type as string, description: readConfObject(track, 'description') as string, - metadata: (track.metadata || {}) as Record, + metadata: (track.metadata || {}) as Record, }) as const, ) }, diff --git a/plugins/linear-comparative-view/src/LinearSyntenyViewHelper/stateModelFactory.ts b/plugins/linear-comparative-view/src/LinearSyntenyViewHelper/stateModelFactory.ts index 01682cd44b..b01c063520 100644 --- a/plugins/linear-comparative-view/src/LinearSyntenyViewHelper/stateModelFactory.ts +++ b/plugins/linear-comparative-view/src/LinearSyntenyViewHelper/stateModelFactory.ts @@ -1,14 +1,14 @@ +import { + hideTrackGeneric, + showTrackGeneric, + toggleTrackGeneric, +} from '@jbrowse/core/util/tracks' import { ElementId } from '@jbrowse/core/util/types/mst' import { getParent, types } from 'mobx-state-tree' import type PluginManager from '@jbrowse/core/PluginManager' import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view' import type { Instance } from 'mobx-state-tree' -import { - hideTrackGeneric, - showTrackGeneric, - toggleTrackGeneric, -} from '@jbrowse/core/util/tracks' export function linearSyntenyViewHelperModelFactory( pluginManager: PluginManager, diff --git a/products/jbrowse-desktop/src/rootModel/rootModel.test.ts b/products/jbrowse-desktop/src/rootModel/rootModel.test.ts index 1c3624833e..b68d3d8439 100644 --- a/products/jbrowse-desktop/src/rootModel/rootModel.test.ts +++ b/products/jbrowse-desktop/src/rootModel/rootModel.test.ts @@ -103,7 +103,7 @@ test('adds track and connection configs to an assembly', () => { type: 'FeatureTrack', trackId: 'trackId0', }) - expect(getSnapshot(newTrackConf)).toMatchSnapshot() + expect(newTrackConf).toMatchSnapshot() expect(root.jbrowse.tracks.length).toBe(1) const newConnectionConf = root.jbrowse.addConnectionConf({ type: 'JBrowse1Connection', diff --git a/products/jbrowse-react-app/src/rootModel/__snapshots__/rootModel.test.ts.snap b/products/jbrowse-react-app/src/rootModel/__snapshots__/rootModel.test.ts.snap index 702c570dd6..616ff61c4f 100644 --- a/products/jbrowse-react-app/src/rootModel/__snapshots__/rootModel.test.ts.snap +++ b/products/jbrowse-react-app/src/rootModel/__snapshots__/rootModel.test.ts.snap @@ -216,16 +216,6 @@ exports[`adds track and connection configs to an assembly 1`] = ` exports[`adds track and connection configs to an assembly 2`] = ` { - "displays": [ - { - "displayId": "trackId0-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "trackId0-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "trackId": "trackId0", "type": "FeatureTrack", } diff --git a/products/jbrowse-react-app/src/rootModel/rootModel.test.ts b/products/jbrowse-react-app/src/rootModel/rootModel.test.ts index 2a9bc923db..aa5b33c55a 100644 --- a/products/jbrowse-react-app/src/rootModel/rootModel.test.ts +++ b/products/jbrowse-react-app/src/rootModel/rootModel.test.ts @@ -99,7 +99,7 @@ test('adds track and connection configs to an assembly', () => { type: 'FeatureTrack', trackId: 'trackId0', }) - expect(getSnapshot(newTrackConf)).toMatchSnapshot() + expect(newTrackConf).toMatchSnapshot() expect(root.jbrowse.tracks.length).toBe(1) const newConnectionConf = root.jbrowse.addConnectionConf({ type: 'JBrowse1Connection', diff --git a/products/jbrowse-web/src/__snapshots__/jbrowseModel.test.ts.snap b/products/jbrowse-web/src/__snapshots__/jbrowseModel.test.ts.snap index b9f5ae2e69..a5408f28b0 100644 --- a/products/jbrowse-web/src/__snapshots__/jbrowseModel.test.ts.snap +++ b/products/jbrowse-web/src/__snapshots__/jbrowseModel.test.ts.snap @@ -455,10 +455,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "tracks": [ { "adapter": { - "chromSizesLocation": { - "locationType": "UriLocation", - "uri": "/path/to/default.chrom.sizes", - }, "twoBitLocation": { "locationType": "UriLocation", "uri": "volvox.2bit", @@ -468,12 +464,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "assemblyNames": [ "volvox", ], - "displays": [ - { - "displayId": "volvox_gc-LinearGCContentTrackDisplay", - "type": "LinearGCContentTrackDisplay", - }, - ], "name": "GCContent", "trackId": "volvox_gc", "type": "GCContentTrack", @@ -486,10 +476,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "volvox.dup.vcf.gz.tbi", }, }, - "samplesTsvLocation": { - "locationType": "UriLocation", - "uri": "/path/to/samples.tsv", - }, "type": "VcfTabixAdapter", "vcfGzLocation": { "locationType": "UriLocation", @@ -503,28 +489,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "Variants", ], "description": "A uniquely interesting track", - "displays": [ - { - "displayId": "volvox_sv_test-LinearVariantDisplay", - "type": "LinearVariantDisplay", - }, - { - "displayId": "volvox_sv_test-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "volvox_sv_test-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "volvox_sv_test-ChordVariantDisplay", - "type": "ChordVariantDisplay", - }, - { - "displayId": "volvox_sv_test-LinearPairedArcDisplay", - "type": "LinearPairedArcDisplay", - }, - ], "name": "volvox structural variant test (HTML italic+link)", "trackId": "volvox_sv_test", "type": "VariantTrack", @@ -537,10 +501,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "volvox.dup.renamed.vcf.gz.tbi", }, }, - "samplesTsvLocation": { - "locationType": "UriLocation", - "uri": "/path/to/samples.tsv", - }, "type": "VcfTabixAdapter", "vcfGzLocation": { "locationType": "UriLocation", @@ -553,28 +513,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Variants", ], - "displays": [ - { - "displayId": "volvox_sv_test_renamed-LinearVariantDisplay", - "type": "LinearVariantDisplay", - }, - { - "displayId": "volvox_sv_test_renamed-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "volvox_sv_test_renamed-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "volvox_sv_test_renamed-ChordVariantDisplay", - "type": "ChordVariantDisplay", - }, - { - "displayId": "volvox_sv_test_renamed-LinearPairedArcDisplay", - "type": "LinearPairedArcDisplay", - }, - ], "name": "volvox structural variant test w/renamed refs", "trackId": "volvox_sv_test_renamed", "type": "VariantTrack", @@ -604,28 +542,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "volvox_cram_alignments-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_cram_alignments-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_cram_alignments-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_cram_alignments-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_cram_alignments-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sorted.cram (contigA, default display)", "trackId": "volvox_cram_alignments", "type": "AlignmentsTrack", @@ -665,22 +581,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "height": 400, "type": "LinearPileupDisplay", }, - { - "displayId": "volvox_cram_pileup-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_cram_pileup-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_cram_pileup-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_cram_pileup-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, ], "metadata": { "description": "this is a metadata description", @@ -724,22 +624,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "displayId": "volvox_cram_snpcoverage_snpcoverage", "type": "LinearSNPCoverageDisplay", }, - { - "displayId": "volvox_cram_snpcoverage-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_cram_snpcoverage-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_cram_snpcoverage-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_cram_snpcoverage-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, ], "name": "volvox-sorted.cram (contigA, LinearSNPCoverageDisplay)", "trackId": "volvox_cram_snpcoverage", @@ -770,28 +654,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "volvox_cram_alignments_ctga-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_cram_alignments_ctga-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_cram_alignments_ctga-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_cram_alignments_ctga-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_cram_alignments_ctga-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sorted.cram (ctgA, default display)", "trackId": "volvox_cram_alignments_ctga", "type": "AlignmentsTrack", @@ -826,22 +688,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "displayId": "volvox_cram_pileup_ctga_pileup", "type": "LinearPileupDisplay", }, - { - "displayId": "volvox_cram_pileup_ctga-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_cram_pileup_ctga-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_cram_pileup_ctga-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_cram_pileup_ctga-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, ], "name": "volvox-sorted.cram (ctgA, LinearPileupDisplay)", "trackId": "volvox_cram_pileup_ctga", @@ -877,22 +723,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "displayId": "volvox_cram_pileup_ctga_snpcoverage", "type": "LinearSNPCoverageDisplay", }, - { - "displayId": "volvox_cram_snpcoverage_ctga-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_cram_snpcoverage_ctga-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_cram_snpcoverage_ctga-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_cram_snpcoverage_ctga-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, ], "name": "volvox-sorted.cram (ctgA, LinearSNPCoverageDisplay)", "trackId": "volvox_cram_snpcoverage_ctga", @@ -932,22 +762,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` }, "type": "LinearAlignmentsDisplay", }, - { - "displayId": "volvox_alignments-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_alignments-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_alignments-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_alignments-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, ], "name": "volvox-sorted.bam (ctgA, larger default height, colorBy mappingQual)", "trackId": "volvox_alignments", @@ -978,22 +792,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "displayId": "volvox_bam_snpcoverage_snpcoverage", "type": "LinearSNPCoverageDisplay", }, - { - "displayId": "volvox_bam_snpcoverage-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_bam_snpcoverage-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_bam_snpcoverage-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_bam_snpcoverage-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, ], "name": "volvox-sorted.bam (contigA LinearSNPCoverageDisplay)", "trackId": "volvox_bam_snpcoverage", @@ -1024,22 +822,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "displayId": "volvox_bam_pileup_pileup", "type": "LinearPileupDisplay", }, - { - "displayId": "volvox_bam_pileup-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_bam_pileup-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_bam_pileup-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_bam_pileup-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, ], "name": "volvox-sorted.bam (contigA LinearPileupDisplay)", "trackId": "volvox_bam_pileup", @@ -1065,28 +847,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "volvox_alignments_pileup_coverage-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_alignments_pileup_coverage-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_alignments_pileup_coverage-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_alignments_pileup_coverage-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_alignments_pileup_coverage-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sorted.bam (ctgA, canvas)", "trackId": "volvox_alignments_pileup_coverage", "type": "AlignmentsTrack", @@ -1111,28 +871,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "volvox_bam_altname-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_bam_altname-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_bam_altname-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_bam_altname-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_bam_altname-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sorted.bam (contigA)", "trackId": "volvox_bam_altname", "type": "AlignmentsTrack", @@ -1172,22 +910,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` }, "type": "LinearAlignmentsDisplay", }, - { - "displayId": "volvox_bam_small_max_height-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_bam_small_max_height-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_bam_small_max_height-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_bam_small_max_height-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, ], "name": "volvox-sorted.bam (small max height)", "trackId": "volvox_bam_small_max_height", @@ -1217,28 +939,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Variants", ], - "displays": [ - { - "displayId": "volvox_test_vcf-LinearVariantDisplay", - "type": "LinearVariantDisplay", - }, - { - "displayId": "volvox_test_vcf-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "volvox_test_vcf-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "volvox_test_vcf-ChordVariantDisplay", - "type": "ChordVariantDisplay", - }, - { - "displayId": "volvox_test_vcf-LinearPairedArcDisplay", - "type": "LinearPairedArcDisplay", - }, - ], "formatAbout": { "hideUris": true, }, @@ -1260,16 +960,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "nclist_long_names-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "nclist_long_names-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "nclist with long names/descriptions", "trackId": "nclist_long_names", "type": "FeatureTrack", @@ -1294,28 +984,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "volvox_alignments_bam_nonexist-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_alignments_bam_nonexist-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_alignments_bam_nonexist-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_alignments_bam_nonexist-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_alignments_bam_nonexist-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sorted.bam (bam nonexist 404)", "trackId": "volvox_alignments_bam_nonexist", "type": "AlignmentsTrack", @@ -1340,28 +1008,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "volvox_alignments_bai_nonexist-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_alignments_bai_nonexist-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_alignments_bai_nonexist-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_alignments_bai_nonexist-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_alignments_bai_nonexist-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sorted.bam (bai nonexist 404)", "trackId": "volvox_alignments_bai_nonexist", "type": "AlignmentsTrack", @@ -1381,12 +1027,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "Integration test", "Wiggle", ], - "displays": [ - { - "displayId": "volvox_bigwig_nonexist-LinearWiggleDisplay", - "type": "LinearWiggleDisplay", - }, - ], "name": "wiggle_track 404", "trackId": "volvox_bigwig_nonexist", "type": "QuantitativeTrack", @@ -1430,12 +1070,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "assemblyNames": [ "volvox", ], - "displays": [ - { - "displayId": "volvox_microarray_multi-MultiLinearWiggleDisplay", - "type": "MultiLinearWiggleDisplay", - }, - ], "name": "MultiWig", "trackId": "volvox_microarray_multi", "type": "MultiQuantitativeTrack", @@ -1455,12 +1089,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "Integration test", "Wiggle", ], - "displays": [ - { - "displayId": "volvox_microarray-LinearWiggleDisplay", - "type": "LinearWiggleDisplay", - }, - ], "name": "wiggle_track xyplot", "trackId": "volvox_microarray", "type": "QuantitativeTrack", @@ -1532,12 +1160,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "Integration test", "Wiggle", ], - "displays": [ - { - "displayId": "volvox_microarray_density_altname-LinearWiggleDisplay", - "type": "LinearWiggleDisplay", - }, - ], "name": "wiggle_track density (altname)", "trackId": "volvox_microarray_density_altname", "type": "QuantitativeTrack", @@ -1598,16 +1220,11 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "displays": [ { "displayId": "lollipop_track_linear", + "renderer": { + "type": "LollipopRenderer", + }, "type": "LinearLollipopDisplay", }, - { - "displayId": "lollipop_track-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "lollipop_track-LinearArcDisplay", - "type": "LinearArcDisplay", - }, ], "name": "FromConfig Track (defaults to LinearLollipopDisplay)", "trackId": "lollipop_track", @@ -1633,28 +1250,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-long-reads-sv-bam-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-long-reads-sv-bam-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-long-reads-sv-bam-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-long-reads-sv-bam-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-long-reads-sv-bam-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-long reads with SV", "trackId": "volvox-long-reads-sv-bam", "type": "AlignmentsTrack", @@ -1684,28 +1279,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-long-reads-sv-cram-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-long-reads-sv-cram-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-long-reads-sv-cram-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-long-reads-sv-cram-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-long-reads-sv-cram-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-long reads with SV (cram)", "trackId": "volvox-long-reads-sv-cram", "type": "AlignmentsTrack", @@ -1735,28 +1308,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-long-reads-cram-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-long-reads-cram-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-long-reads-cram-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-long-reads-cram-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-long-reads-cram-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-long reads (cram)", "trackId": "volvox-long-reads-cram", "type": "AlignmentsTrack", @@ -1781,28 +1332,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-long-reads-bam-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-long-reads-bam-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-long-reads-bam-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-long-reads-bam-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-long-reads-bam-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-long reads", "trackId": "volvox-long-reads-bam", "type": "AlignmentsTrack", @@ -1832,28 +1361,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox_samspec_cram-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_samspec_cram-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_samspec_cram-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_samspec_cram-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_samspec_cram-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-samspec (cram)", "trackId": "volvox_samspec_cram", "type": "AlignmentsTrack", @@ -1878,28 +1385,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox_samspec-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_samspec-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_samspec-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_samspec-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_samspec-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-samspec", "trackId": "volvox_samspec", "type": "AlignmentsTrack", @@ -1929,28 +1414,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox_sv_cram-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_sv_cram-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_sv_cram-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_sv_cram-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_sv_cram-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sv (cram)", "trackId": "volvox_sv_cram", "type": "AlignmentsTrack", @@ -1975,28 +1438,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox_sv-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_sv-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_sv-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_sv-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_sv-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sv", "trackId": "volvox_sv", "type": "AlignmentsTrack", @@ -2021,16 +1462,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Miscellaneous", ], - "displays": [ - { - "displayId": "gff3tabix_genes-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "gff3tabix_genes-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "formatDetails": { "feature": "jexl:{name:''+feature.name+'',extrafield:'Field added with custom callback:' + feature.name,phase:undefined,type:undefined}", "subfeatures": "jexl:{name:'Subfeature: '+(!feature.name?'No name':feature.name)+''}", @@ -2064,28 +1495,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox_cram-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_cram-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_cram-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_cram-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_cram-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sorted.cram", "trackId": "volvox_cram", "type": "AlignmentsTrack", @@ -2110,28 +1519,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox_bam-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox_bam-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox_bam-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox_bam-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox_bam-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sorted.bam", "trackId": "volvox_bam", "type": "AlignmentsTrack", @@ -2144,10 +1531,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "volvox.filtered.vcf.gz.tbi", }, }, - "samplesTsvLocation": { - "locationType": "UriLocation", - "uri": "/path/to/samples.tsv", - }, "type": "VcfTabixAdapter", "vcfGzLocation": { "locationType": "UriLocation", @@ -2160,28 +1543,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Variants", ], - "displays": [ - { - "displayId": "volvox_filtered_vcf-LinearVariantDisplay", - "type": "LinearVariantDisplay", - }, - { - "displayId": "volvox_filtered_vcf-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "volvox_filtered_vcf-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "volvox_filtered_vcf-ChordVariantDisplay", - "type": "ChordVariantDisplay", - }, - { - "displayId": "volvox_filtered_vcf-LinearPairedArcDisplay", - "type": "LinearPairedArcDisplay", - }, - ], "name": "volvox filtered vcf", "trackId": "volvox_filtered_vcf", "type": "VariantTrack", @@ -2194,10 +1555,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "volvox.filtered.vcf.gz.tbi", }, }, - "samplesTsvLocation": { - "locationType": "UriLocation", - "uri": "/path/to/samples.tsv", - }, "type": "VcfTabixAdapter", "vcfGzLocation": { "locationType": "UriLocation", @@ -2210,28 +1567,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Variants", ], - "displays": [ - { - "displayId": "volvox_filtered_vcf_assembly_alias-LinearVariantDisplay", - "type": "LinearVariantDisplay", - }, - { - "displayId": "volvox_filtered_vcf_assembly_alias-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "volvox_filtered_vcf_assembly_alias-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "volvox_filtered_vcf_assembly_alias-ChordVariantDisplay", - "type": "ChordVariantDisplay", - }, - { - "displayId": "volvox_filtered_vcf_assembly_alias-LinearPairedArcDisplay", - "type": "LinearPairedArcDisplay", - }, - ], "name": "volvox filtered vcf (with assembly alias)", "trackId": "volvox_filtered_vcf_assembly_alias", "type": "VariantTrack", @@ -2250,16 +1585,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Miscellaneous", ], - "displays": [ - { - "displayId": "bigbed_genes-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "bigbed_genes-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "BigBed genes", "trackId": "bigbed_genes", "type": "FeatureTrack", @@ -2284,16 +1609,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Miscellaneous", ], - "displays": [ - { - "displayId": "bedtabix_genes-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "bedtabix_genes-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "BedTabix genes", "trackId": "bedtabix_genes", "type": "FeatureTrack", @@ -2301,7 +1616,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` { "adapter": { "bedLocation": { - "locationType": "UriLocation", "uri": "volvox-bed12.bed", }, "type": "BedAdapter", @@ -2312,16 +1626,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Miscellaneous", ], - "displays": [ - { - "displayId": "bed_genes-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "bed_genes-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "Bed genes", "trackId": "bed_genes", "type": "FeatureTrack", @@ -2366,16 +1670,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Miscellaneous", ], - "displays": [ - { - "displayId": "Genes-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "Genes-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "NCList genes", "trackId": "Genes", "type": "FeatureTrack", @@ -2421,12 +1715,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "BigWig", "XYPlot", ], - "displays": [ - { - "displayId": "24eGIUSM86l-LinearWiggleDisplay", - "type": "LinearWiggleDisplay", - }, - ], "name": "Volvox microarray", "trackId": "24eGIUSM86l", "type": "QuantitativeTrack", @@ -2472,12 +1760,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "BigWig", "XYPlot", ], - "displays": [ - { - "displayId": "1at1sLO1Gsl-LinearWiggleDisplay", - "type": "LinearWiggleDisplay", - }, - ], "name": "Volvox microarray - negative", "trackId": "1at1sLO1Gsl", "type": "QuantitativeTrack", @@ -2549,12 +1831,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "BigWig", "XYPlot", ], - "displays": [ - { - "displayId": "jdYHuGnpAc_-LinearWiggleDisplay", - "type": "LinearWiggleDisplay", - }, - ], "name": "Volvox microarray with +/- values", "trackId": "jdYHuGnpAc_", "type": "QuantitativeTrack", @@ -2600,12 +1876,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "BigWig", "XYPlot", ], - "displays": [ - { - "displayId": "pOOtg9wxcUC-LinearWiggleDisplay", - "type": "LinearWiggleDisplay", - }, - ], "name": "Volvox - BAM coverage", "trackId": "pOOtg9wxcUC", "type": "QuantitativeTrack", @@ -2629,24 +1899,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Synteny", ], - "displays": [ - { - "displayId": "volvox_fake_synteny_alt-DotplotDisplay", - "type": "DotplotDisplay", - }, - { - "displayId": "volvox_fake_synteny_alt-LinearComparativeDisplay", - "type": "LinearComparativeDisplay", - }, - { - "displayId": "volvox_fake_synteny_alt-LinearSyntenyDisplay", - "type": "LinearSyntenyDisplay", - }, - { - "displayId": "volvox_fake_synteny_alt-LGVSyntenyDisplay", - "type": "LGVSyntenyDisplay", - }, - ], "name": "volvox_fake_synteny_alt", "trackId": "volvox_fake_synteny_alt", "type": "SyntenyTrack", @@ -2670,24 +1922,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Synteny", ], - "displays": [ - { - "displayId": "volvox_fake_synteny-DotplotDisplay", - "type": "DotplotDisplay", - }, - { - "displayId": "volvox_fake_synteny-LinearComparativeDisplay", - "type": "LinearComparativeDisplay", - }, - { - "displayId": "volvox_fake_synteny-LinearSyntenyDisplay", - "type": "LinearSyntenyDisplay", - }, - { - "displayId": "volvox_fake_synteny-LGVSyntenyDisplay", - "type": "LGVSyntenyDisplay", - }, - ], "name": "volvox_fake_synteny", "trackId": "volvox_fake_synteny", "type": "SyntenyTrack", @@ -2699,6 +1933,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "volvox-rg.bam", }, "index": { + "indexType": "BAI", "location": { "locationType": "UriLocation", "uri": "volvox-rg.bam.bai", @@ -2719,28 +1954,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-rg-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-rg-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-rg-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-rg-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-rg-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-rg (read groups, bam)", "trackId": "volvox-rg", "type": "AlignmentsTrack", @@ -2770,28 +1983,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-rg-cram-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-rg-cram-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-rg-cram-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-rg-cram-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-rg-cram-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-rg (read groups, cram)", "trackId": "volvox-rg-cram", "type": "AlignmentsTrack", @@ -2810,12 +2001,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "volvox_wrong_assembly-LinearWiggleDisplay", - "type": "LinearWiggleDisplay", - }, - ], "name": "wiggle_track (wrong assembly error)", "trackId": "volvox_wrong_assembly", "type": "QuantitativeTrack", @@ -2828,10 +2013,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "volvox.filtered.vcf.gz.tbi", }, }, - "samplesTsvLocation": { - "locationType": "UriLocation", - "uri": "/path/to/samples.tsv", - }, "type": "VcfTabixAdapter", "vcfGzLocation": { "locationType": "UriLocation", @@ -2847,6 +2028,9 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "displays": [ { "displayId": "volvox_filtered_vcf_color-ChordVariantDisplay", + "renderer": { + "type": "StructuralVariantChordRenderer", + }, "type": "ChordVariantDisplay", }, { @@ -2858,18 +2042,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` }, "type": "LinearVariantDisplay", }, - { - "displayId": "variant_colors-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "variant_colors-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "variant_colors-LinearPairedArcDisplay", - "type": "LinearPairedArcDisplay", - }, ], "name": "volvox filtered vcf (green snp, purple indel)", "trackId": "variant_colors", @@ -2882,6 +2054,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "MM-chebi-volvox.bam", }, "index": { + "indexType": "BAI", "location": { "locationType": "UriLocation", "uri": "MM-chebi-volvox.bam.bai", @@ -2902,28 +2075,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Methylation", ], - "displays": [ - { - "displayId": "MM-chebi-volvox-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "MM-chebi-volvox-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "MM-chebi-volvox-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "MM-chebi-volvox-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "MM-chebi-volvox-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "MM-chebi-volvox", "trackId": "MM-chebi-volvox", "type": "AlignmentsTrack", @@ -2935,6 +2086,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "MM-double-volvox.bam", }, "index": { + "indexType": "BAI", "location": { "locationType": "UriLocation", "uri": "MM-double-volvox.bam.bai", @@ -2955,28 +2107,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Methylation", ], - "displays": [ - { - "displayId": "MM-double-volvox-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "MM-double-volvox-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "MM-double-volvox-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "MM-double-volvox-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "MM-double-volvox-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "MM-double-volvox", "trackId": "MM-double-volvox", "type": "AlignmentsTrack", @@ -2988,6 +2118,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "MM-multi-volvox.bam", }, "index": { + "indexType": "BAI", "location": { "locationType": "UriLocation", "uri": "MM-multi-volvox.bam.bai", @@ -3008,28 +2139,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Methylation", ], - "displays": [ - { - "displayId": "MM-multi-volvox-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "MM-multi-volvox-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "MM-multi-volvox-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "MM-multi-volvox-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "MM-multi-volvox-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "MM-multi-volvox", "trackId": "MM-multi-volvox", "type": "AlignmentsTrack", @@ -3041,6 +2150,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "MM-orient-volvox.bam", }, "index": { + "indexType": "BAI", "location": { "locationType": "UriLocation", "uri": "MM-orient-volvox.bam.bai", @@ -3061,28 +2171,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Methylation", ], - "displays": [ - { - "displayId": "MM-orient-volvox-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "MM-orient-volvox-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "MM-orient-volvox-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "MM-orient-volvox-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "MM-orient-volvox-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "MM-orient-volvox", "trackId": "MM-orient-volvox", "type": "AlignmentsTrack", @@ -3107,16 +2195,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Miscellaneous", ], - "displays": [ - { - "displayId": "single_exon_gene-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "single_exon_gene-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "Single exon gene", "trackId": "single_exon_gene", "type": "FeatureTrack", @@ -3135,16 +2213,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Miscellaneous", ], - "displays": [ - { - "displayId": "gtf_plain_text_test-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "gtf_plain_text_test-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "GTF - volvox.sorted.gtf", "textSearching": { "indexingAttributes": [ @@ -3157,15 +2225,12 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` { "adapter": { "index": { + "indexType": "TBI", "location": { "locationType": "UriLocation", "uri": "volvox.inv.vcf.gz.tbi", }, }, - "samplesTsvLocation": { - "locationType": "UriLocation", - "uri": "/path/to/samples.tsv", - }, "type": "VcfTabixAdapter", "vcfGzLocation": { "locationType": "UriLocation", @@ -3178,28 +2243,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Variants", ], - "displays": [ - { - "displayId": "volvox.inv.vcf-LinearVariantDisplay", - "type": "LinearVariantDisplay", - }, - { - "displayId": "volvox.inv.vcf-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "volvox.inv.vcf-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "volvox.inv.vcf-ChordVariantDisplay", - "type": "ChordVariantDisplay", - }, - { - "displayId": "volvox.inv.vcf-LinearPairedArcDisplay", - "type": "LinearPairedArcDisplay", - }, - ], "name": "volvox inversions", "trackId": "volvox.inv.vcf", "type": "VariantTrack", @@ -3244,22 +2287,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` }, "type": "LinearAlignmentsDisplay", }, - { - "displayId": "Deep sequencing-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "Deep sequencing-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "Deep sequencing-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "Deep sequencing-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, ], "name": "Deep sequencing", "trackId": "Deep sequencing", @@ -3317,12 +2344,11 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "displays": [ { "displayId": "arc_track_linear", + "renderer": { + "type": "ArcRenderer", + }, "type": "LinearArcDisplay", }, - { - "displayId": "arc_track-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, ], "name": "FromConfig Track (defaults to LinearArcDisplay)", "trackId": "arc_track", @@ -3335,6 +2361,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "spliced.bam", }, "index": { + "indexType": "BAI", "location": { "locationType": "UriLocation", "uri": "spliced.bam.bai", @@ -3355,38 +2382,12 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "spliced-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "spliced-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "spliced-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "spliced-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "spliced-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-rnaseq demo", "trackId": "spliced", "type": "AlignmentsTrack", }, { "adapter": { - "samplesTsvLocation": { - "locationType": "UriLocation", - "uri": "/path/to/samples.tsv", - }, "type": "VcfAdapter", "vcfLocation": { "locationType": "UriLocation", @@ -3399,16 +2400,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "volvox.filtered.lowercase-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "volvox.filtered.lowercase-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "volvox.filtered.lowercase", "trackId": "volvox.filtered.lowercase", "type": "FeatureTrack", @@ -3416,7 +2407,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` { "adapter": { "pafLocation": { - "locationType": "UriLocation", "uri": "volvox_del.paf", }, "queryAssembly": "volvox_del", @@ -3430,24 +2420,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Synteny", ], - "displays": [ - { - "displayId": "volvox_del.paf-DotplotDisplay", - "type": "DotplotDisplay", - }, - { - "displayId": "volvox_del.paf-LinearComparativeDisplay", - "type": "LinearComparativeDisplay", - }, - { - "displayId": "volvox_del.paf-LinearSyntenyDisplay", - "type": "LinearSyntenyDisplay", - }, - { - "displayId": "volvox_del.paf-LGVSyntenyDisplay", - "type": "LGVSyntenyDisplay", - }, - ], "name": "volvox_del.paf", "trackId": "volvox_del.paf", "type": "SyntenyTrack", @@ -3455,7 +2427,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` { "adapter": { "pafLocation": { - "locationType": "UriLocation", "uri": "volvox_ins.paf", }, "queryAssembly": "volvox_ins", @@ -3469,34 +2440,12 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Synteny", ], - "displays": [ - { - "displayId": "volvox_ins.paf-DotplotDisplay", - "type": "DotplotDisplay", - }, - { - "displayId": "volvox_ins.paf-LinearComparativeDisplay", - "type": "LinearComparativeDisplay", - }, - { - "displayId": "volvox_ins.paf-LinearSyntenyDisplay", - "type": "LinearSyntenyDisplay", - }, - { - "displayId": "volvox_ins.paf-LGVSyntenyDisplay", - "type": "LGVSyntenyDisplay", - }, - ], "name": "volvox_ins.paf", "trackId": "volvox_ins.paf", "type": "SyntenyTrack", }, { "adapter": { - "samplesTsvLocation": { - "locationType": "UriLocation", - "uri": "/path/to/samples.tsv", - }, "type": "VcfAdapter", "vcfLocation": { "locationType": "UriLocation", @@ -3509,38 +2458,12 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Variants", ], - "displays": [ - { - "displayId": "variant_effect_demo_data-LinearVariantDisplay", - "type": "LinearVariantDisplay", - }, - { - "displayId": "variant_effect_demo_data-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "variant_effect_demo_data-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "variant_effect_demo_data-ChordVariantDisplay", - "type": "ChordVariantDisplay", - }, - { - "displayId": "variant_effect_demo_data-LinearPairedArcDisplay", - "type": "LinearPairedArcDisplay", - }, - ], "name": "Ensembl VEP example", "trackId": "variant_effect_demo_data", "type": "VariantTrack", }, { "adapter": { - "samplesTsvLocation": { - "locationType": "UriLocation", - "uri": "/path/to/samples.tsv", - }, "type": "VcfAdapter", "vcfLocation": { "locationType": "UriLocation", @@ -3553,28 +2476,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Variants", ], - "displays": [ - { - "displayId": "variant_effect_demo_jannovar-LinearVariantDisplay", - "type": "LinearVariantDisplay", - }, - { - "displayId": "variant_effect_demo_jannovar-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "variant_effect_demo_jannovar-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "variant_effect_demo_jannovar-ChordVariantDisplay", - "type": "ChordVariantDisplay", - }, - { - "displayId": "variant_effect_demo_jannovar-LinearPairedArcDisplay", - "type": "LinearPairedArcDisplay", - }, - ], "name": "Jannovar example", "trackId": "variant_effect_demo_jannovar", "type": "VariantTrack", @@ -3598,24 +2499,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Synteny", ], - "displays": [ - { - "displayId": "volvox-rev-del-DotplotDisplay", - "type": "DotplotDisplay", - }, - { - "displayId": "volvox-rev-del-LinearComparativeDisplay", - "type": "LinearComparativeDisplay", - }, - { - "displayId": "volvox-rev-del-LinearSyntenyDisplay", - "type": "LinearSyntenyDisplay", - }, - { - "displayId": "volvox-rev-del-LGVSyntenyDisplay", - "type": "LGVSyntenyDisplay", - }, - ], "name": "volvox-rev-del", "trackId": "volvox-rev-del", "type": "SyntenyTrack", @@ -3631,16 +2514,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "assemblyNames": [ "volvox-rev-del", ], - "displays": [ - { - "displayId": "volvox-rev-del-annotations-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "volvox-rev-del-annotations-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "volvox-rev-del-annotations", "trackId": "volvox-rev-del-annotations", "type": "FeatureTrack", @@ -3652,6 +2525,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "volvox-simple-inv.bam", }, "index": { + "indexType": "BAI", "location": { "locationType": "UriLocation", "uri": "volvox-simple-inv.bam.bai", @@ -3672,28 +2546,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-simple-inv.bam-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-simple-inv.bam-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-simple-inv.bam-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-simple-inv.bam-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-simple-inv.bam-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-simple-inv.bam", "trackId": "volvox-simple-inv.bam", "type": "AlignmentsTrack", @@ -3723,28 +2575,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-simple-inv.cram-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-simple-inv.cram-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-simple-inv.cram-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-simple-inv.cram-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-simple-inv.cram-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-simple-inv.cram", "trackId": "volvox-simple-inv.cram", "type": "AlignmentsTrack", @@ -3774,28 +2604,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-simple-inv-paired.cram-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-simple-inv-paired.cram-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-simple-inv-paired.cram-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-simple-inv-paired.cram-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-simple-inv-paired.cram-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-simple-inv-paired.cram", "trackId": "volvox-simple-inv-paired.cram", "type": "AlignmentsTrack", @@ -3807,6 +2615,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "volvox-simple-inv-paired.bam", }, "index": { + "indexType": "BAI", "location": { "locationType": "UriLocation", "uri": "volvox-simple-inv-paired.bam.bai", @@ -3827,28 +2636,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-simple-inv-paired.bam-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-simple-inv-paired.bam-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-simple-inv-paired.bam-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-simple-inv-paired.bam-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-simple-inv-paired.bam-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-simple-inv-paired.bam", "trackId": "volvox-simple-inv-paired.bam", "type": "AlignmentsTrack", @@ -3872,24 +2659,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Synteny", ], - "displays": [ - { - "displayId": "volvox_inv_indels-DotplotDisplay", - "type": "DotplotDisplay", - }, - { - "displayId": "volvox_inv_indels-LinearComparativeDisplay", - "type": "LinearComparativeDisplay", - }, - { - "displayId": "volvox_inv_indels-LinearSyntenyDisplay", - "type": "LinearSyntenyDisplay", - }, - { - "displayId": "volvox_inv_indels-LGVSyntenyDisplay", - "type": "LGVSyntenyDisplay", - }, - ], "name": "volvox_inv_indels", "trackId": "volvox_inv_indels", "type": "SyntenyTrack", @@ -3919,28 +2688,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "volvox-inv-pbsim-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-inv-pbsim-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-inv-pbsim-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-inv-pbsim-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-inv-pbsim-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-inv-pbsim", "trackId": "volvox-inv-pbsim", "type": "AlignmentsTrack", @@ -3952,6 +2699,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "uri": "paired_end_stranded_rnaseq.bam", }, "index": { + "indexType": "BAI", "location": { "locationType": "UriLocation", "uri": "paired_end_stranded_rnaseq.bam.bai", @@ -3972,28 +2720,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Alignments", ], - "displays": [ - { - "displayId": "paired_end_stranded_rnaseq-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "paired_end_stranded_rnaseq-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "paired_end_stranded_rnaseq-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "paired_end_stranded_rnaseq-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "paired_end_stranded_rnaseq-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-stranded-rnaseq", "trackId": "paired_end_stranded_rnaseq", "type": "AlignmentsTrack", @@ -4012,16 +2738,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Miscellaneous", ], - "displays": [ - { - "displayId": "arc_test-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "arc_test-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "Arc test track", "trackId": "arc_test", "type": "FeatureTrack", @@ -4045,22 +2761,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "displayId": "volvox_bedpe-LinearPairedArcDisplay", "type": "LinearPairedArcDisplay", }, - { - "displayId": "volvox_bedpe-LinearVariantDisplay", - "type": "LinearVariantDisplay", - }, - { - "displayId": "volvox_bedpe-LinearVariantMatrixDisplay", - "type": "LinearVariantMatrixDisplay", - }, - { - "displayId": "volvox_bedpe-MultiLinearVariantDisplay", - "type": "MultiLinearVariantDisplay", - }, - { - "displayId": "volvox_bedpe-ChordVariantDisplay", - "type": "ChordVariantDisplay", - }, ], "name": "BEDPE arcs", "trackId": "volvox_bedpe", @@ -4073,6 +2773,7 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "volvox", ], "index": { + "indexType": "TBI", "location": { "locationType": "UriLocation", "uri": "volvox_ins.pif.gz.tbi", @@ -4091,24 +2792,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Synteny", ], - "displays": [ - { - "displayId": "volvox_ins.pif-DotplotDisplay", - "type": "DotplotDisplay", - }, - { - "displayId": "volvox_ins.pif-LinearComparativeDisplay", - "type": "LinearComparativeDisplay", - }, - { - "displayId": "volvox_ins.pif-LinearSyntenyDisplay", - "type": "LinearSyntenyDisplay", - }, - { - "displayId": "volvox_ins.pif-LGVSyntenyDisplay", - "type": "LGVSyntenyDisplay", - }, - ], "name": "volvox_ins.pif", "trackId": "volvox_ins.pif", "type": "SyntenyTrack", @@ -4127,16 +2810,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "test-LinearBasicDisplay", - "type": "LinearBasicDisplay", - }, - { - "displayId": "test-LinearArcDisplay", - "type": "LinearArcDisplay", - }, - ], "name": "Multi-part feature segments", "trackId": "test", "type": "FeatureTrack", @@ -4166,28 +2839,6 @@ exports[`JBrowse model creates with non-empty snapshot 1`] = ` "category": [ "Integration test", ], - "displays": [ - { - "displayId": "volvox-sorted.noref.cram-LinearAlignmentsDisplay", - "type": "LinearAlignmentsDisplay", - }, - { - "displayId": "volvox-sorted.noref.cram-LinearPileupDisplay", - "type": "LinearPileupDisplay", - }, - { - "displayId": "volvox-sorted.noref.cram-LinearSNPCoverageDisplay", - "type": "LinearSNPCoverageDisplay", - }, - { - "displayId": "volvox-sorted.noref.cram-LinearReadArcsDisplay", - "type": "LinearReadArcsDisplay", - }, - { - "displayId": "volvox-sorted.noref.cram-LinearReadCloudDisplay", - "type": "LinearReadCloudDisplay", - }, - ], "name": "volvox-sorted.cram (noref)", "trackId": "volvox-sorted.noref.cram", "type": "AlignmentsTrack", diff --git a/products/jbrowse-web/src/rootModel/rootModel.test.ts b/products/jbrowse-web/src/rootModel/rootModel.test.ts index 2a9bc923db..aa5b33c55a 100644 --- a/products/jbrowse-web/src/rootModel/rootModel.test.ts +++ b/products/jbrowse-web/src/rootModel/rootModel.test.ts @@ -99,7 +99,7 @@ test('adds track and connection configs to an assembly', () => { type: 'FeatureTrack', trackId: 'trackId0', }) - expect(getSnapshot(newTrackConf)).toMatchSnapshot() + expect(newTrackConf).toMatchSnapshot() expect(root.jbrowse.tracks.length).toBe(1) const newConnectionConf = root.jbrowse.addConnectionConf({ type: 'JBrowse1Connection', diff --git a/products/jbrowse-web/src/tests/Loader.test.tsx b/products/jbrowse-web/src/tests/Loader.test.tsx index 3ef18ccfd7..850be20c14 100644 --- a/products/jbrowse-web/src/tests/Loader.test.tsx +++ b/products/jbrowse-web/src/tests/Loader.test.tsx @@ -140,13 +140,6 @@ test('can use config from a url with nonexistent share param ', async () => { await findAllByText(/Error/, {}, delay) }, 20000) -test('can catch error from loading a bad config', async () => { - const { findAllByText } = render( - , - ) - await findAllByText(/Error while converting/) -}, 20000) - test('can use a spec url for lgv', async () => { const { findByText, findByPlaceholderText } = render( ,