jbrowse-plugin-msaview 2.2.11 → 2.3.2

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 (129) hide show
  1. package/dist/AddHighlightModel/index.d.ts +1 -1
  2. package/dist/AddHighlightModel/index.js.map +1 -1
  3. package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.d.ts +2 -1
  4. package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +1 -1
  5. package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js.map +1 -1
  6. package/dist/BgzipFastaMsaAdapter/configSchema.d.ts +1 -1
  7. package/dist/BgzipFastaMsaAdapter/configSchema.js.map +1 -1
  8. package/dist/BgzipFastaMsaAdapter/index.d.ts +1 -1
  9. package/dist/BgzipFastaMsaAdapter/index.js.map +1 -1
  10. package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.d.ts +1 -1
  11. package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js +1 -1
  12. package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js.map +1 -1
  13. package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js.map +1 -1
  14. package/dist/LaunchMsaView/components/LaunchMsaViewDialog.d.ts +1 -1
  15. package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
  16. package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.d.ts +1 -1
  17. package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +1 -1
  18. package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -1
  19. package/dist/LaunchMsaView/components/ManualMSALoader/launchView.d.ts +1 -1
  20. package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js.map +1 -1
  21. package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.d.ts +1 -2
  22. package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js +21 -14
  23. package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js.map +1 -1
  24. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.d.ts +1 -1
  25. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +32 -35
  26. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -1
  27. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.d.ts +1 -1
  28. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js +2 -2
  29. package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js.map +1 -1
  30. package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.d.ts +1 -1
  31. package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js.map +1 -1
  32. package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.d.ts +2 -0
  33. package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js +1 -0
  34. package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js.map +1 -1
  35. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.d.ts +1 -1
  36. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +6 -8
  37. package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
  38. package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.d.ts +2 -2
  39. package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js.map +1 -1
  40. package/dist/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.d.ts +1 -1
  41. package/dist/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.js.map +1 -1
  42. package/dist/LaunchMsaView/components/TranscriptSelector.d.ts +3 -3
  43. package/dist/LaunchMsaView/components/TranscriptSelector.js +4 -4
  44. package/dist/LaunchMsaView/components/TranscriptSelector.js.map +1 -1
  45. package/dist/LaunchMsaView/components/useTranscriptSelection.d.ts +1 -1
  46. package/dist/LaunchMsaView/components/useTranscriptSelection.js +1 -2
  47. package/dist/LaunchMsaView/components/useTranscriptSelection.js.map +1 -1
  48. package/dist/LaunchMsaView/components/util.js +1 -1
  49. package/dist/LaunchMsaView/components/util.js.map +1 -1
  50. package/dist/LaunchMsaView/index.d.ts +1 -1
  51. package/dist/LaunchMsaView/index.js.map +1 -1
  52. package/dist/LaunchMsaView/util.d.ts +1 -0
  53. package/dist/LaunchMsaView/util.js +10 -0
  54. package/dist/LaunchMsaView/util.js.map +1 -1
  55. package/dist/MsaViewPanel/afterCreateAutoruns.d.ts +10 -0
  56. package/dist/MsaViewPanel/afterCreateAutoruns.js +258 -0
  57. package/dist/MsaViewPanel/afterCreateAutoruns.js.map +1 -0
  58. package/dist/MsaViewPanel/blosum62.d.ts +2 -0
  59. package/dist/MsaViewPanel/blosum62.js +628 -0
  60. package/dist/MsaViewPanel/blosum62.js.map +1 -0
  61. package/dist/MsaViewPanel/components/LoadingBLAST.d.ts +1 -1
  62. package/dist/MsaViewPanel/components/LoadingBLAST.js.map +1 -1
  63. package/dist/MsaViewPanel/components/MsaViewPanel.d.ts +1 -1
  64. package/dist/MsaViewPanel/components/MsaViewPanel.js.map +1 -1
  65. package/dist/MsaViewPanel/doLaunchBlast.d.ts +1 -1
  66. package/dist/MsaViewPanel/doLaunchBlast.js.map +1 -1
  67. package/dist/MsaViewPanel/genomeToMSA.d.ts +1 -1
  68. package/dist/MsaViewPanel/genomeToMSA.js.map +1 -1
  69. package/dist/MsaViewPanel/index.d.ts +1 -1
  70. package/dist/MsaViewPanel/index.js.map +1 -1
  71. package/dist/MsaViewPanel/model.d.ts +25 -39
  72. package/dist/MsaViewPanel/model.js +17 -309
  73. package/dist/MsaViewPanel/model.js.map +1 -1
  74. package/dist/MsaViewPanel/msaDataStore.d.ts +3 -4
  75. package/dist/MsaViewPanel/msaDataStore.js +59 -173
  76. package/dist/MsaViewPanel/msaDataStore.js.map +1 -1
  77. package/dist/MsaViewPanel/pairwiseAlignment.d.ts +0 -7
  78. package/dist/MsaViewPanel/pairwiseAlignment.js +1 -636
  79. package/dist/MsaViewPanel/pairwiseAlignment.js.map +1 -1
  80. package/dist/MsaViewPanel/structureConnection.js +1 -5
  81. package/dist/MsaViewPanel/structureConnection.js.map +1 -1
  82. package/dist/MsaViewPanel/util.d.ts +1 -1
  83. package/dist/index.d.ts +1 -1
  84. package/dist/index.js.map +1 -1
  85. package/dist/jbrowse-plugin-msaview.umd.production.min.js +30 -30
  86. package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
  87. package/dist/utils/msa.js +35 -77
  88. package/dist/utils/msa.js.map +1 -1
  89. package/dist/utils/ncbiBlast.js +1 -10
  90. package/dist/utils/ncbiBlast.js.map +1 -1
  91. package/package.json +31 -28
  92. package/src/AddHighlightModel/index.tsx +1 -1
  93. package/src/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.ts +3 -4
  94. package/src/BgzipFastaMsaAdapter/configSchema.ts +2 -1
  95. package/src/BgzipFastaMsaAdapter/index.ts +2 -1
  96. package/src/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.tsx +2 -6
  97. package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.ts +2 -1
  98. package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +2 -1
  99. package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +6 -7
  100. package/src/LaunchMsaView/components/ManualMSALoader/launchView.ts +5 -2
  101. package/src/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.tsx +22 -17
  102. package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +40 -52
  103. package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.tsx +6 -13
  104. package/src/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.ts +2 -1
  105. package/src/LaunchMsaView/components/NCBIBlastQuery/consts.ts +2 -0
  106. package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +7 -19
  107. package/src/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.ts +2 -2
  108. package/src/LaunchMsaView/components/PreLoadedMSA/preCalculatedLaunchView.ts +1 -2
  109. package/src/LaunchMsaView/components/TranscriptSelector.tsx +7 -6
  110. package/src/LaunchMsaView/components/useTranscriptSelection.ts +1 -6
  111. package/src/LaunchMsaView/components/util.ts +1 -1
  112. package/src/LaunchMsaView/index.ts +6 -5
  113. package/src/LaunchMsaView/util.ts +11 -0
  114. package/src/MsaViewPanel/afterCreateAutoruns.ts +299 -0
  115. package/src/MsaViewPanel/blosum62.ts +628 -0
  116. package/src/MsaViewPanel/components/LoadingBLAST.tsx +2 -1
  117. package/src/MsaViewPanel/components/MsaViewPanel.tsx +2 -1
  118. package/src/MsaViewPanel/doLaunchBlast.ts +1 -1
  119. package/src/MsaViewPanel/genomeToMSA.ts +2 -1
  120. package/src/MsaViewPanel/index.ts +2 -1
  121. package/src/MsaViewPanel/model.ts +30 -392
  122. package/src/MsaViewPanel/msaDataStore.ts +56 -196
  123. package/src/MsaViewPanel/pairwiseAlignment.ts +1 -637
  124. package/src/MsaViewPanel/structureConnection.ts +1 -5
  125. package/src/MsaViewPanel/util.ts +1 -1
  126. package/src/index.ts +4 -2
  127. package/src/utils/msa.ts +45 -100
  128. package/src/utils/ncbiBlast.ts +3 -13
  129. package/CHANGELOG.md +0 -101
package/src/utils/msa.ts CHANGED
@@ -2,93 +2,36 @@ import { textfetch, timeout } from './fetch'
2
2
 
3
3
  const base = `https://www.ebi.ac.uk/Tools/services/rest`
4
4
 
5
- async function runClustalOmega({
6
- sequence,
7
- onProgress,
8
- }: {
9
- sequence: string
10
- onProgress: (arg: string) => void
11
- }) {
12
- const jobId = await textfetch(`${base}/clustalo/run`, {
13
- method: 'POST',
14
- body: new URLSearchParams({
15
- email: 'colin.diesh@gmail.com',
16
- sequence,
17
- }),
18
- })
19
- await wait({ jobId, algorithm: 'clustalo', onProgress })
20
- return {
21
- msa: await textfetch(`${base}/clustalo/result/${jobId}/aln-clustal_num`),
22
- tree: await textfetch(`${base}/clustalo/result/${jobId}/phylotree`),
23
- }
24
- }
25
-
26
- async function runMuscle({
27
- sequence,
28
- onProgress,
29
- }: {
30
- sequence: string
31
- onProgress: (arg: string) => void
32
- }) {
33
- const jobId = await textfetch(`${base}/muscle/run`, {
34
- method: 'POST',
35
- body: new URLSearchParams({
36
- email: 'colin.diesh@gmail.com',
37
- format: 'clw',
38
- tree: 'tree1',
39
- sequence,
40
- }),
41
- })
42
- await wait({ jobId, algorithm: 'muscle', onProgress })
43
- return {
44
- msa: await textfetch(`${base}/muscle/result/${jobId}/fa`),
45
- tree: await textfetch(`${base}/muscle/result/${jobId}/phylotree`),
5
+ const algorithms: Record<
6
+ string,
7
+ {
8
+ params: Record<string, string>
9
+ msaResult: string
10
+ treeResult: string
46
11
  }
12
+ > = {
13
+ clustalo: {
14
+ params: { email: 'colin.diesh@gmail.com' },
15
+ msaResult: 'aln-clustal_num',
16
+ treeResult: 'phylotree',
17
+ },
18
+ muscle: {
19
+ params: { email: 'colin.diesh@gmail.com', format: 'clw', tree: 'tree1' },
20
+ msaResult: 'fa',
21
+ treeResult: 'phylotree',
22
+ },
23
+ kalign: {
24
+ params: { email: 'colin.diesh@gmail.com', stype: 'protein' },
25
+ msaResult: 'fa',
26
+ treeResult: 'phylotree',
27
+ },
28
+ mafft: {
29
+ params: { email: 'colin.diesh@gmail.com', stype: 'protein' },
30
+ msaResult: 'fa',
31
+ treeResult: 'phylotree',
32
+ },
47
33
  }
48
34
 
49
- async function runKalign({
50
- sequence,
51
- onProgress,
52
- }: {
53
- sequence: string
54
- onProgress: (arg: string) => void
55
- }) {
56
- const jobId = await textfetch(`${base}/kalign/run`, {
57
- method: 'POST',
58
- body: new URLSearchParams({
59
- email: 'colin.diesh@gmail.com',
60
- stype: 'protein',
61
- sequence,
62
- }),
63
- })
64
- await wait({ jobId, algorithm: 'kalign', onProgress })
65
- return {
66
- msa: await textfetch(`${base}/kalign/result/${jobId}/fa`),
67
- tree: await textfetch(`${base}/kalign/result/${jobId}/phylotree`),
68
- }
69
- }
70
-
71
- async function runMafft({
72
- sequence,
73
- onProgress,
74
- }: {
75
- sequence: string
76
- onProgress: (arg: string) => void
77
- }) {
78
- const jobId = await textfetch(`${base}/mafft/run`, {
79
- method: 'POST',
80
- body: new URLSearchParams({
81
- email: 'colin.diesh@gmail.com',
82
- stype: 'protein',
83
- sequence,
84
- }),
85
- })
86
- await wait({ jobId, algorithm: 'mafft', onProgress })
87
- return {
88
- msa: await textfetch(`${base}/mafft/result/${jobId}/fa`),
89
- tree: await textfetch(`${base}/mafft/result/${jobId}/phylotree`),
90
- }
91
- }
92
35
  async function wait({
93
36
  onProgress,
94
37
  jobId,
@@ -123,22 +66,24 @@ export async function launchMSA({
123
66
  sequence: string
124
67
  onProgress: (arg: string) => void
125
68
  }) {
69
+ const config = algorithms[algorithm]
70
+ if (!config) {
71
+ throw new Error(`unknown algorithm: ${algorithm}`)
72
+ }
73
+
126
74
  onProgress(`Launching ${algorithm} MSA...`)
127
- switch (algorithm) {
128
- case 'clustalo': {
129
- return runClustalOmega({ sequence, onProgress })
130
- }
131
- case 'muscle': {
132
- return runMuscle({ sequence, onProgress })
133
- }
134
- case 'kalign': {
135
- return runKalign({ sequence, onProgress })
136
- }
137
- case 'mafft': {
138
- return runMafft({ sequence, onProgress })
139
- }
140
- default: {
141
- throw new Error('unknown algorithm')
142
- }
75
+
76
+ const jobId = await textfetch(`${base}/${algorithm}/run`, {
77
+ method: 'POST',
78
+ body: new URLSearchParams({ ...config.params, sequence }),
79
+ })
80
+ await wait({ jobId, algorithm, onProgress })
81
+ return {
82
+ msa: await textfetch(
83
+ `${base}/${algorithm}/result/${jobId}/${config.msaResult}`,
84
+ ),
85
+ tree: await textfetch(
86
+ `${base}/${algorithm}/result/${jobId}/${config.treeResult}`,
87
+ ),
143
88
  }
144
89
  }
@@ -1,5 +1,6 @@
1
1
  import { jsonfetch, textfetch, timeout } from './fetch'
2
- import { BlastResults } from './types'
2
+
3
+ import type { BlastResults } from './types'
3
4
 
4
5
  export async function queryBlastFromRid({
5
6
  rid,
@@ -48,18 +49,7 @@ export async function queryBlast({
48
49
  baseUrl,
49
50
  })
50
51
  onRid(rid)
51
- await waitForRid({
52
- rid,
53
- onProgress,
54
- baseUrl,
55
- })
56
- const ret = await jsonfetch<BlastResults>(
57
- `${baseUrl}?CMD=Get&RID=${rid}&FORMAT_TYPE=JSON2_S&FORMAT_OBJECT=Alignment`,
58
- )
59
- return {
60
- rid,
61
- hits: ret.BlastOutput2[0]?.report.results.search.hits ?? [],
62
- }
52
+ return queryBlastFromRid({ rid, baseUrl, onProgress })
63
53
  }
64
54
 
65
55
  async function initialQuery({
package/CHANGELOG.md DELETED
@@ -1,101 +0,0 @@
1
- # v1.0.18
2
-
3
- - Fix clicking on node labels
4
-
5
- # v1.0.17
6
-
7
- - Avoid Link redirection at react-msaview importform
8
-
9
- # v1.0.16
10
-
11
- - Update to latest react-msaview
12
-
13
- # v1.0.15
14
-
15
- - Change to add to 'Add' top level menu
16
-
17
- # v1.0.14
18
-
19
- - Fix session link loading from distconfig.json
20
-
21
- # v1.0.13
22
-
23
- - Factor out code into the react-msaview package on NPM, and make the plugin
24
- more of a wrapper around this module
25
-
26
- # v1.0.12
27
-
28
- - Avoid scrolling too far right
29
-
30
- # v1.0.11
31
-
32
- - Add version number from package.json to about panel
33
-
34
- # v1.0.10
35
-
36
- - Fix scrolling for large MSA that loads after tree
37
-
38
- # v1.0.9
39
-
40
- - Fix for MSA loading bar when tree only is displayed
41
-
42
- # v1.0.8
43
-
44
- - Fix for side scrolling half rendered letters in MSA
45
- - drawNodeBubbles option
46
-
47
- # v1.0.7
48
-
49
- - Move yarn build script to prepare script in package.jsom
50
-
51
- # v1.0.6
52
-
53
- - Use postversion to run build so that the accurate version is encoded into the
54
- release binary
55
-
56
- # v1.0.5
57
-
58
- - Add prebuild clean
59
-
60
- # v1.0.4
61
-
62
- - Fix running build before release
63
-
64
- # v1.0.3
65
-
66
- - Re-release
67
-
68
- # v1.0.2
69
-
70
- - Ensure clean build with prebuild rm -rf dist
71
-
72
- # v1.0.1
73
-
74
- - Fix for making demo config on unpkg
75
-
76
- # v1.0.0
77
-
78
- ## Features
79
-
80
- - Vertical virtualized scrolling of phylogenetic tree
81
- - Vertical and horizontal virtualized scrolling of multiple sequence alignment
82
- as a newick tree embedded in stockholm metadata
83
- - View metadata about alignment from MSA headers (e.g. stockholm)
84
- - Collapse subtrees with click action on branches
85
- - The collapse subtree action hides gaps that were introduced by that subtree in
86
- the rest of the alignment
87
- - Allows "zooming out" by setting tiny rowHeight/colWidth settings
88
- - Allows changing color schemes, with jalview, clustal, and other color schemes
89
- - Allows toggling the branch length rendering for the phylogenetic tree
90
- - Can share sessions with other users which will send relevant settings and
91
- links to files to automatically open your results
92
- - The tree or the MSA panel can be loaded separately from each other
93
-
94
- ## File format supports
95
-
96
- - FASTA formatted for MSA (e.g. gaps already inserted)
97
- - Stockholm files (e.g. .stock file, with or without embedded newick tree, uses
98
- stockholm-js parser. also supports "multi-stockholm" files with multiple
99
- alignments embedded in a single file)
100
- - Clustal files (e.g. .aln file, uses clustal-js parser)
101
- - Newick (tree can be loaded separately as a .nh file)