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.
Files changed (311) hide show
  1. package/README.md +21 -76
  2. package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +2 -4
  3. package/dist/AddHighlightModel/MsaToGenomeHighlight.js +10 -5
  4. package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.d.ts +4 -2
  5. package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +28 -22
  6. package/dist/LaunchMsaView/codingFeature.d.ts +1 -0
  7. package/dist/LaunchMsaView/codingFeature.js +1 -1
  8. package/dist/LaunchMsaView/components/BlastQuery/BlastAutomaticPanel.js +12 -8
  9. package/dist/LaunchMsaView/components/BlastQuery/BlastManualPanel.d.ts +1 -1
  10. package/dist/LaunchMsaView/components/BlastQuery/BlastManualPanel.js +12 -20
  11. package/dist/LaunchMsaView/components/BlastQuery/BlastPanel.d.ts +1 -17
  12. package/dist/LaunchMsaView/components/BlastQuery/BlastPanel.js +8 -9
  13. package/dist/LaunchMsaView/components/BlastQuery/BlastPanel.test.d.ts +1 -0
  14. package/dist/LaunchMsaView/components/BlastQuery/BlastPanel.test.js +72 -0
  15. package/dist/LaunchMsaView/components/BlastQuery/BlastSettingsDialog.d.ts +1 -1
  16. package/dist/LaunchMsaView/components/BlastQuery/CachedBlastResults.d.ts +3 -2
  17. package/dist/LaunchMsaView/components/BlastQuery/CachedBlastResults.js +8 -11
  18. package/dist/LaunchMsaView/components/BlastQuery/CachedBlastResultsLaunch.test.d.ts +1 -0
  19. package/dist/LaunchMsaView/components/BlastQuery/CachedBlastResultsLaunch.test.js +70 -0
  20. package/dist/LaunchMsaView/components/BlastQuery/consts.d.ts +1 -1
  21. package/dist/LaunchMsaView/components/BlastQuery/consts.js +1 -1
  22. package/dist/LaunchMsaView/components/BlastQuery/useCachedBlastResults.d.ts +2 -1
  23. package/dist/LaunchMsaView/components/BlastQuery/useCachedBlastResults.js +9 -4
  24. package/dist/LaunchMsaView/components/BlastQuery/useCachedBlastResults.test.d.ts +1 -0
  25. package/dist/LaunchMsaView/components/BlastQuery/useCachedBlastResults.test.js +74 -0
  26. package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js +23 -19
  27. package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +7 -15
  28. package/dist/LaunchMsaView/components/OrthologQuery/OrthologPanel.js +7 -5
  29. package/dist/LaunchMsaView/components/OrthologQuery/QuerySpeciesSelect.d.ts +10 -4
  30. package/dist/LaunchMsaView/components/OrthologQuery/QuerySpeciesSelect.js +35 -20
  31. package/dist/LaunchMsaView/components/OrthologQuery/useQuerySpecies.test.d.ts +1 -0
  32. package/dist/LaunchMsaView/components/OrthologQuery/useQuerySpecies.test.js +94 -0
  33. package/dist/LaunchMsaView/components/PastedAlignmentFields.d.ts +8 -0
  34. package/dist/LaunchMsaView/components/PastedAlignmentFields.js +23 -0
  35. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +8 -5
  36. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.test.d.ts +1 -0
  37. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.test.js +79 -0
  38. package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.d.ts +2 -1
  39. package/dist/LaunchMsaView/components/QueryRowSelector.d.ts +3 -1
  40. package/dist/LaunchMsaView/components/QueryRowSelector.js +7 -2
  41. package/dist/LaunchMsaView/components/QueryRowSelector.test.d.ts +1 -0
  42. package/dist/LaunchMsaView/components/QueryRowSelector.test.js +23 -0
  43. package/dist/LaunchMsaView/components/SubmitCancelActions.js +3 -13
  44. package/dist/LaunchMsaView/components/TabPanel.d.ts +6 -1
  45. package/dist/LaunchMsaView/components/TabPanel.js +8 -2
  46. package/dist/LaunchMsaView/components/launchPlacement.d.ts +7 -0
  47. package/dist/LaunchMsaView/components/launchPlacement.js +22 -1
  48. package/dist/LaunchMsaView/components/pastedAlignmentLaunch.test.d.ts +1 -0
  49. package/dist/LaunchMsaView/components/pastedAlignmentLaunch.test.js +102 -0
  50. package/dist/LaunchMsaView/components/transcriptChoice.d.ts +23 -0
  51. package/dist/LaunchMsaView/components/transcriptChoice.js +19 -0
  52. package/dist/LaunchMsaView/components/transcriptChoice.test.d.ts +1 -0
  53. package/dist/LaunchMsaView/components/transcriptChoice.test.js +112 -0
  54. package/dist/LaunchMsaView/components/useFeatureSequence.d.ts +0 -4
  55. package/dist/LaunchMsaView/components/useFeatureSequence.js +0 -1
  56. package/dist/LaunchMsaView/components/useTranscriptSelection.d.ts +1 -1
  57. package/dist/LaunchMsaView/components/useTranscriptSelection.js +11 -7
  58. package/dist/LaunchMsaView/detectQueryRow.d.ts +3 -2
  59. package/dist/LaunchMsaView/extendStateModel.test.js +18 -9
  60. package/dist/LaunchMsaView/getTranscriptFeatures.test.d.ts +1 -0
  61. package/dist/LaunchMsaView/getTranscriptFeatures.test.js +51 -0
  62. package/dist/LaunchMsaView/index.js +17 -19
  63. package/dist/LaunchMsaView/launchTarget.d.ts +2 -1
  64. package/dist/LaunchMsaView/useQueryRowName.d.ts +1 -1
  65. package/dist/LaunchMsaView/useQueryRowName.js +6 -3
  66. package/dist/LaunchMsaView/useQueryRowName.test.js +26 -0
  67. package/dist/LaunchMsaView/util.d.ts +1 -0
  68. package/dist/LaunchMsaView/util.js +9 -16
  69. package/dist/MsaViewPanel/afterCreateAutoruns.d.ts +1 -5
  70. package/dist/MsaViewPanel/afterCreateAutoruns.js +30 -9
  71. package/dist/MsaViewPanel/doLaunchBlast.js +11 -11
  72. package/dist/MsaViewPanel/doLaunchBlast.test.js +34 -0
  73. package/dist/MsaViewPanel/doLaunchOrthologs.js +5 -13
  74. package/dist/MsaViewPanel/doLaunchOrthologs.test.js +24 -8
  75. package/dist/MsaViewPanel/model.d.ts +7 -7
  76. package/dist/MsaViewPanel/model.js +6 -3
  77. package/dist/MsaViewPanel/model.test.js +19 -0
  78. package/dist/MsaViewPanel/processInit.test.js +20 -0
  79. package/dist/MsaViewPanel/resolveConnectedTranscript.d.ts +1 -0
  80. package/dist/MsaViewPanel/resolveConnectedTranscript.js +3 -0
  81. package/dist/MsaViewPanel/resolveConnectedTranscript.test.js +13 -0
  82. package/dist/MsaViewPanel/sessionHighlights.d.ts +1 -1
  83. package/dist/MsaViewPanel/sessionHighlights.js +3 -5
  84. package/dist/MsaViewPanel/sessionHighlights.test.js +12 -1
  85. package/dist/MsaViewPanel/storedData.test.js +9 -0
  86. package/dist/MsaViewPanel/structureConnection.js +4 -2
  87. package/dist/MsaViewPanel/util.js +8 -6
  88. package/dist/MsaViewPanel/viewReport.d.ts +1 -1
  89. package/dist/MsaViewPanel/viewReport.js +1 -1
  90. package/dist/OrthoFinderMsaAdapter/parseResults.js +4 -5
  91. package/dist/OrthoFinderMsaAdapter/parseResults.test.js +3 -0
  92. package/dist/chunks/{AboutDialog-QD4L7BYU.js → AboutDialog-XNWCXUML.js} +2 -2
  93. package/dist/chunks/{AboutDialog-QD4L7BYU.js.map → AboutDialog-XNWCXUML.js.map} +1 -1
  94. package/dist/chunks/{AnnotationFileDialog-IDJWWQDB.js → AnnotationFileDialog-Z4FLEMTF.js} +2 -2
  95. package/dist/chunks/{AnnotationFileDialog-IDJWWQDB.js.map → AnnotationFileDialog-Z4FLEMTF.js.map} +1 -1
  96. package/dist/chunks/BgzipFastaMsaAdapter-4IP2B4CV.js +6 -0
  97. package/dist/chunks/BgzipFastaMsaAdapter-4IP2B4CV.js.map +7 -0
  98. package/dist/chunks/{ExportSVGDialog-R7ANUOII.js → ExportSVGDialog-T3RSUIP6.js} +2 -2
  99. package/dist/chunks/{ExportSVGDialog-R7ANUOII.js.map → ExportSVGDialog-T3RSUIP6.js.map} +1 -1
  100. package/dist/chunks/{FeatureDialog-A7LFBVGM.js → FeatureDialog-SGSCRRJC.js} +2 -2
  101. package/dist/chunks/{FeatureDialog-A7LFBVGM.js.map → FeatureDialog-SGSCRRJC.js.map} +1 -1
  102. package/dist/chunks/{GapThresholdDialog-LP4UN3SB.js → GapThresholdDialog-UOSORGY3.js} +2 -2
  103. package/dist/chunks/{GapThresholdDialog-LP4UN3SB.js.map → GapThresholdDialog-UOSORGY3.js.map} +1 -1
  104. package/dist/chunks/{GoToDialog-3HM7K5RZ.js → GoToDialog-4NSGTRAF.js} +2 -2
  105. package/dist/chunks/{GoToDialog-3HM7K5RZ.js.map → GoToDialog-4NSGTRAF.js.map} +1 -1
  106. package/dist/chunks/{HelpDialog-GJKUU5Z6.js → HelpDialog-ATDGYZHQ.js} +2 -2
  107. package/dist/chunks/{HelpDialog-GJKUU5Z6.js.map → HelpDialog-ATDGYZHQ.js.map} +1 -1
  108. package/dist/chunks/{HelpDialog-3IR65NL3.js → HelpDialog-UF43YYX4.js} +2 -2
  109. package/dist/chunks/LaunchMsaViewDialog-AWSNOLTZ.js +3 -0
  110. package/dist/chunks/LaunchMsaViewDialog-AWSNOLTZ.js.map +7 -0
  111. package/dist/chunks/{MetadataDialog-4YUN5FJL.js → MetadataDialog-VUQ4FSPL.js} +2 -2
  112. package/dist/chunks/{MetadataDialog-4YUN5FJL.js.map → MetadataDialog-VUQ4FSPL.js.map} +1 -1
  113. package/dist/chunks/{MsaViewPanel-3GZG5IYS.js → MsaViewPanel-VARPO7OL.js} +2 -2
  114. package/dist/chunks/OrthoFinderMsaAdapter-OJVBY4EU.js +2 -0
  115. package/dist/chunks/{OrthoFinderMsaAdapter-BAVVTZHO.js.map → OrthoFinderMsaAdapter-OJVBY4EU.js.map} +2 -2
  116. package/dist/chunks/{TrackInfoDialog-D423HM63.js → TrackInfoDialog-KVLFUXQ6.js} +2 -2
  117. package/dist/chunks/{TrackInfoDialog-D423HM63.js.map → TrackInfoDialog-KVLFUXQ6.js.map} +1 -1
  118. package/dist/chunks/{TreeNodeInfoDialog-IXNBDQYV.js → TreeNodeInfoDialog-WOLJQH4P.js} +2 -2
  119. package/dist/chunks/{TreeNodeInfoDialog-IXNBDQYV.js.map → TreeNodeInfoDialog-WOLJQH4P.js.map} +1 -1
  120. package/dist/chunks/{chunk-LNMEYTCN.js → chunk-44ZCMBOI.js} +1 -1
  121. package/dist/chunks/{chunk-LNMEYTCN.js.map → chunk-44ZCMBOI.js.map} +1 -1
  122. package/dist/chunks/chunk-5UVNR5ZZ.js +164 -0
  123. package/dist/chunks/chunk-5UVNR5ZZ.js.map +7 -0
  124. package/dist/chunks/{chunk-X5QA4AF6.js → chunk-6ZLRUWM2.js} +2 -2
  125. package/dist/chunks/{chunk-X5QA4AF6.js.map → chunk-6ZLRUWM2.js.map} +1 -1
  126. package/dist/chunks/{chunk-BD6Y2ERQ.js → chunk-75TUMBKQ.js} +2 -2
  127. package/dist/chunks/{chunk-BD6Y2ERQ.js.map → chunk-75TUMBKQ.js.map} +1 -1
  128. package/dist/chunks/chunk-BJPVMTGT.js +2 -0
  129. package/dist/chunks/chunk-BJPVMTGT.js.map +7 -0
  130. package/dist/chunks/{chunk-7ZEXFLSY.js → chunk-DH2QUEKI.js} +1 -1
  131. package/dist/chunks/chunk-GNNLVWKA.js +6 -0
  132. package/dist/chunks/{chunk-ZJGFEUGM.js.map → chunk-GNNLVWKA.js.map} +2 -2
  133. package/dist/chunks/{chunk-TEYYBCMF.js → chunk-GP2EFH2U.js} +2 -2
  134. package/dist/chunks/chunk-HED42VNJ.js +2 -0
  135. package/dist/chunks/{chunk-ZWQTJTRR.js.map → chunk-HED42VNJ.js.map} +2 -2
  136. package/dist/chunks/chunk-IJ2GGGFR.js +2 -0
  137. package/dist/chunks/{chunk-CKXVJK5K.js.map → chunk-IJ2GGGFR.js.map} +1 -1
  138. package/dist/chunks/{chunk-3MNW5BKS.js → chunk-KENFRWWU.js} +1 -1
  139. package/dist/chunks/{chunk-3MNW5BKS.js.map → chunk-KENFRWWU.js.map} +1 -1
  140. package/dist/chunks/chunk-L72SS7RL.js +2 -0
  141. package/dist/chunks/chunk-L72SS7RL.js.map +7 -0
  142. package/dist/chunks/{chunk-XNNIIXGD.js → chunk-N5YJBTY5.js} +1 -1
  143. package/dist/chunks/{chunk-XNNIIXGD.js.map → chunk-N5YJBTY5.js.map} +1 -1
  144. package/dist/chunks/{chunk-CREQPIFJ.js → chunk-OSF7I4IV.js} +2 -2
  145. package/dist/chunks/{chunk-CREQPIFJ.js.map → chunk-OSF7I4IV.js.map} +1 -1
  146. package/dist/chunks/chunk-OUJA5TD2.js +3 -0
  147. package/dist/chunks/{chunk-WE35XW3J.js.map → chunk-OUJA5TD2.js.map} +4 -4
  148. package/dist/chunks/chunk-Q6V6EHAM.js +2 -0
  149. package/dist/chunks/chunk-Q6V6EHAM.js.map +7 -0
  150. package/dist/chunks/{chunk-LFBMB523.js → chunk-TDFMPJVU.js} +1 -1
  151. package/dist/chunks/{chunk-LFBMB523.js.map → chunk-TDFMPJVU.js.map} +1 -1
  152. package/dist/chunks/chunk-UZ74KTAJ.js +2 -0
  153. package/dist/chunks/{chunk-DW5INM5K.js.map → chunk-UZ74KTAJ.js.map} +1 -1
  154. package/dist/chunks/chunk-WWDZENCA.js +2 -0
  155. package/dist/chunks/chunk-WWDZENCA.js.map +7 -0
  156. package/dist/chunks/{chunk-YOLY6H5C.js → chunk-YX7QETL5.js} +2 -2
  157. package/dist/chunks/{chunk-YOLY6H5C.js.map → chunk-YX7QETL5.js.map} +2 -2
  158. package/dist/chunks/{chunk-PWNKL3ZK.js → chunk-ZAUQ25BW.js} +2 -2
  159. package/dist/chunks/chunk-ZAUQ25BW.js.map +7 -0
  160. package/dist/chunks/chunk-ZBTXUYNT.js +3 -0
  161. package/dist/chunks/chunk-ZBTXUYNT.js.map +7 -0
  162. package/dist/chunks/dist-QLG7JP2Z.js +2 -0
  163. package/dist/chunks/model-YTUGVNIN.js +11 -0
  164. package/dist/chunks/model-YTUGVNIN.js.map +7 -0
  165. package/dist/chunks/renderToSvg-PM3HEMVM.js +2 -0
  166. package/dist/jbrowse-plugin-msaview.esm.js +2 -2
  167. package/dist/jbrowse-plugin-msaview.esm.js.map +4 -4
  168. package/dist/readinessConformance.test.js +4 -1
  169. package/dist/utils/domainCache.js +3 -16
  170. package/dist/utils/ebiJobDispatcher.d.ts +4 -11
  171. package/dist/utils/ebiJobDispatcher.js +26 -5
  172. package/dist/utils/ebiJobDispatcher.test.js +71 -1
  173. package/dist/utils/fetch.js +8 -2
  174. package/dist/utils/fetch.test.d.ts +1 -0
  175. package/dist/utils/fetch.test.js +22 -0
  176. package/dist/utils/idb.d.ts +3 -1
  177. package/dist/utils/idb.js +21 -3
  178. package/dist/utils/idb.test.js +2 -5
  179. package/dist/utils/msa.js +8 -1
  180. package/dist/utils/msa.test.d.ts +1 -0
  181. package/dist/utils/msa.test.js +20 -0
  182. package/dist/utils/msaIndex.d.ts +1 -0
  183. package/dist/utils/msaIndex.js +5 -2
  184. package/dist/utils/msaRows.js +4 -1
  185. package/dist/utils/msaRows.test.d.ts +1 -0
  186. package/dist/utils/msaRows.test.js +32 -0
  187. package/dist/utils/ncbiOrthologs.d.ts +5 -7
  188. package/dist/utils/ncbiOrthologs.js +26 -24
  189. package/dist/utils/ncbiOrthologs.test.js +48 -1
  190. package/dist/utils/pantherOrthologs.d.ts +43 -3
  191. package/dist/utils/pantherOrthologs.js +26 -45
  192. package/dist/utils/searchCache.d.ts +1 -0
  193. package/dist/utils/taxonomyNames.js +3 -16
  194. package/dist/utils/unirefHomologs.js +15 -16
  195. package/dist/utils/unirefHomologs.test.js +11 -0
  196. package/dist/version.d.ts +1 -1
  197. package/dist/version.js +1 -1
  198. package/package.json +27 -25
  199. package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +2 -6
  200. package/src/AddHighlightModel/MsaToGenomeHighlight.tsx +10 -5
  201. package/src/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.ts +42 -34
  202. package/src/LaunchMsaView/codingFeature.ts +1 -1
  203. package/src/LaunchMsaView/components/BlastQuery/BlastAutomaticPanel.tsx +14 -11
  204. package/src/LaunchMsaView/components/BlastQuery/BlastManualPanel.tsx +22 -43
  205. package/src/LaunchMsaView/components/BlastQuery/BlastPanel.test.tsx +102 -0
  206. package/src/LaunchMsaView/components/BlastQuery/BlastPanel.tsx +43 -32
  207. package/src/LaunchMsaView/components/BlastQuery/BlastSettingsDialog.tsx +1 -1
  208. package/src/LaunchMsaView/components/BlastQuery/CachedBlastResults.tsx +21 -20
  209. package/src/LaunchMsaView/components/BlastQuery/CachedBlastResultsLaunch.test.tsx +92 -0
  210. package/src/LaunchMsaView/components/BlastQuery/consts.ts +1 -1
  211. package/src/LaunchMsaView/components/BlastQuery/useCachedBlastResults.test.ts +84 -0
  212. package/src/LaunchMsaView/components/BlastQuery/useCachedBlastResults.ts +13 -4
  213. package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +72 -47
  214. package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +12 -37
  215. package/src/LaunchMsaView/components/OrthologQuery/OrthologPanel.tsx +20 -8
  216. package/src/LaunchMsaView/components/OrthologQuery/QuerySpeciesSelect.tsx +46 -32
  217. package/src/LaunchMsaView/components/OrthologQuery/useQuerySpecies.test.ts +108 -0
  218. package/src/LaunchMsaView/components/PastedAlignmentFields.tsx +66 -0
  219. package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.test.tsx +97 -0
  220. package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +20 -7
  221. package/src/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.ts +1 -1
  222. package/src/LaunchMsaView/components/QueryRowSelector.test.tsx +44 -0
  223. package/src/LaunchMsaView/components/QueryRowSelector.tsx +9 -4
  224. package/src/LaunchMsaView/components/SubmitCancelActions.tsx +4 -16
  225. package/src/LaunchMsaView/components/TabPanel.tsx +15 -1
  226. package/src/LaunchMsaView/components/launchPlacement.tsx +29 -1
  227. package/src/LaunchMsaView/components/pastedAlignmentLaunch.test.tsx +135 -0
  228. package/src/LaunchMsaView/components/transcriptChoice.test.tsx +140 -0
  229. package/src/LaunchMsaView/components/transcriptChoice.tsx +64 -0
  230. package/src/LaunchMsaView/components/useFeatureSequence.ts +0 -1
  231. package/src/LaunchMsaView/components/useTranscriptSelection.ts +18 -10
  232. package/src/LaunchMsaView/detectQueryRow.ts +2 -2
  233. package/src/LaunchMsaView/extendStateModel.test.ts +30 -9
  234. package/src/LaunchMsaView/getTranscriptFeatures.test.ts +71 -0
  235. package/src/LaunchMsaView/index.ts +18 -20
  236. package/src/LaunchMsaView/launchTarget.ts +1 -1
  237. package/src/LaunchMsaView/useQueryRowName.test.ts +35 -0
  238. package/src/LaunchMsaView/useQueryRowName.ts +10 -4
  239. package/src/LaunchMsaView/util.ts +12 -20
  240. package/src/MsaViewPanel/afterCreateAutoruns.ts +34 -11
  241. package/src/MsaViewPanel/doLaunchBlast.test.ts +43 -0
  242. package/src/MsaViewPanel/doLaunchBlast.ts +15 -13
  243. package/src/MsaViewPanel/doLaunchOrthologs.test.ts +26 -8
  244. package/src/MsaViewPanel/doLaunchOrthologs.ts +5 -12
  245. package/src/MsaViewPanel/loadProteinDomains.ts +2 -3
  246. package/src/MsaViewPanel/model.test.ts +22 -0
  247. package/src/MsaViewPanel/model.ts +9 -2
  248. package/src/MsaViewPanel/processInit.test.ts +23 -0
  249. package/src/MsaViewPanel/resolveConnectedTranscript.test.ts +17 -1
  250. package/src/MsaViewPanel/resolveConnectedTranscript.ts +4 -0
  251. package/src/MsaViewPanel/sessionHighlights.test.ts +15 -1
  252. package/src/MsaViewPanel/sessionHighlights.ts +7 -6
  253. package/src/MsaViewPanel/storedData.test.ts +11 -0
  254. package/src/MsaViewPanel/structureConnection.ts +8 -3
  255. package/src/MsaViewPanel/util.ts +9 -6
  256. package/src/MsaViewPanel/viewReport.ts +1 -1
  257. package/src/OrthoFinderMsaAdapter/parseResults.test.ts +9 -0
  258. package/src/OrthoFinderMsaAdapter/parseResults.ts +4 -5
  259. package/src/readinessConformance.test.ts +4 -3
  260. package/src/utils/domainCache.ts +3 -26
  261. package/src/utils/ebiBlast.ts +1 -3
  262. package/src/utils/ebiJobDispatcher.test.ts +84 -1
  263. package/src/utils/ebiJobDispatcher.ts +36 -6
  264. package/src/utils/fetch.test.ts +37 -0
  265. package/src/utils/fetch.ts +9 -2
  266. package/src/utils/idb.test.ts +2 -5
  267. package/src/utils/idb.ts +49 -3
  268. package/src/utils/msa.test.ts +28 -0
  269. package/src/utils/msa.ts +8 -1
  270. package/src/utils/msaIndex.ts +7 -6
  271. package/src/utils/msaRows.test.ts +35 -0
  272. package/src/utils/msaRows.ts +5 -1
  273. package/src/utils/ncbiOrthologs.test.ts +54 -0
  274. package/src/utils/ncbiOrthologs.ts +34 -26
  275. package/src/utils/pantherOrthologs.ts +41 -55
  276. package/src/utils/searchCache.ts +1 -0
  277. package/src/utils/taxonomyNames.ts +3 -26
  278. package/src/utils/unirefHomologs.test.ts +19 -0
  279. package/src/utils/unirefHomologs.ts +25 -22
  280. package/src/version.ts +1 -1
  281. package/dist/chunks/BgzipFastaMsaAdapter-Y3LYQRQL.js +0 -6
  282. package/dist/chunks/BgzipFastaMsaAdapter-Y3LYQRQL.js.map +0 -7
  283. package/dist/chunks/LaunchMsaViewDialog-KQVGEMH7.js +0 -3
  284. package/dist/chunks/LaunchMsaViewDialog-KQVGEMH7.js.map +0 -7
  285. package/dist/chunks/OrthoFinderMsaAdapter-BAVVTZHO.js +0 -2
  286. package/dist/chunks/chunk-CKXVJK5K.js +0 -2
  287. package/dist/chunks/chunk-DW5INM5K.js +0 -2
  288. package/dist/chunks/chunk-JUE34WZU.js +0 -2
  289. package/dist/chunks/chunk-JUE34WZU.js.map +0 -7
  290. package/dist/chunks/chunk-KHRURQPK.js +0 -2
  291. package/dist/chunks/chunk-KHRURQPK.js.map +0 -7
  292. package/dist/chunks/chunk-PWNKL3ZK.js.map +0 -7
  293. package/dist/chunks/chunk-SIKAYSRK.js +0 -3
  294. package/dist/chunks/chunk-SIKAYSRK.js.map +0 -7
  295. package/dist/chunks/chunk-SM4GL27T.js +0 -164
  296. package/dist/chunks/chunk-SM4GL27T.js.map +0 -7
  297. package/dist/chunks/chunk-V47MJ4IY.js +0 -2
  298. package/dist/chunks/chunk-V47MJ4IY.js.map +0 -7
  299. package/dist/chunks/chunk-WE35XW3J.js +0 -3
  300. package/dist/chunks/chunk-ZJGFEUGM.js +0 -6
  301. package/dist/chunks/chunk-ZWQTJTRR.js +0 -2
  302. package/dist/chunks/dist-N36EMMBB.js +0 -2
  303. package/dist/chunks/model-M736UK5B.js +0 -11
  304. package/dist/chunks/model-M736UK5B.js.map +0 -7
  305. package/dist/chunks/renderToSvg-KUOP36MW.js +0 -2
  306. /package/dist/chunks/{HelpDialog-3IR65NL3.js.map → HelpDialog-UF43YYX4.js.map} +0 -0
  307. /package/dist/chunks/{MsaViewPanel-3GZG5IYS.js.map → MsaViewPanel-VARPO7OL.js.map} +0 -0
  308. /package/dist/chunks/{chunk-7ZEXFLSY.js.map → chunk-DH2QUEKI.js.map} +0 -0
  309. /package/dist/chunks/{chunk-TEYYBCMF.js.map → chunk-GP2EFH2U.js.map} +0 -0
  310. /package/dist/chunks/{dist-N36EMMBB.js.map → dist-QLG7JP2Z.js.map} +0 -0
  311. /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 { useLaunchPlacement } from '../launchPlacement';
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, handleClose, feature, cached: { results, handleDelete, handleClearAll }, }) {
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 [sideBySide] = useLaunchPlacement();
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: sideBySide ? 'splitRight' : 'stack',
66
+ placement: commitPlacement(),
67
67
  displayName: `BLAST - ${getResultDisplayName(cached)}`,
68
68
  ...builtAlignmentLook,
69
69
  data: { msa, tree, treeMetadata },
70
- }).then(handleClose, (e) => {
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 BLAST Results (",
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,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
- export declare function useCachedBlastResults(geneIds: string[]): {
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
- export function useCachedBlastResults(geneIds) {
4
- const { data: results, error, isLoading, mutate, } = useFetch(`cached-blast-${geneIds.join(',')}`, async () => {
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 && geneIds.includes(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 these gene ids.
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,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("div", { style: { display: 'flex', alignItems: 'center' } },
24
- React.createElement(Tabs, { value: value, onChange: (_event, newValue) => {
25
- setValue(newValue);
26
- } },
27
- React.createElement(Tab, { label: "Orthologs", value: "orthologs" }),
28
- React.createElement(Tab, { label: "BLAST query", value: "ncbi_blast" }),
29
- hasPreloadedDatasets ? (React.createElement(Tab, { label: "Pre-loaded MSA datasets", value: "preloaded_msa" })) : null,
30
- React.createElement(Tab, { label: "Manual upload", value: "manual_msa" })),
31
- React.createElement(HelpButton, null)),
32
- React.createElement(TabPanel, { value: value, index: "orthologs" },
33
- React.createElement(OrthologPanel, { handleClose: handleClose, feature: feature, model: model, preferredTranscriptId: preferredTranscriptId })),
34
- React.createElement(TabPanel, { value: value, index: "ncbi_blast" },
35
- React.createElement(BlastPanel, { handleClose: handleClose, feature: feature, model: model, preferredTranscriptId: preferredTranscriptId })),
36
- hasPreloadedDatasets ? (React.createElement(TabPanel, { value: value, index: "preloaded_msa" },
37
- React.createElement(PreLoadedMSA, { model: model, feature: feature, handleClose: handleClose, preferredTranscriptId: preferredTranscriptId }))) : null,
38
- React.createElement(TabPanel, { value: value, index: "manual_msa" },
39
- React.createElement(ManualMSALoader, { model: model, feature: feature, handleClose: handleClose, preferredTranscriptId: preferredTranscriptId })))));
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 { getGeneDisplayName, getLinearGenomeView } from '../../util';
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 PreLoadedMSA2({ model, feature, handleClose, preferredTranscriptId, }) {
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(React.Fragment, null,
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: getGeneDisplayName(selectedTranscript),
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, value: taxId, assemblyName: view.assemblyNames[0], onChange: setTaxId }),
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 const QuerySpeciesSelect: ({ value, assemblyName, onChange, className, }: {
12
- value: number;
13
- assemblyName?: string;
14
- onChange: (taxId: number) => void;
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
- const QuerySpeciesSelect = observer(function QuerySpeciesSelect({ value, assemblyName, onChange, className, }) {
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 { data: fromAssembly } = useFetch(assemblyName && typed === undefined
52
+ const fromAssembly = useFetch(assemblyName && typed === undefined
52
53
  ? [assemblyName, 'assembly-species']
53
- : null, signal => resolveAssemblySpecies(assemblyName, signal), {
54
- onSuccess: found => {
55
- if (found) {
56
- onChange(found.taxId);
57
- }
58
- },
59
- });
60
- const { data: fromText, error } = useFetch(debounced?.trim() ? [debounced.trim(), 'taxon'] : null, signal => describeTaxon(debounced, signal), {
61
- onSuccess: ({ taxId }) => {
62
- onChange(taxId);
63
- },
64
- });
65
- // derived, not seeded through an effect: whatever the user typed wins, and
66
- // until they type anything the assembly's species does, so a lookup that
67
- // lands while they are mid-word cannot overwrite the field
68
- const text = typed ?? fromAssembly?.speciesName ?? 'human';
69
- const resolved = typed === undefined ? fromAssembly?.speciesName : fromText?.label;
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 ?? `the species this gene is from (taxon ${value})`) }));
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;