diff --git a/plugins/linear-comparative-view/src/index.tsx b/plugins/linear-comparative-view/src/index.tsx index 360c910589..730fdc7c22 100644 --- a/plugins/linear-comparative-view/src/index.tsx +++ b/plugins/linear-comparative-view/src/index.tsx @@ -17,7 +17,7 @@ import CalendarIcon from '@material-ui/icons/CalendarViewDay' import { ConfigurationSchema, getConf } from '@jbrowse/core/configuration' import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType' import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType' -import SimpleFeature, { Feature } from '@jbrowse/core/util/simpleFeature' +import { Feature } from '@jbrowse/core/util/simpleFeature' import { createBaseTrackConfig, createBaseTrackModel, @@ -165,7 +165,7 @@ function WindowSizeDlg(props: { const [window, setWindowSize] = useState('0') const [error, setError] = useState() const windowSize = +window - const [featureDownloaded, setFeatureDownloaded] = useState() + const [primaryFeature, setPrimaryFeature] = useState() useEffect(() => { let done = false ;(async () => { @@ -188,8 +188,10 @@ function WindowSizeDlg(props: { f => f.get('name') === preFeature.get('name'), ) if (!done) { - setFeatureDownloaded(primaryFeat) + setPrimaryFeature(primaryFeat) } + } else { + setPrimaryFeature(preFeature) } })() @@ -200,7 +202,7 @@ function WindowSizeDlg(props: { function onSubmit() { try { - const feature = featureDownloaded || preFeature + const feature = primaryFeature || preFeature const session = getSession(track) const view = getContainingView(track) const cigar = feature.get('CIGAR') @@ -439,7 +441,7 @@ function WindowSizeDlg(props: { - {!featureDownloaded ? ( + {!primaryFeature ? (
To accurately perform comparison we are fetching the primary diff --git a/plugins/linear-genome-view/src/LinearGenomeView/components/SequenceDialog.tsx b/plugins/linear-genome-view/src/LinearGenomeView/components/SequenceDialog.tsx index aae362b781..2c2f3eb71f 100644 --- a/plugins/linear-genome-view/src/LinearGenomeView/components/SequenceDialog.tsx +++ b/plugins/linear-genome-view/src/LinearGenomeView/components/SequenceDialog.tsx @@ -22,10 +22,7 @@ import TextField from '@material-ui/core/TextField' // core import { getSession } from '@jbrowse/core/util' -import SimpleFeature, { - Feature, - SimpleFeatureSerialized, -} from '@jbrowse/core/util/simpleFeature' +import { Feature } from '@jbrowse/core/util/simpleFeature' // other import { formatSeqFasta, SeqChunk } from '@jbrowse/core/util/formatFastaStrings' import { LinearGenomeViewModel } from '..' @@ -80,10 +77,10 @@ async function fetchSequence( sessionId, }), ), - )) as SimpleFeatureSerialized[][] + )) as Feature[][] // assumes that we get whole sequence in a single getFeatures call - return chunks.map(chunk => new SimpleFeature(chunk[0])) + return chunks.map(chunk => chunk[0]) } function SequenceDialog({