diff --git a/plugins/alignments/src/BamAdapter/BamAdapter.ts b/plugins/alignments/src/BamAdapter/BamAdapter.ts index 01a4554d50c..9b972102ff4 100644 --- a/plugins/alignments/src/BamAdapter/BamAdapter.ts +++ b/plugins/alignments/src/BamAdapter/BamAdapter.ts @@ -80,39 +80,27 @@ export default class BamAdapter extends BaseFeatureDataAdapter { return bam.getHeaderText() } - private async setupPre(opts?: BaseOptions) { - const { statusCallback = () => {} } = opts || {} + private async setupPre(_opts?: BaseOptions) { const { bam } = await this.configure() - console.log('wow') - this.samHeader = await updateStatus( - 'Downloading index', - statusCallback, - async () => { - return new Promise(res => - setTimeout(async () => { - const samHeader = await bam.getHeader() - - // use the @SQ lines in the header to figure out the - // mapping between ref ref ID numbers and names - const idToName: string[] = [] - const nameToId: Record = {} - samHeader - ?.filter(l => l.tag === 'SQ') - .forEach((sqLine, refId) => { - const SN = sqLine.data.find(item => item.tag === 'SN') - if (SN) { - // this is the ref name - const refName = SN.value - nameToId[refName] = refId - idToName[refId] = refName - } - }) - - res({ idToName, nameToId }) - }, 4000), - ) - }, - ) + const samHeader = await bam.getHeader() + + // use the @SQ lines in the header to figure out the + // mapping between ref ref ID numbers and names + const idToName: string[] = [] + const nameToId: Record = {} + samHeader + ?.filter(l => l.tag === 'SQ') + .forEach((sqLine, refId) => { + const SN = sqLine.data.find(item => item.tag === 'SN') + if (SN) { + // this is the ref name + const refName = SN.value + nameToId[refName] = refId + idToName[refId] = refName + } + }) + + this.samHeader = { idToName, nameToId } return this.samHeader } diff --git a/plugins/alignments/src/LinearPileupDisplay/doAfterAttach.ts b/plugins/alignments/src/LinearPileupDisplay/doAfterAttach.ts index d9d2c11802b..575c1d84015 100644 --- a/plugins/alignments/src/LinearPileupDisplay/doAfterAttach.ts +++ b/plugins/alignments/src/LinearPileupDisplay/doAfterAttach.ts @@ -1,4 +1,3 @@ -import { AnyConfigurationModel, getConf } from '@jbrowse/core/configuration' import { getContainingView, getSession } from '@jbrowse/core/util' import { getRpcSessionId } from '@jbrowse/core/util/tracks' import { isAlive } from 'mobx-state-tree' @@ -6,8 +5,9 @@ import { isAlive } from 'mobx-state-tree' import { getUniqueModifications } from '../shared/getUniqueModifications' import { createAutorun } from '../util' -import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view' import type { ModificationType, SortedBy } from '../shared/types' +import type { AnyConfigurationModel } from '@jbrowse/core/configuration' +import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view' type LGV = LinearGenomeViewModel diff --git a/plugins/alignments/src/SNPCoverageRenderer/SNPCoverageRenderer.ts b/plugins/alignments/src/SNPCoverageRenderer/SNPCoverageRenderer.ts index c6b448dcfc7..4172f833f92 100644 --- a/plugins/alignments/src/SNPCoverageRenderer/SNPCoverageRenderer.ts +++ b/plugins/alignments/src/SNPCoverageRenderer/SNPCoverageRenderer.ts @@ -1,7 +1,7 @@ +import { updateStatus } from '@jbrowse/core/util' import { WiggleBaseRenderer } from '@jbrowse/plugin-wiggle' import type { RenderArgsDeserializedWithFeatures } from './types' -import { updateStatus } from '@jbrowse/core/util' export default class SNPCoverageRenderer extends WiggleBaseRenderer { // note: the snps are drawn on linear scale even if the data is drawn in log diff --git a/products/jbrowse-react-linear-genome-view/stories/examples/ShadowDOMOneLinearGenomeView.tsx b/products/jbrowse-react-linear-genome-view/stories/examples/ShadowDOMOneLinearGenomeView.tsx index 67904b07c1a..cf3eb01c0d4 100644 --- a/products/jbrowse-react-linear-genome-view/stories/examples/ShadowDOMOneLinearGenomeView.tsx +++ b/products/jbrowse-react-linear-genome-view/stories/examples/ShadowDOMOneLinearGenomeView.tsx @@ -1,5 +1,4 @@ -// @ts-nocheck -import { useEffect, useRef, useState } from 'react' +import React, { useEffect, useRef, useState } from 'react' import createCache from '@emotion/cache' import { CacheProvider } from '@emotion/react' @@ -90,14 +89,16 @@ const ShadowComponent = () => { }, []) return (
- {rootNode && - createPortal( - - -
- , - rootNode, - )} + {rootNode && config + ? createPortal( + // @ts-expect-error + + +
+ , + rootNode, + ) + : null}
) } @@ -112,6 +113,7 @@ export const ShadowDOMOneLinearGenomeView = () => { } return (
+ {/* @ts-expect-error */} Source code