jbrowse-plugin-msaview 5.18.0 → 5.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -76
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +2 -4
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js +10 -5
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.d.ts +4 -2
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +28 -22
- package/dist/LaunchMsaView/codingFeature.d.ts +1 -0
- package/dist/LaunchMsaView/codingFeature.js +1 -1
- package/dist/LaunchMsaView/components/BlastQuery/BlastAutomaticPanel.js +12 -8
- package/dist/LaunchMsaView/components/BlastQuery/BlastManualPanel.d.ts +1 -1
- package/dist/LaunchMsaView/components/BlastQuery/BlastManualPanel.js +12 -20
- package/dist/LaunchMsaView/components/BlastQuery/BlastPanel.d.ts +1 -17
- package/dist/LaunchMsaView/components/BlastQuery/BlastPanel.js +8 -9
- package/dist/LaunchMsaView/components/BlastQuery/BlastPanel.test.d.ts +1 -0
- package/dist/LaunchMsaView/components/BlastQuery/BlastPanel.test.js +72 -0
- package/dist/LaunchMsaView/components/BlastQuery/BlastSettingsDialog.d.ts +1 -1
- package/dist/LaunchMsaView/components/BlastQuery/CachedBlastResults.d.ts +3 -2
- package/dist/LaunchMsaView/components/BlastQuery/CachedBlastResults.js +8 -11
- package/dist/LaunchMsaView/components/BlastQuery/CachedBlastResultsLaunch.test.d.ts +1 -0
- package/dist/LaunchMsaView/components/BlastQuery/CachedBlastResultsLaunch.test.js +70 -0
- package/dist/LaunchMsaView/components/BlastQuery/consts.d.ts +1 -1
- package/dist/LaunchMsaView/components/BlastQuery/consts.js +1 -1
- package/dist/LaunchMsaView/components/BlastQuery/useCachedBlastResults.d.ts +2 -1
- package/dist/LaunchMsaView/components/BlastQuery/useCachedBlastResults.js +9 -4
- package/dist/LaunchMsaView/components/BlastQuery/useCachedBlastResults.test.d.ts +1 -0
- package/dist/LaunchMsaView/components/BlastQuery/useCachedBlastResults.test.js +74 -0
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js +23 -19
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +7 -15
- package/dist/LaunchMsaView/components/OrthologQuery/OrthologPanel.js +7 -5
- package/dist/LaunchMsaView/components/OrthologQuery/QuerySpeciesSelect.d.ts +10 -4
- package/dist/LaunchMsaView/components/OrthologQuery/QuerySpeciesSelect.js +35 -20
- package/dist/LaunchMsaView/components/OrthologQuery/useQuerySpecies.test.d.ts +1 -0
- package/dist/LaunchMsaView/components/OrthologQuery/useQuerySpecies.test.js +94 -0
- package/dist/LaunchMsaView/components/PastedAlignmentFields.d.ts +8 -0
- package/dist/LaunchMsaView/components/PastedAlignmentFields.js +23 -0
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +8 -5
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.test.d.ts +1 -0
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.test.js +79 -0
- package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.d.ts +2 -1
- package/dist/LaunchMsaView/components/QueryRowSelector.d.ts +3 -1
- package/dist/LaunchMsaView/components/QueryRowSelector.js +7 -2
- package/dist/LaunchMsaView/components/QueryRowSelector.test.d.ts +1 -0
- package/dist/LaunchMsaView/components/QueryRowSelector.test.js +23 -0
- package/dist/LaunchMsaView/components/SubmitCancelActions.js +3 -13
- package/dist/LaunchMsaView/components/TabPanel.d.ts +6 -1
- package/dist/LaunchMsaView/components/TabPanel.js +8 -2
- package/dist/LaunchMsaView/components/launchPlacement.d.ts +7 -0
- package/dist/LaunchMsaView/components/launchPlacement.js +22 -1
- package/dist/LaunchMsaView/components/pastedAlignmentLaunch.test.d.ts +1 -0
- package/dist/LaunchMsaView/components/pastedAlignmentLaunch.test.js +102 -0
- package/dist/LaunchMsaView/components/transcriptChoice.d.ts +23 -0
- package/dist/LaunchMsaView/components/transcriptChoice.js +19 -0
- package/dist/LaunchMsaView/components/transcriptChoice.test.d.ts +1 -0
- package/dist/LaunchMsaView/components/transcriptChoice.test.js +112 -0
- package/dist/LaunchMsaView/components/useFeatureSequence.d.ts +0 -4
- package/dist/LaunchMsaView/components/useFeatureSequence.js +0 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.d.ts +1 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.js +11 -7
- package/dist/LaunchMsaView/detectQueryRow.d.ts +3 -2
- package/dist/LaunchMsaView/extendStateModel.test.js +18 -9
- package/dist/LaunchMsaView/getTranscriptFeatures.test.d.ts +1 -0
- package/dist/LaunchMsaView/getTranscriptFeatures.test.js +51 -0
- package/dist/LaunchMsaView/index.js +17 -19
- package/dist/LaunchMsaView/launchTarget.d.ts +2 -1
- package/dist/LaunchMsaView/useQueryRowName.d.ts +1 -1
- package/dist/LaunchMsaView/useQueryRowName.js +6 -3
- package/dist/LaunchMsaView/useQueryRowName.test.js +26 -0
- package/dist/LaunchMsaView/util.d.ts +1 -0
- package/dist/LaunchMsaView/util.js +9 -16
- package/dist/MsaViewPanel/afterCreateAutoruns.d.ts +1 -5
- package/dist/MsaViewPanel/afterCreateAutoruns.js +30 -9
- package/dist/MsaViewPanel/doLaunchBlast.js +11 -11
- package/dist/MsaViewPanel/doLaunchBlast.test.js +34 -0
- package/dist/MsaViewPanel/doLaunchOrthologs.js +5 -13
- package/dist/MsaViewPanel/doLaunchOrthologs.test.js +24 -8
- package/dist/MsaViewPanel/model.d.ts +7 -7
- package/dist/MsaViewPanel/model.js +6 -3
- package/dist/MsaViewPanel/model.test.js +19 -0
- package/dist/MsaViewPanel/processInit.test.js +20 -0
- package/dist/MsaViewPanel/resolveConnectedTranscript.d.ts +1 -0
- package/dist/MsaViewPanel/resolveConnectedTranscript.js +3 -0
- package/dist/MsaViewPanel/resolveConnectedTranscript.test.js +13 -0
- package/dist/MsaViewPanel/sessionHighlights.d.ts +1 -1
- package/dist/MsaViewPanel/sessionHighlights.js +3 -5
- package/dist/MsaViewPanel/sessionHighlights.test.js +12 -1
- package/dist/MsaViewPanel/storedData.test.js +9 -0
- package/dist/MsaViewPanel/structureConnection.js +4 -2
- package/dist/MsaViewPanel/util.js +8 -6
- package/dist/MsaViewPanel/viewReport.d.ts +1 -1
- package/dist/MsaViewPanel/viewReport.js +1 -1
- package/dist/OrthoFinderMsaAdapter/parseResults.js +4 -5
- package/dist/OrthoFinderMsaAdapter/parseResults.test.js +3 -0
- package/dist/chunks/{AboutDialog-QD4L7BYU.js → AboutDialog-XNWCXUML.js} +2 -2
- package/dist/chunks/{AboutDialog-QD4L7BYU.js.map → AboutDialog-XNWCXUML.js.map} +1 -1
- package/dist/chunks/{AnnotationFileDialog-IDJWWQDB.js → AnnotationFileDialog-Z4FLEMTF.js} +2 -2
- package/dist/chunks/{AnnotationFileDialog-IDJWWQDB.js.map → AnnotationFileDialog-Z4FLEMTF.js.map} +1 -1
- package/dist/chunks/BgzipFastaMsaAdapter-4IP2B4CV.js +6 -0
- package/dist/chunks/BgzipFastaMsaAdapter-4IP2B4CV.js.map +7 -0
- package/dist/chunks/{ExportSVGDialog-R7ANUOII.js → ExportSVGDialog-T3RSUIP6.js} +2 -2
- package/dist/chunks/{ExportSVGDialog-R7ANUOII.js.map → ExportSVGDialog-T3RSUIP6.js.map} +1 -1
- package/dist/chunks/{FeatureDialog-A7LFBVGM.js → FeatureDialog-SGSCRRJC.js} +2 -2
- package/dist/chunks/{FeatureDialog-A7LFBVGM.js.map → FeatureDialog-SGSCRRJC.js.map} +1 -1
- package/dist/chunks/{GapThresholdDialog-LP4UN3SB.js → GapThresholdDialog-UOSORGY3.js} +2 -2
- package/dist/chunks/{GapThresholdDialog-LP4UN3SB.js.map → GapThresholdDialog-UOSORGY3.js.map} +1 -1
- package/dist/chunks/{GoToDialog-3HM7K5RZ.js → GoToDialog-4NSGTRAF.js} +2 -2
- package/dist/chunks/{GoToDialog-3HM7K5RZ.js.map → GoToDialog-4NSGTRAF.js.map} +1 -1
- package/dist/chunks/{HelpDialog-GJKUU5Z6.js → HelpDialog-ATDGYZHQ.js} +2 -2
- package/dist/chunks/{HelpDialog-GJKUU5Z6.js.map → HelpDialog-ATDGYZHQ.js.map} +1 -1
- package/dist/chunks/{HelpDialog-3IR65NL3.js → HelpDialog-UF43YYX4.js} +2 -2
- package/dist/chunks/LaunchMsaViewDialog-AWSNOLTZ.js +3 -0
- package/dist/chunks/LaunchMsaViewDialog-AWSNOLTZ.js.map +7 -0
- package/dist/chunks/{MetadataDialog-4YUN5FJL.js → MetadataDialog-VUQ4FSPL.js} +2 -2
- package/dist/chunks/{MetadataDialog-4YUN5FJL.js.map → MetadataDialog-VUQ4FSPL.js.map} +1 -1
- package/dist/chunks/{MsaViewPanel-3GZG5IYS.js → MsaViewPanel-VARPO7OL.js} +2 -2
- package/dist/chunks/OrthoFinderMsaAdapter-OJVBY4EU.js +2 -0
- package/dist/chunks/{OrthoFinderMsaAdapter-BAVVTZHO.js.map → OrthoFinderMsaAdapter-OJVBY4EU.js.map} +2 -2
- package/dist/chunks/{TrackInfoDialog-D423HM63.js → TrackInfoDialog-KVLFUXQ6.js} +2 -2
- package/dist/chunks/{TrackInfoDialog-D423HM63.js.map → TrackInfoDialog-KVLFUXQ6.js.map} +1 -1
- package/dist/chunks/{TreeNodeInfoDialog-IXNBDQYV.js → TreeNodeInfoDialog-WOLJQH4P.js} +2 -2
- package/dist/chunks/{TreeNodeInfoDialog-IXNBDQYV.js.map → TreeNodeInfoDialog-WOLJQH4P.js.map} +1 -1
- package/dist/chunks/{chunk-LNMEYTCN.js → chunk-44ZCMBOI.js} +1 -1
- package/dist/chunks/{chunk-LNMEYTCN.js.map → chunk-44ZCMBOI.js.map} +1 -1
- package/dist/chunks/chunk-5UVNR5ZZ.js +164 -0
- package/dist/chunks/chunk-5UVNR5ZZ.js.map +7 -0
- package/dist/chunks/{chunk-X5QA4AF6.js → chunk-6ZLRUWM2.js} +2 -2
- package/dist/chunks/{chunk-X5QA4AF6.js.map → chunk-6ZLRUWM2.js.map} +1 -1
- package/dist/chunks/{chunk-BD6Y2ERQ.js → chunk-75TUMBKQ.js} +2 -2
- package/dist/chunks/{chunk-BD6Y2ERQ.js.map → chunk-75TUMBKQ.js.map} +1 -1
- package/dist/chunks/chunk-BJPVMTGT.js +2 -0
- package/dist/chunks/chunk-BJPVMTGT.js.map +7 -0
- package/dist/chunks/{chunk-7ZEXFLSY.js → chunk-DH2QUEKI.js} +1 -1
- package/dist/chunks/chunk-GNNLVWKA.js +6 -0
- package/dist/chunks/{chunk-ZJGFEUGM.js.map → chunk-GNNLVWKA.js.map} +2 -2
- package/dist/chunks/{chunk-TEYYBCMF.js → chunk-GP2EFH2U.js} +2 -2
- package/dist/chunks/chunk-HED42VNJ.js +2 -0
- package/dist/chunks/{chunk-ZWQTJTRR.js.map → chunk-HED42VNJ.js.map} +2 -2
- package/dist/chunks/chunk-IJ2GGGFR.js +2 -0
- package/dist/chunks/{chunk-CKXVJK5K.js.map → chunk-IJ2GGGFR.js.map} +1 -1
- package/dist/chunks/{chunk-3MNW5BKS.js → chunk-KENFRWWU.js} +1 -1
- package/dist/chunks/{chunk-3MNW5BKS.js.map → chunk-KENFRWWU.js.map} +1 -1
- package/dist/chunks/chunk-L72SS7RL.js +2 -0
- package/dist/chunks/chunk-L72SS7RL.js.map +7 -0
- package/dist/chunks/{chunk-XNNIIXGD.js → chunk-N5YJBTY5.js} +1 -1
- package/dist/chunks/{chunk-XNNIIXGD.js.map → chunk-N5YJBTY5.js.map} +1 -1
- package/dist/chunks/{chunk-CREQPIFJ.js → chunk-OSF7I4IV.js} +2 -2
- package/dist/chunks/{chunk-CREQPIFJ.js.map → chunk-OSF7I4IV.js.map} +1 -1
- package/dist/chunks/chunk-OUJA5TD2.js +3 -0
- package/dist/chunks/{chunk-WE35XW3J.js.map → chunk-OUJA5TD2.js.map} +4 -4
- package/dist/chunks/chunk-Q6V6EHAM.js +2 -0
- package/dist/chunks/chunk-Q6V6EHAM.js.map +7 -0
- package/dist/chunks/{chunk-LFBMB523.js → chunk-TDFMPJVU.js} +1 -1
- package/dist/chunks/{chunk-LFBMB523.js.map → chunk-TDFMPJVU.js.map} +1 -1
- package/dist/chunks/chunk-UZ74KTAJ.js +2 -0
- package/dist/chunks/{chunk-DW5INM5K.js.map → chunk-UZ74KTAJ.js.map} +1 -1
- package/dist/chunks/chunk-WWDZENCA.js +2 -0
- package/dist/chunks/chunk-WWDZENCA.js.map +7 -0
- package/dist/chunks/{chunk-YOLY6H5C.js → chunk-YX7QETL5.js} +2 -2
- package/dist/chunks/{chunk-YOLY6H5C.js.map → chunk-YX7QETL5.js.map} +2 -2
- package/dist/chunks/{chunk-PWNKL3ZK.js → chunk-ZAUQ25BW.js} +2 -2
- package/dist/chunks/chunk-ZAUQ25BW.js.map +7 -0
- package/dist/chunks/chunk-ZBTXUYNT.js +3 -0
- package/dist/chunks/chunk-ZBTXUYNT.js.map +7 -0
- package/dist/chunks/dist-QLG7JP2Z.js +2 -0
- package/dist/chunks/model-YTUGVNIN.js +11 -0
- package/dist/chunks/model-YTUGVNIN.js.map +7 -0
- package/dist/chunks/renderToSvg-PM3HEMVM.js +2 -0
- package/dist/jbrowse-plugin-msaview.esm.js +2 -2
- package/dist/jbrowse-plugin-msaview.esm.js.map +4 -4
- package/dist/readinessConformance.test.js +4 -1
- package/dist/utils/domainCache.js +3 -16
- package/dist/utils/ebiJobDispatcher.d.ts +4 -11
- package/dist/utils/ebiJobDispatcher.js +26 -5
- package/dist/utils/ebiJobDispatcher.test.js +71 -1
- package/dist/utils/fetch.js +8 -2
- package/dist/utils/fetch.test.d.ts +1 -0
- package/dist/utils/fetch.test.js +22 -0
- package/dist/utils/idb.d.ts +3 -1
- package/dist/utils/idb.js +21 -3
- package/dist/utils/idb.test.js +2 -5
- package/dist/utils/msa.js +8 -1
- package/dist/utils/msa.test.d.ts +1 -0
- package/dist/utils/msa.test.js +20 -0
- package/dist/utils/msaIndex.d.ts +1 -0
- package/dist/utils/msaIndex.js +5 -2
- package/dist/utils/msaRows.js +4 -1
- package/dist/utils/msaRows.test.d.ts +1 -0
- package/dist/utils/msaRows.test.js +32 -0
- package/dist/utils/ncbiOrthologs.d.ts +5 -7
- package/dist/utils/ncbiOrthologs.js +26 -24
- package/dist/utils/ncbiOrthologs.test.js +48 -1
- package/dist/utils/pantherOrthologs.d.ts +43 -3
- package/dist/utils/pantherOrthologs.js +26 -45
- package/dist/utils/searchCache.d.ts +1 -0
- package/dist/utils/taxonomyNames.js +3 -16
- package/dist/utils/unirefHomologs.js +15 -16
- package/dist/utils/unirefHomologs.test.js +11 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +27 -25
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +2 -6
- package/src/AddHighlightModel/MsaToGenomeHighlight.tsx +10 -5
- package/src/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.ts +42 -34
- package/src/LaunchMsaView/codingFeature.ts +1 -1
- package/src/LaunchMsaView/components/BlastQuery/BlastAutomaticPanel.tsx +14 -11
- package/src/LaunchMsaView/components/BlastQuery/BlastManualPanel.tsx +22 -43
- package/src/LaunchMsaView/components/BlastQuery/BlastPanel.test.tsx +102 -0
- package/src/LaunchMsaView/components/BlastQuery/BlastPanel.tsx +43 -32
- package/src/LaunchMsaView/components/BlastQuery/BlastSettingsDialog.tsx +1 -1
- package/src/LaunchMsaView/components/BlastQuery/CachedBlastResults.tsx +21 -20
- package/src/LaunchMsaView/components/BlastQuery/CachedBlastResultsLaunch.test.tsx +92 -0
- package/src/LaunchMsaView/components/BlastQuery/consts.ts +1 -1
- package/src/LaunchMsaView/components/BlastQuery/useCachedBlastResults.test.ts +84 -0
- package/src/LaunchMsaView/components/BlastQuery/useCachedBlastResults.ts +13 -4
- package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +72 -47
- package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +12 -37
- package/src/LaunchMsaView/components/OrthologQuery/OrthologPanel.tsx +20 -8
- package/src/LaunchMsaView/components/OrthologQuery/QuerySpeciesSelect.tsx +46 -32
- package/src/LaunchMsaView/components/OrthologQuery/useQuerySpecies.test.ts +108 -0
- package/src/LaunchMsaView/components/PastedAlignmentFields.tsx +66 -0
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.test.tsx +97 -0
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +20 -7
- package/src/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.ts +1 -1
- package/src/LaunchMsaView/components/QueryRowSelector.test.tsx +44 -0
- package/src/LaunchMsaView/components/QueryRowSelector.tsx +9 -4
- package/src/LaunchMsaView/components/SubmitCancelActions.tsx +4 -16
- package/src/LaunchMsaView/components/TabPanel.tsx +15 -1
- package/src/LaunchMsaView/components/launchPlacement.tsx +29 -1
- package/src/LaunchMsaView/components/pastedAlignmentLaunch.test.tsx +135 -0
- package/src/LaunchMsaView/components/transcriptChoice.test.tsx +140 -0
- package/src/LaunchMsaView/components/transcriptChoice.tsx +64 -0
- package/src/LaunchMsaView/components/useFeatureSequence.ts +0 -1
- package/src/LaunchMsaView/components/useTranscriptSelection.ts +18 -10
- package/src/LaunchMsaView/detectQueryRow.ts +2 -2
- package/src/LaunchMsaView/extendStateModel.test.ts +30 -9
- package/src/LaunchMsaView/getTranscriptFeatures.test.ts +71 -0
- package/src/LaunchMsaView/index.ts +18 -20
- package/src/LaunchMsaView/launchTarget.ts +1 -1
- package/src/LaunchMsaView/useQueryRowName.test.ts +35 -0
- package/src/LaunchMsaView/useQueryRowName.ts +10 -4
- package/src/LaunchMsaView/util.ts +12 -20
- package/src/MsaViewPanel/afterCreateAutoruns.ts +34 -11
- package/src/MsaViewPanel/doLaunchBlast.test.ts +43 -0
- package/src/MsaViewPanel/doLaunchBlast.ts +15 -13
- package/src/MsaViewPanel/doLaunchOrthologs.test.ts +26 -8
- package/src/MsaViewPanel/doLaunchOrthologs.ts +5 -12
- package/src/MsaViewPanel/loadProteinDomains.ts +2 -3
- package/src/MsaViewPanel/model.test.ts +22 -0
- package/src/MsaViewPanel/model.ts +9 -2
- package/src/MsaViewPanel/processInit.test.ts +23 -0
- package/src/MsaViewPanel/resolveConnectedTranscript.test.ts +17 -1
- package/src/MsaViewPanel/resolveConnectedTranscript.ts +4 -0
- package/src/MsaViewPanel/sessionHighlights.test.ts +15 -1
- package/src/MsaViewPanel/sessionHighlights.ts +7 -6
- package/src/MsaViewPanel/storedData.test.ts +11 -0
- package/src/MsaViewPanel/structureConnection.ts +8 -3
- package/src/MsaViewPanel/util.ts +9 -6
- package/src/MsaViewPanel/viewReport.ts +1 -1
- package/src/OrthoFinderMsaAdapter/parseResults.test.ts +9 -0
- package/src/OrthoFinderMsaAdapter/parseResults.ts +4 -5
- package/src/readinessConformance.test.ts +4 -3
- package/src/utils/domainCache.ts +3 -26
- package/src/utils/ebiBlast.ts +1 -3
- package/src/utils/ebiJobDispatcher.test.ts +84 -1
- package/src/utils/ebiJobDispatcher.ts +36 -6
- package/src/utils/fetch.test.ts +37 -0
- package/src/utils/fetch.ts +9 -2
- package/src/utils/idb.test.ts +2 -5
- package/src/utils/idb.ts +49 -3
- package/src/utils/msa.test.ts +28 -0
- package/src/utils/msa.ts +8 -1
- package/src/utils/msaIndex.ts +7 -6
- package/src/utils/msaRows.test.ts +35 -0
- package/src/utils/msaRows.ts +5 -1
- package/src/utils/ncbiOrthologs.test.ts +54 -0
- package/src/utils/ncbiOrthologs.ts +34 -26
- package/src/utils/pantherOrthologs.ts +41 -55
- package/src/utils/searchCache.ts +1 -0
- package/src/utils/taxonomyNames.ts +3 -26
- package/src/utils/unirefHomologs.test.ts +19 -0
- package/src/utils/unirefHomologs.ts +25 -22
- package/src/version.ts +1 -1
- package/dist/chunks/BgzipFastaMsaAdapter-Y3LYQRQL.js +0 -6
- package/dist/chunks/BgzipFastaMsaAdapter-Y3LYQRQL.js.map +0 -7
- package/dist/chunks/LaunchMsaViewDialog-KQVGEMH7.js +0 -3
- package/dist/chunks/LaunchMsaViewDialog-KQVGEMH7.js.map +0 -7
- package/dist/chunks/OrthoFinderMsaAdapter-BAVVTZHO.js +0 -2
- package/dist/chunks/chunk-CKXVJK5K.js +0 -2
- package/dist/chunks/chunk-DW5INM5K.js +0 -2
- package/dist/chunks/chunk-JUE34WZU.js +0 -2
- package/dist/chunks/chunk-JUE34WZU.js.map +0 -7
- package/dist/chunks/chunk-KHRURQPK.js +0 -2
- package/dist/chunks/chunk-KHRURQPK.js.map +0 -7
- package/dist/chunks/chunk-PWNKL3ZK.js.map +0 -7
- package/dist/chunks/chunk-SIKAYSRK.js +0 -3
- package/dist/chunks/chunk-SIKAYSRK.js.map +0 -7
- package/dist/chunks/chunk-SM4GL27T.js +0 -164
- package/dist/chunks/chunk-SM4GL27T.js.map +0 -7
- package/dist/chunks/chunk-V47MJ4IY.js +0 -2
- package/dist/chunks/chunk-V47MJ4IY.js.map +0 -7
- package/dist/chunks/chunk-WE35XW3J.js +0 -3
- package/dist/chunks/chunk-ZJGFEUGM.js +0 -6
- package/dist/chunks/chunk-ZWQTJTRR.js +0 -2
- package/dist/chunks/dist-N36EMMBB.js +0 -2
- package/dist/chunks/model-M736UK5B.js +0 -11
- package/dist/chunks/model-M736UK5B.js.map +0 -7
- package/dist/chunks/renderToSvg-KUOP36MW.js +0 -2
- /package/dist/chunks/{HelpDialog-3IR65NL3.js.map → HelpDialog-UF43YYX4.js.map} +0 -0
- /package/dist/chunks/{MsaViewPanel-3GZG5IYS.js.map → MsaViewPanel-VARPO7OL.js.map} +0 -0
- /package/dist/chunks/{chunk-7ZEXFLSY.js.map → chunk-DH2QUEKI.js.map} +0 -0
- /package/dist/chunks/{chunk-TEYYBCMF.js.map → chunk-GP2EFH2U.js.map} +0 -0
- /package/dist/chunks/{dist-N36EMMBB.js.map → dist-QLG7JP2Z.js.map} +0 -0
- /package/dist/chunks/{renderToSvg-KUOP36MW.js.map → renderToSvg-PM3HEMVM.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import { observer } from 'mobx-react';
|
|
|
6
6
|
import { makeStyles } from 'tss-react/mui';
|
|
7
7
|
import { featureMatchesId, getLinearGenomeView, getSortedTranscriptFeatures, } from '../../util';
|
|
8
8
|
import { builtAlignmentLook, launchConnectedView } from '../launchConnectedView';
|
|
9
|
-
import {
|
|
9
|
+
import { useSubmitPlacement } from '../launchPlacement';
|
|
10
10
|
const useStyles = makeStyles()({
|
|
11
11
|
header: {
|
|
12
12
|
display: 'flex',
|
|
@@ -49,34 +49,31 @@ export function describeSearch(result) {
|
|
|
49
49
|
.filter(Boolean)
|
|
50
50
|
.join(' / ');
|
|
51
51
|
}
|
|
52
|
-
const CachedBlastResults = observer(function ({ model,
|
|
52
|
+
const CachedBlastResults = observer(function ({ model, submit, feature, cached: { results, handleDelete, handleClearAll }, }) {
|
|
53
53
|
const { classes } = useStyles();
|
|
54
54
|
const view = getLinearGenomeView(model);
|
|
55
55
|
const [operationError, setOperationError] = useState();
|
|
56
|
-
const
|
|
56
|
+
const { commitPlacement } = useSubmitPlacement(model);
|
|
57
57
|
const handleUseCached = (cached) => {
|
|
58
58
|
// the cached query row is the plugin's default `QUERY`, translated from
|
|
59
59
|
// the transcript stored as transcriptId, so that transcript relinks it
|
|
60
60
|
const { transcriptId, msa, tree, treeMetadata } = cached;
|
|
61
|
-
launchConnectedView({
|
|
61
|
+
submit(() => launchConnectedView({
|
|
62
62
|
view,
|
|
63
63
|
feature: transcriptId
|
|
64
64
|
? getSortedTranscriptFeatures(feature).find(t => featureMatchesId(t, transcriptId))
|
|
65
65
|
: undefined,
|
|
66
|
-
placement:
|
|
66
|
+
placement: commitPlacement(),
|
|
67
67
|
displayName: `BLAST - ${getResultDisplayName(cached)}`,
|
|
68
68
|
...builtAlignmentLook,
|
|
69
69
|
data: { msa, tree, treeMetadata },
|
|
70
|
-
})
|
|
71
|
-
console.error(e);
|
|
72
|
-
setOperationError(e);
|
|
73
|
-
});
|
|
70
|
+
}));
|
|
74
71
|
};
|
|
75
72
|
return (React.createElement("div", null,
|
|
76
73
|
operationError ? React.createElement(ErrorMessage, { error: operationError }) : null,
|
|
77
74
|
React.createElement("div", { className: classes.header },
|
|
78
75
|
React.createElement(Typography, { variant: "subtitle1" },
|
|
79
|
-
"Cached
|
|
76
|
+
"Cached searches (",
|
|
80
77
|
results.length,
|
|
81
78
|
")"),
|
|
82
79
|
React.createElement(Button, { size: "small", color: "error", onClick: async () => {
|
|
@@ -88,7 +85,7 @@ const CachedBlastResults = observer(function ({ model, handleClose, feature, cac
|
|
|
88
85
|
setOperationError(e);
|
|
89
86
|
}
|
|
90
87
|
} }, "Clear results for this gene")),
|
|
91
|
-
React.createElement(List, { dense: true, className: classes.resultList }, results.map(result => (React.createElement(ListItem, { key: result.id, disablePadding: true, secondaryAction: React.createElement(IconButton, { edge: "end", size: "small", onClick: async (e) => {
|
|
88
|
+
React.createElement(List, { dense: true, className: classes.resultList }, results.map(result => (React.createElement(ListItem, { key: result.id, disablePadding: true, secondaryAction: React.createElement(IconButton, { edge: "end", size: "small", "aria-label": `Delete ${getResultDisplayName(result)} - ${describeSearch(result)}`, onClick: async (e) => {
|
|
92
89
|
e.stopPropagation();
|
|
93
90
|
try {
|
|
94
91
|
setOperationError(undefined);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SimpleFeature } from '@jbrowse/core/util';
|
|
4
|
+
import { cleanup, fireEvent, render, screen } from '@testing-library/react';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
6
|
+
import { afterEach, beforeEach, expect, test, vi } from 'vitest';
|
|
7
|
+
import { launchMsaView } from '../../../utils/launchMsaView';
|
|
8
|
+
import { LAUNCH_PLACEMENT_KEY } from '../../../utils/workspaces';
|
|
9
|
+
import { useLaunchSubmit } from '../launchConnectedView';
|
|
10
|
+
import CachedBlastResults from './CachedBlastResults';
|
|
11
|
+
const tiling = { id: 'session', setUseWorkspaces() { }, setPendingMove() { } };
|
|
12
|
+
const view = { id: 'lgv' };
|
|
13
|
+
vi.mock('@jbrowse/core/util', async (importOriginal) => ({
|
|
14
|
+
...(await importOriginal()),
|
|
15
|
+
getSession: () => tiling,
|
|
16
|
+
getContainingView: () => view,
|
|
17
|
+
}));
|
|
18
|
+
vi.mock('../../../utils/launchMsaView', () => ({
|
|
19
|
+
launchMsaView: vi.fn(),
|
|
20
|
+
}));
|
|
21
|
+
const mockLaunch = vi.mocked(launchMsaView);
|
|
22
|
+
beforeEach(() => {
|
|
23
|
+
localStorage.clear();
|
|
24
|
+
mockLaunch.mockReset();
|
|
25
|
+
mockLaunch.mockReturnValue(new Promise(() => { }));
|
|
26
|
+
});
|
|
27
|
+
afterEach(() => {
|
|
28
|
+
cleanup();
|
|
29
|
+
});
|
|
30
|
+
const result = {
|
|
31
|
+
id: 'k',
|
|
32
|
+
geneName: 'TP53',
|
|
33
|
+
proteinSequence: 'MKV',
|
|
34
|
+
blastDatabase: 'uniprotkb_swissprot',
|
|
35
|
+
msa: '>QUERY\nMKV',
|
|
36
|
+
tree: '',
|
|
37
|
+
treeMetadata: '{}',
|
|
38
|
+
rid: 'r',
|
|
39
|
+
timestamp: 0,
|
|
40
|
+
};
|
|
41
|
+
const feature = new SimpleFeature({
|
|
42
|
+
uniqueId: 'gene1',
|
|
43
|
+
refName: 'chr1',
|
|
44
|
+
start: 0,
|
|
45
|
+
end: 10,
|
|
46
|
+
});
|
|
47
|
+
const model = {};
|
|
48
|
+
const Harness = observer(function Harness() {
|
|
49
|
+
const { submit } = useLaunchSubmit(() => { });
|
|
50
|
+
return (React.createElement(CachedBlastResults, { model: model, submit: submit, feature: feature, cached: {
|
|
51
|
+
results: [result],
|
|
52
|
+
error: undefined,
|
|
53
|
+
isLoading: false,
|
|
54
|
+
handleDelete: async () => { },
|
|
55
|
+
handleClearAll: async () => { },
|
|
56
|
+
} }));
|
|
57
|
+
});
|
|
58
|
+
test('a double click while the view loads opens one view', () => {
|
|
59
|
+
render(React.createElement(Harness, null));
|
|
60
|
+
const row = screen.getByText(/TP53/);
|
|
61
|
+
fireEvent.click(row);
|
|
62
|
+
fireEvent.click(row);
|
|
63
|
+
expect(mockLaunch).toHaveBeenCalledTimes(1);
|
|
64
|
+
});
|
|
65
|
+
test('opening a cached result remembers the placement it opened with', () => {
|
|
66
|
+
render(React.createElement(Harness, null));
|
|
67
|
+
fireEvent.click(screen.getByText(/TP53/));
|
|
68
|
+
expect(mockLaunch.mock.calls[0]?.[1].placement).toBe('splitRight');
|
|
69
|
+
expect(localStorage.getItem(LAUNCH_PLACEMENT_KEY)).toBe('splitRight');
|
|
70
|
+
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Only used to build the link-out on the manual panel, which sends the user to
|
|
3
3
|
* NCBI's own site to run BLAST there. Nothing fetches this url: NCBI stopped
|
|
4
4
|
* sending Access-Control-Allow-Origin to third-party origins, so a browser
|
|
5
|
-
* cannot read a response from it at all. See docs/blast.md.
|
|
5
|
+
* cannot read a response from it at all. See agent-docs/blast-design.md.
|
|
6
6
|
*/
|
|
7
7
|
export declare const BASE_BLAST_URL = "https://blast.ncbi.nlm.nih.gov/Blast.cgi";
|
|
8
8
|
/** The aligners EBI's Job Dispatcher runs, each a tool name at their REST api. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Only used to build the link-out on the manual panel, which sends the user to
|
|
3
3
|
* NCBI's own site to run BLAST there. Nothing fetches this url: NCBI stopped
|
|
4
4
|
* sending Access-Control-Allow-Origin to third-party origins, so a browser
|
|
5
|
-
* cannot read a response from it at all. See docs/blast.md.
|
|
5
|
+
* cannot read a response from it at all. See agent-docs/blast-design.md.
|
|
6
6
|
*/
|
|
7
7
|
export const BASE_BLAST_URL = 'https://blast.ncbi.nlm.nih.gov/Blast.cgi';
|
|
8
8
|
/** The aligners EBI's Job Dispatcher runs, each a tool name at their REST api. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Feature } from '@jbrowse/core/util';
|
|
2
|
+
export declare function useCachedBlastResults(feature: Feature): {
|
|
2
3
|
results: import("../../../utils/blastCache").CachedBlastResult[];
|
|
3
4
|
error: unknown;
|
|
4
5
|
isLoading: boolean;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { deleteCachedResult, getAllCachedResults, } from '../../../utils/blastCache';
|
|
2
2
|
import { useFetch } from '../../../utils/useFetch';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { getGeneIdentifiers, getTranscriptFeatures } from '../../util';
|
|
4
|
+
export function useCachedBlastResults(feature) {
|
|
5
|
+
const { data: results, error, isLoading, mutate, } = useFetch(['cached-blast', feature.id()], async () => {
|
|
6
|
+
const geneIds = getGeneIdentifiers(feature);
|
|
7
|
+
const transcriptIds = getTranscriptFeatures(feature).map(t => t.id());
|
|
5
8
|
const cached = await getAllCachedResults();
|
|
6
|
-
return cached.filter(r => r.geneId
|
|
9
|
+
return cached.filter(r => r.geneId
|
|
10
|
+
? geneIds.includes(r.geneId)
|
|
11
|
+
: !!r.transcriptId && transcriptIds.includes(r.transcriptId));
|
|
7
12
|
});
|
|
8
13
|
return {
|
|
9
14
|
results: results ?? [],
|
|
@@ -13,7 +18,7 @@ export function useCachedBlastResults(geneIds) {
|
|
|
13
18
|
await deleteCachedResult(id);
|
|
14
19
|
mutate();
|
|
15
20
|
},
|
|
16
|
-
// deletes only what this hook listed, i.e. the results for
|
|
21
|
+
// deletes only what this hook listed, i.e. the results for this feature.
|
|
17
22
|
// The list the user is looking at is gene-scoped, so a store-wide clear here
|
|
18
23
|
// would silently throw away every other gene's cached alignments too
|
|
19
24
|
handleClearAll: async () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { SimpleFeature } from '@jbrowse/core/util';
|
|
3
|
+
import { renderHook, waitFor } from '@testing-library/react';
|
|
4
|
+
import { expect, test, vi } from 'vitest';
|
|
5
|
+
import { getAllCachedResults } from '../../../utils/blastCache';
|
|
6
|
+
import { useCachedBlastResults } from './useCachedBlastResults';
|
|
7
|
+
vi.mock('../../../utils/blastCache', () => ({
|
|
8
|
+
getAllCachedResults: vi.fn(),
|
|
9
|
+
deleteCachedResult: vi.fn(),
|
|
10
|
+
}));
|
|
11
|
+
function row(id, fields) {
|
|
12
|
+
return {
|
|
13
|
+
id,
|
|
14
|
+
proteinSequence: 'MKV',
|
|
15
|
+
blastDatabase: 'uniprotkb_swissprot',
|
|
16
|
+
msa: '',
|
|
17
|
+
tree: '',
|
|
18
|
+
treeMetadata: '{}',
|
|
19
|
+
rid: 'r',
|
|
20
|
+
timestamp: 0,
|
|
21
|
+
...fields,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
vi.mocked(getAllCachedResults).mockResolvedValue([
|
|
25
|
+
row('by-gene', { geneId: 'gene1' }),
|
|
26
|
+
row('orphan-transcript', { transcriptId: 'tx1' }),
|
|
27
|
+
row('isoform', { geneId: undefined, transcriptId: 'tx2' }),
|
|
28
|
+
row('elsewhere', { geneId: 'gene9', transcriptId: 'tx9' }),
|
|
29
|
+
row('other-gene-same-transcript-id', {
|
|
30
|
+
geneId: 'gene9',
|
|
31
|
+
transcriptId: 'tx1',
|
|
32
|
+
}),
|
|
33
|
+
]);
|
|
34
|
+
function cds(id) {
|
|
35
|
+
return { uniqueId: id, refName: 'chr1', start: 0, end: 30, type: 'CDS' };
|
|
36
|
+
}
|
|
37
|
+
async function listed(feature) {
|
|
38
|
+
const { result } = renderHook(() => useCachedBlastResults(feature));
|
|
39
|
+
await waitFor(() => {
|
|
40
|
+
expect(result.current.isLoading).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
return result.current.results.map(r => r.id);
|
|
43
|
+
}
|
|
44
|
+
test('a top-level transcript with no parent gene lists its own runs', async () => {
|
|
45
|
+
const transcript = new SimpleFeature({
|
|
46
|
+
uniqueId: 'tx1',
|
|
47
|
+
refName: 'chr1',
|
|
48
|
+
start: 0,
|
|
49
|
+
end: 30,
|
|
50
|
+
type: 'mRNA',
|
|
51
|
+
subfeatures: [cds('tx1-cds')],
|
|
52
|
+
});
|
|
53
|
+
expect(await listed(transcript)).toEqual(['orphan-transcript']);
|
|
54
|
+
});
|
|
55
|
+
test('a gene lists runs by gene id and by any of its transcripts', async () => {
|
|
56
|
+
const gene = new SimpleFeature({
|
|
57
|
+
uniqueId: 'gene1',
|
|
58
|
+
refName: 'chr1',
|
|
59
|
+
start: 0,
|
|
60
|
+
end: 30,
|
|
61
|
+
type: 'gene',
|
|
62
|
+
subfeatures: [
|
|
63
|
+
{
|
|
64
|
+
uniqueId: 'tx2',
|
|
65
|
+
refName: 'chr1',
|
|
66
|
+
start: 0,
|
|
67
|
+
end: 30,
|
|
68
|
+
type: 'mRNA',
|
|
69
|
+
subfeatures: [cds('tx2-cds')],
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
});
|
|
73
|
+
expect(await listed(gene)).toEqual(['by-gene', 'isoform']);
|
|
74
|
+
});
|
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useId, useState } from 'react';
|
|
2
2
|
import { Dialog } from '@jbrowse/core/ui';
|
|
3
3
|
import { getSession } from '@jbrowse/core/util';
|
|
4
4
|
import { Tab, Tabs } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
+
import { getLinearGenomeView } from '../util';
|
|
6
7
|
import BlastPanel from './BlastQuery/BlastPanel';
|
|
7
8
|
import HelpButton from './HelpButton';
|
|
8
9
|
import ManualMSALoader from './ManualMSALoader/ManualMSALoader';
|
|
9
10
|
import OrthologPanel from './OrthologQuery/OrthologPanel';
|
|
10
11
|
import PreLoadedMSA from './PreLoadedMSA/PreLoadedMSADataPanel';
|
|
11
12
|
import { readMsaDatasets } from './PreLoadedMSA/types';
|
|
12
|
-
import TabPanel from './TabPanel';
|
|
13
|
+
import TabPanel, { tabProps } from './TabPanel';
|
|
13
14
|
import { LaunchPlacementProvider } from './launchPlacement';
|
|
15
|
+
import { TranscriptChoiceProvider } from './transcriptChoice';
|
|
14
16
|
const LaunchMsaViewDialog = observer(function LaunchMsaViewDialog({ handleClose, feature, model, preferredTranscriptId, }) {
|
|
15
17
|
const session = getSession(model);
|
|
16
18
|
const datasets = readMsaDatasets(session.jbrowse);
|
|
17
19
|
const hasPreloadedDatasets = !!datasets?.length;
|
|
20
|
+
const tabsId = useId();
|
|
18
21
|
// orthologs first, and the default: it answers the same question in ~10s
|
|
19
22
|
// that BLAST takes 10+ minutes to answer worse (see utils/ncbiOrthologs.ts)
|
|
20
23
|
const [value, setValue] = useState('orthologs');
|
|
21
24
|
return (React.createElement(Dialog, { maxWidth: "xl", title: "Launch MSA view", open: true, onClose: handleClose },
|
|
22
25
|
React.createElement(LaunchPlacementProvider, null,
|
|
23
|
-
React.createElement(
|
|
24
|
-
React.createElement(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
React.createElement(
|
|
34
|
-
|
|
35
|
-
React.createElement(
|
|
36
|
-
|
|
37
|
-
React.createElement(
|
|
38
|
-
|
|
39
|
-
React.createElement(
|
|
26
|
+
React.createElement(TranscriptChoiceProvider, { feature: feature, view: getLinearGenomeView(model), preferredTranscriptId: preferredTranscriptId },
|
|
27
|
+
React.createElement("div", { style: { display: 'flex', alignItems: 'center' } },
|
|
28
|
+
React.createElement(Tabs, { value: value, onChange: (_event, newValue) => {
|
|
29
|
+
setValue(newValue);
|
|
30
|
+
} },
|
|
31
|
+
React.createElement(Tab, { label: "Orthologs", value: "orthologs", ...tabProps(tabsId, 'orthologs') }),
|
|
32
|
+
React.createElement(Tab, { label: "BLAST query", value: "ncbi_blast", ...tabProps(tabsId, 'ncbi_blast') }),
|
|
33
|
+
hasPreloadedDatasets ? (React.createElement(Tab, { label: "Pre-loaded MSA datasets", value: "preloaded_msa", ...tabProps(tabsId, 'preloaded_msa') })) : null,
|
|
34
|
+
React.createElement(Tab, { label: "Manual upload", value: "manual_msa", ...tabProps(tabsId, 'manual_msa') })),
|
|
35
|
+
React.createElement(HelpButton, null)),
|
|
36
|
+
React.createElement(TabPanel, { value: value, index: "orthologs", tabsId: tabsId },
|
|
37
|
+
React.createElement(OrthologPanel, { handleClose: handleClose, feature: feature, model: model, preferredTranscriptId: preferredTranscriptId })),
|
|
38
|
+
React.createElement(TabPanel, { value: value, index: "ncbi_blast", tabsId: tabsId },
|
|
39
|
+
React.createElement(BlastPanel, { handleClose: handleClose, feature: feature, model: model, preferredTranscriptId: preferredTranscriptId })),
|
|
40
|
+
hasPreloadedDatasets ? (React.createElement(TabPanel, { value: value, index: "preloaded_msa", tabsId: tabsId },
|
|
41
|
+
React.createElement(PreLoadedMSA, { model: model, feature: feature, handleClose: handleClose, preferredTranscriptId: preferredTranscriptId }))) : null,
|
|
42
|
+
React.createElement(TabPanel, { value: value, index: "manual_msa", tabsId: tabsId },
|
|
43
|
+
React.createElement(ManualMSALoader, { model: model, feature: feature, handleClose: handleClose, preferredTranscriptId: preferredTranscriptId }))))));
|
|
40
44
|
});
|
|
41
45
|
export default LaunchMsaViewDialog;
|
|
@@ -4,11 +4,11 @@ import { openLocation } from '@jbrowse/core/util/io';
|
|
|
4
4
|
import { FormControl, FormControlLabel, Radio, RadioGroup } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
6
|
import { makeStyles } from 'tss-react/mui';
|
|
7
|
-
import TextField2 from '../../../components/TextField2';
|
|
8
7
|
import { useDebounced, useFetch } from '../../../utils/useFetch';
|
|
9
8
|
import { useQueryRowName } from '../../useQueryRowName';
|
|
10
|
-
import {
|
|
9
|
+
import { getLinearGenomeView, getViewTitle } from '../../util';
|
|
11
10
|
import LaunchPanelContent from '../LaunchPanelContent';
|
|
11
|
+
import PastedAlignmentFields from '../PastedAlignmentFields';
|
|
12
12
|
import QueryRowSelector from '../QueryRowSelector';
|
|
13
13
|
import SequenceStatusMessage from '../SequenceStatus';
|
|
14
14
|
import SubmitCancelActions from '../SubmitCancelActions';
|
|
@@ -36,11 +36,8 @@ const useStyles = makeStyles()({
|
|
|
36
36
|
fileContainer: {
|
|
37
37
|
maxWidth: 500,
|
|
38
38
|
},
|
|
39
|
-
msaInput: {
|
|
40
|
-
marginBottom: 20,
|
|
41
|
-
},
|
|
42
39
|
});
|
|
43
|
-
const ManualMSALoader = observer(function
|
|
40
|
+
const ManualMSALoader = observer(function ManualMSALoader({ model, feature, handleClose, preferredTranscriptId, }) {
|
|
44
41
|
const view = getLinearGenomeView(model);
|
|
45
42
|
const { classes } = useStyles();
|
|
46
43
|
const { launchError, submit } = useLaunchSubmit(handleClose);
|
|
@@ -68,16 +65,11 @@ const ManualMSALoader = observer(function PreLoadedMSA2({ model, feature, handle
|
|
|
68
65
|
React.createElement(FormControlLabel, { value: "text", control: React.createElement(Radio, null), label: "Paste text" }))),
|
|
69
66
|
React.createElement("div", { className: classes.inputContainer }, inputMethod === 'file' ? (React.createElement("div", { className: classes.fileContainer },
|
|
70
67
|
React.createElement(FileSelector, { name: "MSA File .aln (Clustal), .fa/.mfa (aligned FASTA), .stock (Stockholm), etc)", inline: true, location: msaFileLocation, setLocation: setMsaFileLocation }),
|
|
71
|
-
React.createElement(FileSelector, { name: "Tree file .nh (Newick) or .asn (NCBI COBALT ASN.1)", inline: true, location: treeFileLocation, setLocation: setTreeFileLocation }))) : (React.createElement(
|
|
72
|
-
React.createElement(TextField2, { variant: "outlined", name: "MSA", multiline: true, minRows: 5, className: classes.msaInput, maxRows: 10, fullWidth: true, placeholder: "Paste MSA here", value: msaText, onChange: event => {
|
|
73
|
-
setMsaText(event.target.value);
|
|
74
|
-
} }),
|
|
75
|
-
React.createElement(TextField2, { variant: "outlined", name: "Tree", multiline: true, minRows: 5, maxRows: 10, fullWidth: true, placeholder: "Paste newick tree (optional)", value: treeText, onChange: event => {
|
|
76
|
-
setTreeText(event.target.value);
|
|
77
|
-
} })))),
|
|
68
|
+
React.createElement(FileSelector, { name: "Tree file .nh (Newick) or .asn (NCBI COBALT ASN.1)", inline: true, location: treeFileLocation, setLocation: setTreeFileLocation }))) : (React.createElement(PastedAlignmentFields, { msaText: msaText, setMsaText: setMsaText, treeText: treeText, setTreeText: setTreeText }))),
|
|
78
69
|
React.createElement(TranscriptSelector, { feature: feature, ...transcriptSelection }),
|
|
79
|
-
React.createElement(QueryRowSelector, { ...queryRow })),
|
|
70
|
+
React.createElement(QueryRowSelector, { ...queryRow, sequenceStatus: sequenceStatus })),
|
|
80
71
|
React.createElement(SubmitCancelActions, { model: model, hint: React.createElement(SequenceStatusMessage, { status: sequenceStatus }), submitDisabled: !selectedTranscript ||
|
|
72
|
+
sequenceStatus === 'loading' ||
|
|
81
73
|
(inputMethod === 'file' && (!msaFileLocation || msaFile.isLoading)) ||
|
|
82
74
|
(inputMethod === 'text' && !msaText.trim()), onSubmit: placement => {
|
|
83
75
|
if (selectedTranscript) {
|
|
@@ -85,7 +77,7 @@ const ManualMSALoader = observer(function PreLoadedMSA2({ model, feature, handle
|
|
|
85
77
|
view,
|
|
86
78
|
feature: selectedTranscript,
|
|
87
79
|
placement,
|
|
88
|
-
displayName:
|
|
80
|
+
displayName: getViewTitle(feature, selectedTranscript),
|
|
89
81
|
querySeqName: queryRow.querySeqName,
|
|
90
82
|
querySeqOffset: queryRow.querySeqOffset,
|
|
91
83
|
...(inputMethod === 'file'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import { LoadingEllipses } from '@jbrowse/core/ui';
|
|
2
3
|
import { Typography } from '@mui/material';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
import { makeStyles } from 'tss-react/mui';
|
|
@@ -14,7 +15,7 @@ import TranscriptSelector from '../TranscriptSelector';
|
|
|
14
15
|
import { builtAlignmentLook, launchConnectedView, useLaunchSubmit, } from '../launchConnectedView';
|
|
15
16
|
import { useTranscriptSelection } from '../useTranscriptSelection';
|
|
16
17
|
import OrthologSourceSelect, { useStoredOrthologSource, } from './OrthologSourceSelect';
|
|
17
|
-
import QuerySpeciesSelect from './QuerySpeciesSelect';
|
|
18
|
+
import QuerySpeciesSelect, { useQuerySpecies } from './QuerySpeciesSelect';
|
|
18
19
|
const useStyles = makeStyles()({
|
|
19
20
|
selectField: {
|
|
20
21
|
width: 180,
|
|
@@ -31,10 +32,11 @@ const OrthologPanel = observer(function ({ handleClose, feature, model, preferre
|
|
|
31
32
|
const { classes } = useStyles();
|
|
32
33
|
const view = getLinearGenomeView(model);
|
|
33
34
|
const { launchError, submit } = useLaunchSubmit(handleClose);
|
|
34
|
-
const [taxId, setTaxId] = useState(9606);
|
|
35
35
|
const [source, setSource] = useStoredOrthologSource();
|
|
36
36
|
const [msaAlgorithm, setMsaAlgorithm] = useStoredMsaAlgorithm();
|
|
37
37
|
const [maxSpecies, setMaxSpecies] = useState(String(defaultMaxSpecies));
|
|
38
|
+
const species = useQuerySpecies(view.assemblyNames[0]);
|
|
39
|
+
const { taxId } = species;
|
|
38
40
|
const geneCandidates = useMemo(() => getGeneIdentifiers(feature), [feature]);
|
|
39
41
|
const transcriptSelection = useTranscriptSelection({
|
|
40
42
|
feature,
|
|
@@ -50,7 +52,7 @@ const OrthologPanel = observer(function ({ handleClose, feature, model, preferre
|
|
|
50
52
|
React.createElement(Typography, { variant: "body2" }, "Precomputed orthologs, one gene per species, looked up rather than searched for. No BLAST job to queue, and with the in-browser aligner no job at all."),
|
|
51
53
|
React.createElement("div", null,
|
|
52
54
|
React.createElement(OrthologSourceSelect, { className: classes.selectField, value: source, onChange: setSource }),
|
|
53
|
-
React.createElement(QuerySpeciesSelect, { className: classes.selectField,
|
|
55
|
+
React.createElement(QuerySpeciesSelect, { className: classes.selectField, species: species }),
|
|
54
56
|
React.createElement(MsaAlgorithmSelect, { className: classes.selectField, value: msaAlgorithm, onChange: setMsaAlgorithm }),
|
|
55
57
|
React.createElement(TextField2, { variant: "outlined", label: "Rows to align", className: classes.selectField, type: "number", value: maxSpecies, onChange: event => {
|
|
56
58
|
setMaxSpecies(event.target.value);
|
|
@@ -58,8 +60,8 @@ const OrthologPanel = observer(function ({ handleClose, feature, model, preferre
|
|
|
58
60
|
? rowsHint[source](rowCount)
|
|
59
61
|
: 'a whole number, 2 or more' })),
|
|
60
62
|
React.createElement(TranscriptSelector, { feature: feature, ...transcriptSelection })),
|
|
61
|
-
React.createElement(SubmitCancelActions, { model: model, hint: React.createElement(SequenceStatusMessage, { status: sequenceStatus }), submitDisabled: !proteinSequence || !rowCountValid, onSubmit: placement => {
|
|
62
|
-
if (selectedTranscript) {
|
|
63
|
+
React.createElement(SubmitCancelActions, { model: model, hint: sequenceStatus !== 'ready' ? (React.createElement(SequenceStatusMessage, { status: sequenceStatus })) : taxId !== undefined ? null : species.resolving ? (React.createElement(LoadingEllipses, { message: "Looking up the query species" })) : (React.createElement(Typography, { color: "textSecondary", variant: "body2" }, "name a query species NCBI knows")), submitDisabled: !proteinSequence || !rowCountValid || taxId === undefined, onSubmit: placement => {
|
|
64
|
+
if (selectedTranscript && taxId !== undefined) {
|
|
63
65
|
submit(() => launchConnectedView({
|
|
64
66
|
view,
|
|
65
67
|
feature: selectedTranscript,
|
|
@@ -8,10 +8,16 @@ import React from 'react';
|
|
|
8
8
|
* organism rather than to nothing, and the only place that surfaces is the gene
|
|
9
9
|
* lookup, as "could not resolve NLRP1 in taxon 9986".
|
|
10
10
|
*/
|
|
11
|
-
declare
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
export declare function useQuerySpecies(assemblyName?: string): {
|
|
12
|
+
taxId: number | undefined;
|
|
13
|
+
resolving: boolean;
|
|
14
|
+
text: string;
|
|
15
|
+
resolved: string | undefined;
|
|
16
|
+
error: unknown;
|
|
17
|
+
setTyped: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
18
|
+
};
|
|
19
|
+
declare const QuerySpeciesSelect: ({ species: { taxId, text, resolved, error, setTyped }, className, }: {
|
|
20
|
+
species: ReturnType<typeof useQuerySpecies>;
|
|
15
21
|
className?: string;
|
|
16
22
|
}) => React.JSX.Element;
|
|
17
23
|
export default QuerySpeciesSelect;
|
|
@@ -24,6 +24,7 @@ async function describeTaxon(query, signal) {
|
|
|
24
24
|
.join(' ');
|
|
25
25
|
return { taxId, label: label || `taxon ${taxId}` };
|
|
26
26
|
}
|
|
27
|
+
const defaultTaxId = 9606;
|
|
27
28
|
/**
|
|
28
29
|
* The species the query gene came from, as free text resolved against NCBI's
|
|
29
30
|
* taxonomy rather than picked from a fixed list.
|
|
@@ -33,7 +34,7 @@ async function describeTaxon(query, signal) {
|
|
|
33
34
|
* organism rather than to nothing, and the only place that surfaces is the gene
|
|
34
35
|
* lookup, as "could not resolve NLRP1 in taxon 9986".
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
|
+
export function useQuerySpecies(assemblyName) {
|
|
37
38
|
// undefined until the user types, which is what makes the two lookups
|
|
38
39
|
// exclusive rather than both firing on open
|
|
39
40
|
const [typed, setTyped] = useState();
|
|
@@ -48,29 +49,43 @@ const QuerySpeciesSelect = observer(function QuerySpeciesSelect({ value, assembl
|
|
|
48
49
|
// is not just waste: eutils allows 3 requests a second and throttles by
|
|
49
50
|
// answering without CORS headers, so all four fired on open and the browser
|
|
50
51
|
// reported the throttle as "blocked by CORS policy" in the helper text.
|
|
51
|
-
const
|
|
52
|
+
const fromAssembly = useFetch(assemblyName && typed === undefined
|
|
52
53
|
? [assemblyName, 'assembly-species']
|
|
53
|
-
: null, signal => resolveAssemblySpecies(assemblyName, signal)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
: null, signal => resolveAssemblySpecies(assemblyName, signal));
|
|
55
|
+
const fromText = useFetch(debounced?.trim() ? [debounced.trim(), 'taxon'] : null, signal => describeTaxon(debounced, signal));
|
|
56
|
+
const taxId = typed === undefined
|
|
57
|
+
? fromAssembly.isLoading || fromAssembly.error
|
|
58
|
+
? undefined
|
|
59
|
+
: (fromAssembly.data?.taxId ?? defaultTaxId)
|
|
60
|
+
: typed === debounced
|
|
61
|
+
? fromText.data?.taxId
|
|
62
|
+
: undefined;
|
|
63
|
+
return {
|
|
64
|
+
taxId,
|
|
65
|
+
resolving: typed === undefined
|
|
66
|
+
? fromAssembly.isLoading
|
|
67
|
+
: typed !== debounced || fromText.isLoading,
|
|
68
|
+
// derived, not seeded through an effect: whatever the user typed wins, and
|
|
69
|
+
// until they type anything the assembly's species does, so a lookup that
|
|
70
|
+
// lands while they are mid-word cannot overwrite the field
|
|
71
|
+
text: typed ??
|
|
72
|
+
fromAssembly.data?.speciesName ??
|
|
73
|
+
(fromAssembly.error ? '' : 'human'),
|
|
74
|
+
resolved: typed === undefined
|
|
75
|
+
? fromAssembly.data?.speciesName
|
|
76
|
+
: fromText.data?.label,
|
|
77
|
+
error: typed === undefined ? fromAssembly.error : fromText.error,
|
|
78
|
+
setTyped,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
const QuerySpeciesSelect = observer(function QuerySpeciesSelect({ species: { taxId, text, resolved, error, setTyped }, className, }) {
|
|
70
82
|
return (React.createElement(TextField2, { variant: "outlined", label: "Query species", className: className, value: text, onChange: event => {
|
|
71
83
|
setTyped(event.target.value);
|
|
72
84
|
}, error: !!error, helperText: error
|
|
73
85
|
? `${error}`
|
|
74
|
-
: (resolved ??
|
|
86
|
+
: (resolved ??
|
|
87
|
+
(taxId === undefined
|
|
88
|
+
? 'the species this gene is from'
|
|
89
|
+
: `the species this gene is from (taxon ${taxId})`)) }));
|
|
75
90
|
});
|
|
76
91
|
export default QuerySpeciesSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|