jbrowse-plugin-msaview 2.0.3 → 2.0.5
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/dist/AddHighlightModel/GenomeMouseoverHighlight.js +1 -1
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +1 -1
- package/dist/AddHighlightModel/HighlightComponents.js +1 -1
- package/dist/AddHighlightModel/HighlightComponents.js.map +1 -1
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js +2 -1
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js.map +1 -1
- package/dist/AddHighlightModel/index.js.map +1 -1
- package/dist/AddHighlightModel/util.d.ts +2 -2
- package/dist/AddHighlightModel/util.js +1 -1
- package/dist/AddHighlightModel/util.js.map +1 -1
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js +8 -3
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.js +17 -9
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.js +1 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.js.map +1 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/ncbiBlastLaunchView.js.map +1 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/useFeatureSequence.js +51 -30
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/useFeatureSequence.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +9 -5
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/TabUtils.d.ts +1 -5
- package/dist/LaunchMsaView/components/TabUtils.js +1 -7
- package/dist/LaunchMsaView/components/TabUtils.js.map +1 -1
- package/dist/LaunchMsaView/components/tabUtil.d.ts +4 -0
- package/dist/LaunchMsaView/components/tabUtil.js +7 -0
- package/dist/LaunchMsaView/components/tabUtil.js.map +1 -0
- package/dist/LaunchMsaView/index.js +4 -5
- package/dist/LaunchMsaView/index.js.map +1 -1
- package/dist/LaunchMsaView/util.d.ts +1 -1
- package/dist/LaunchMsaView/util.js +1 -1
- package/dist/LaunchMsaView/util.js.map +1 -1
- package/dist/MsaViewPanel/components/LoadingBLAST.js +2 -2
- package/dist/MsaViewPanel/components/LoadingBLAST.js.map +1 -1
- package/dist/MsaViewPanel/components/MsaViewPanel.js.map +1 -1
- package/dist/MsaViewPanel/components/RIDLink.js.map +1 -1
- package/dist/MsaViewPanel/doLaunchBlast.js +18 -5
- package/dist/MsaViewPanel/doLaunchBlast.js.map +1 -1
- package/dist/MsaViewPanel/genomeToMSA.js.map +1 -1
- package/dist/MsaViewPanel/index.js.map +1 -1
- package/dist/MsaViewPanel/model.d.ts +39 -35
- package/dist/MsaViewPanel/model.js +7 -5
- package/dist/MsaViewPanel/model.js.map +1 -1
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.js +4 -4
- package/dist/MsaViewPanel/msaCoordToGenomeCoord.js.map +1 -1
- package/dist/OpenInNewIcon.js.map +1 -1
- package/dist/TextField2.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +84 -30
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
- package/dist/utils/msa.js +4 -0
- package/dist/utils/msa.js.map +1 -1
- package/dist/utils/ncbiBlast.js +8 -5
- package/dist/utils/ncbiBlast.js.map +1 -1
- package/package.json +24 -22
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +4 -2
- package/src/AddHighlightModel/HighlightComponents.tsx +3 -2
- package/src/AddHighlightModel/MsaToGenomeHighlight.tsx +9 -6
- package/src/AddHighlightModel/index.tsx +1 -0
- package/src/AddHighlightModel/util.ts +1 -1
- package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +13 -4
- package/src/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.tsx +22 -13
- package/src/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.ts +2 -2
- package/src/LaunchMsaView/components/NewNCBIBlastQuery/ncbiBlastLaunchView.ts +1 -0
- package/src/LaunchMsaView/components/NewNCBIBlastQuery/useFeatureSequence.ts +69 -34
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +19 -14
- package/src/LaunchMsaView/components/TabUtils.tsx +2 -7
- package/src/LaunchMsaView/components/tabUtil.ts +6 -0
- package/src/LaunchMsaView/index.ts +39 -33
- package/src/LaunchMsaView/util.ts +2 -2
- package/src/MsaViewPanel/components/LoadingBLAST.tsx +6 -4
- package/src/MsaViewPanel/components/MsaViewPanel.tsx +1 -0
- package/src/MsaViewPanel/components/RIDLink.tsx +2 -0
- package/src/MsaViewPanel/doLaunchBlast.ts +25 -7
- package/src/MsaViewPanel/genomeToMSA.ts +2 -1
- package/src/MsaViewPanel/index.ts +1 -0
- package/src/MsaViewPanel/model.ts +10 -7
- package/src/MsaViewPanel/msaCoordToGenomeCoord.ts +4 -4
- package/src/OpenInNewIcon.tsx +1 -0
- package/src/TextField2.tsx +1 -0
- package/src/index.ts +2 -2
- package/src/utils/msa.ts +3 -0
- package/src/utils/ncbiBlast.ts +22 -10
package/dist/utils/msa.js
CHANGED
|
@@ -61,6 +61,7 @@ async function runMafft({ sequence, onProgress, }) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
async function wait({ onProgress, jobId, algorithm, }) {
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
64
65
|
while (true) {
|
|
65
66
|
for (let i = 0; i < 10; i++) {
|
|
66
67
|
await timeout(1000);
|
|
@@ -70,6 +71,9 @@ async function wait({ onProgress, jobId, algorithm, }) {
|
|
|
70
71
|
if (result === 'FINISHED') {
|
|
71
72
|
break;
|
|
72
73
|
}
|
|
74
|
+
else if (result.includes('FAILURE')) {
|
|
75
|
+
throw new Error(`Failed to run: jobId ${jobId}`);
|
|
76
|
+
}
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
export async function launchMSA({ algorithm, sequence, onProgress, }) {
|
package/dist/utils/msa.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"msa.js","sourceRoot":"","sources":["../../src/utils/msa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAE5C,MAAM,IAAI,GAAG,2CAA2C,CAAA;AAExD,KAAK,UAAU,eAAe,CAAC,EAC7B,QAAQ,EACR,UAAU,GAIX;IACC,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,GAAG,IAAI,eAAe,EAAE;QACpD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,eAAe,CAAC;YACxB,KAAK,EAAE,uBAAuB;YAC9B,QAAQ;SACT,CAAC;KACH,CAAC,CAAA;IACF,MAAM,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAA;IACxD,OAAO;QACL,GAAG,EAAE,MAAM,SAAS,CAAC,GAAG,IAAI,oBAAoB,KAAK,kBAAkB,CAAC;QACxE,IAAI,EAAE,MAAM,SAAS,CAAC,GAAG,IAAI,oBAAoB,KAAK,YAAY,CAAC;KACpE,CAAA;AACH,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,EACvB,QAAQ,EACR,UAAU,GAIX;IACC,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,GAAG,IAAI,aAAa,EAAE;QAClD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,eAAe,CAAC;YACxB,KAAK,EAAE,uBAAuB;YAC9B,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,OAAO;YACb,QAAQ;SACT,CAAC;KACH,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CAAC;YACb,OAAO,QAAQ,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACR,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;QACtC,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/utils/ncbiBlast.js
CHANGED
|
@@ -9,9 +9,11 @@ export async function queryBlast({ query, blastDatabase, blastProgram, onProgres
|
|
|
9
9
|
});
|
|
10
10
|
onRid(rid);
|
|
11
11
|
await waitForRid({ rid, onProgress });
|
|
12
|
-
const ret = await jsonfetch(`${BLAST_URL}?CMD=Get&RID=${rid}&FORMAT_TYPE=JSON2_S&FORMAT_OBJECT=Alignment`);
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const ret = (await jsonfetch(`${BLAST_URL}?CMD=Get&RID=${rid}&FORMAT_TYPE=JSON2_S&FORMAT_OBJECT=Alignment`));
|
|
13
|
+
return {
|
|
14
|
+
rid,
|
|
15
|
+
hits: ret.BlastOutput2[0]?.report.results.search.hits ?? [],
|
|
16
|
+
};
|
|
15
17
|
}
|
|
16
18
|
async function initialQuery({ query, blastProgram, blastDatabase, }) {
|
|
17
19
|
const res = await textfetch(BLAST_URL, {
|
|
@@ -32,14 +34,15 @@ async function initialQuery({ query, blastProgram, blastDatabase, }) {
|
|
|
32
34
|
// the initial submission/query to the BLAST "REST API" does not return JSON
|
|
33
35
|
// as a response (e.g. FORMAT_TYPE=JSON does not work), so the RID is
|
|
34
36
|
// literally parsed from the text of the HTML that is returned
|
|
35
|
-
const rid = /^
|
|
36
|
-
const rtoe = /^
|
|
37
|
+
const rid = /^ {4}RID = (.*$)/m.exec(res)?.[1];
|
|
38
|
+
const rtoe = /^ {4}RTOE = (.*$)/m.exec(res)?.[1];
|
|
37
39
|
if (!rid) {
|
|
38
40
|
throw new Error('Failed to get RID from BLAST request');
|
|
39
41
|
}
|
|
40
42
|
return { rid, rtoe };
|
|
41
43
|
}
|
|
42
44
|
async function waitForRid({ rid, onProgress, }) {
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
43
46
|
while (true) {
|
|
44
47
|
const iter = 20;
|
|
45
48
|
for (let i = 0; i < iter; i++) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ncbiBlast.js","sourceRoot":"","sources":["../../src/utils/ncbiBlast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG,gDAAgD,CAAA;AAEzE,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,KAAK,EACL,aAAa,EACb,YAAY,EACZ,UAAU,EACV,KAAK,GAON;IACC,UAAU,CAAC,6BAA6B,CAAC,CAAA;IACzC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,YAAY,CAAC;QACjC,KAAK;QACL,aAAa;QACb,YAAY;KACb,CAAC,CAAA;IACF,KAAK,CAAC,GAAG,CAAC,CAAA;IACV,MAAM,UAAU,CAAC,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC,CAAA;IACrC,MAAM,GAAG,GAAG,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"ncbiBlast.js","sourceRoot":"","sources":["../../src/utils/ncbiBlast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG,gDAAgD,CAAA;AAEzE,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,KAAK,EACL,aAAa,EACb,YAAY,EACZ,UAAU,EACV,KAAK,GAON;IACC,UAAU,CAAC,6BAA6B,CAAC,CAAA;IACzC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,YAAY,CAAC;QACjC,KAAK;QACL,aAAa;QACb,YAAY;KACb,C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,UAAU,CAAC,EACxB,GAAG,EACH,UAAU,GAIX;IACC,uEAAuE;IACvE,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,EAAE,CAAA;QACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;YACnB,UAAU,CAAC,kCAAkC,IAAI,GAAG,CAAC,EAAE,CAAC,CAAA;QAC1D,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,SAAS,CACzB,GAAG,SAAS,yCAAyC,GAAG,EAAE,CAC3D,CAAA;QACD,IAAI,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,SAAQ;QACV,CAAC;aAAM,IAAI,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CACb,SAAS,GAAG,uDAAuD,CACpE,CAAA;QACH,CAAC;aAAM,IAAI,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,IAAI,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrC,OAAO,IAAI,CAAA;YACb,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;YAClC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.0.
|
|
2
|
+
"version": "2.0.5",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "jbrowse-plugin-msaview",
|
|
5
5
|
"keywords": [
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"clean": "rimraf dist",
|
|
27
|
-
"start": "node esbuild.mjs",
|
|
27
|
+
"start": "node esbuild-watch.mjs",
|
|
28
|
+
"format": "prettier --write .",
|
|
28
29
|
"build": "tsc && NODE_ENV=production node esbuild.mjs",
|
|
29
30
|
"prebuild": "npm run clean",
|
|
30
|
-
"lint": "eslint --report-unused-disable-directives --max-warnings 0
|
|
31
|
+
"lint": "eslint --report-unused-disable-directives --max-warnings 0",
|
|
31
32
|
"prepack": "npm run build",
|
|
32
33
|
"postversion": "git push --follow-tags"
|
|
33
34
|
},
|
|
@@ -35,42 +36,43 @@
|
|
|
35
36
|
"name": "MsaView"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
39
|
+
"@emotion/styled": "^11.14.0",
|
|
38
40
|
"g2p_mapper": "^1.0.4",
|
|
39
41
|
"pako": "^2.1.0",
|
|
40
|
-
"react-msaview": "^
|
|
42
|
+
"react-msaview": "^4.0.0"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
43
45
|
"@emotion/react": "^11.10.4",
|
|
44
|
-
"@eslint/compat": "^1.1.0",
|
|
45
46
|
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
|
|
46
|
-
"@jbrowse/core": "^
|
|
47
|
-
"@jbrowse/plugin-linear-genome-view": "^
|
|
48
|
-
"@mui/icons-material": "^
|
|
49
|
-
"@mui/material": "^
|
|
50
|
-
"@mui/system": "^
|
|
51
|
-
"@mui/x-data-grid": "^
|
|
52
|
-
"@types/node": "^
|
|
47
|
+
"@jbrowse/core": "^3.0.1",
|
|
48
|
+
"@jbrowse/plugin-linear-genome-view": "^3.0.1",
|
|
49
|
+
"@mui/icons-material": "^7.1.0",
|
|
50
|
+
"@mui/material": "^7.1.0",
|
|
51
|
+
"@mui/system": "^7.1.0",
|
|
52
|
+
"@mui/x-data-grid": "^8.2.0",
|
|
53
|
+
"@types/node": "^22.10.7",
|
|
53
54
|
"@types/pako": "^2.0.1",
|
|
54
|
-
"@types/react": "^
|
|
55
|
+
"@types/react": "^19.0.7",
|
|
55
56
|
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
56
57
|
"@typescript-eslint/parser": "^8.0.1",
|
|
57
|
-
"esbuild": "^0.
|
|
58
|
+
"esbuild": "^0.25.4",
|
|
58
59
|
"eslint": "^9.0.0",
|
|
59
|
-
"eslint-
|
|
60
|
-
"eslint-plugin-prettier": "^5.1.0",
|
|
60
|
+
"eslint-plugin-import": "^2.31.0",
|
|
61
61
|
"eslint-plugin-react": "^7.20.3",
|
|
62
|
-
"eslint-plugin-react-hooks": "^
|
|
63
|
-
"eslint-plugin-
|
|
62
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
63
|
+
"eslint-plugin-react-refresh": "^0.4.9",
|
|
64
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
64
65
|
"mobx": "^6.10.2",
|
|
65
66
|
"mobx-react": "^9.0.1",
|
|
66
67
|
"mobx-state-tree": "^5.3.0",
|
|
67
68
|
"prettier": "^3.0.3",
|
|
68
|
-
"pretty-bytes": "^
|
|
69
|
-
"react": "^
|
|
70
|
-
"react-dom": "^
|
|
69
|
+
"pretty-bytes": "^7.0.0",
|
|
70
|
+
"react": "^19.0.0",
|
|
71
|
+
"react-dom": "^19.0.0",
|
|
71
72
|
"rimraf": "^6.0.0",
|
|
72
73
|
"rxjs": "^7.8.1",
|
|
73
74
|
"tss-react": "^4.9.2",
|
|
74
|
-
"typescript": "^5.2.2"
|
|
75
|
+
"typescript": "^5.2.2",
|
|
76
|
+
"typescript-eslint": "^8.1.0"
|
|
75
77
|
}
|
|
76
78
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
2
|
+
|
|
4
3
|
import { getSession } from '@jbrowse/core/util'
|
|
4
|
+
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
5
|
+
import { observer } from 'mobx-react'
|
|
6
|
+
|
|
5
7
|
import { useStyles } from './util'
|
|
6
8
|
|
|
7
9
|
const GenomeMouseoverHighlight = observer(function GenomeMouseoverHighlight2({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
4
|
+
import { observer } from 'mobx-react'
|
|
4
5
|
|
|
5
6
|
// locals
|
|
6
|
-
import MsaToGenomeHighlight from './MsaToGenomeHighlight'
|
|
7
7
|
import GenomeMouseoverHighlight from './GenomeMouseoverHighlight'
|
|
8
|
+
import MsaToGenomeHighlight from './MsaToGenomeHighlight'
|
|
8
9
|
|
|
9
10
|
type LGV = LinearGenomeViewModel
|
|
10
11
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { observer } from 'mobx-react'
|
|
3
|
-
import { getSession } from '@jbrowse/core/util'
|
|
4
2
|
|
|
5
|
-
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
6
3
|
import { Assembly } from '@jbrowse/core/assemblyManager/assembly'
|
|
4
|
+
import { getSession } from '@jbrowse/core/util'
|
|
5
|
+
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
6
|
+
import { observer } from 'mobx-react'
|
|
7
|
+
|
|
7
8
|
|
|
8
9
|
// locals
|
|
9
|
-
import { JBrowsePluginMsaViewModel } from '../MsaViewPanel/model'
|
|
10
10
|
import { useStyles } from './util'
|
|
11
|
+
import { JBrowsePluginMsaViewModel } from '../MsaViewPanel/model'
|
|
11
12
|
|
|
12
13
|
type LGV = LinearGenomeViewModel
|
|
13
14
|
|
|
@@ -22,8 +23,10 @@ const MsaToGenomeHighlight = observer(function MsaToGenomeHighlight2({
|
|
|
22
23
|
}) {
|
|
23
24
|
const { classes } = useStyles()
|
|
24
25
|
const { assemblyManager, views } = getSession(model)
|
|
25
|
-
const p = views.find(f => f.type === 'MsaView') as
|
|
26
|
-
|
|
26
|
+
const p = views.find(f => f.type === 'MsaView') as
|
|
27
|
+
| JBrowsePluginMsaViewModel
|
|
28
|
+
| undefined
|
|
29
|
+
const assembly = assemblyManager.get(model.assemblyNames[0]!)
|
|
27
30
|
return assembly ? (
|
|
28
31
|
<>
|
|
29
32
|
{p?.connectedHighlights.map((r, idx) => {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
+
|
|
2
3
|
import { Dialog } from '@jbrowse/core/ui'
|
|
3
|
-
import { Box, Tab, Tabs } from '@mui/material'
|
|
4
4
|
import { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
5
|
+
import { Box, Tab, Tabs } from '@mui/material'
|
|
5
6
|
|
|
6
7
|
// locals
|
|
7
8
|
|
|
8
|
-
import { CustomTabPanel, a11yProps } from './TabUtils'
|
|
9
9
|
import NewNcbiBlastQueryPanel from './NewNCBIBlastQuery'
|
|
10
10
|
import PreLoadedMSA from './PreLoadedMSA/PreLoadedMSADataPanel'
|
|
11
|
+
import CustomTabPanel from './TabUtils'
|
|
12
|
+
import { a11yProps } from './tabUtil'
|
|
11
13
|
|
|
12
14
|
export default function LaunchProteinViewDialog({
|
|
13
15
|
handleClose,
|
|
@@ -24,11 +26,18 @@ export default function LaunchProteinViewDialog({
|
|
|
24
26
|
<Dialog
|
|
25
27
|
maxWidth="xl"
|
|
26
28
|
title="Launch MSA view"
|
|
27
|
-
onClose={() =>
|
|
29
|
+
onClose={() => {
|
|
30
|
+
handleClose()
|
|
31
|
+
}}
|
|
28
32
|
open
|
|
29
33
|
>
|
|
30
34
|
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
|
|
31
|
-
<Tabs
|
|
35
|
+
<Tabs
|
|
36
|
+
value={value}
|
|
37
|
+
onChange={(_, val) => {
|
|
38
|
+
setValue(val)
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
32
41
|
<Tab label="NCBI BLAST query" {...a11yProps(0)} />
|
|
33
42
|
<Tab label="UCSC 100-way dataset" {...a11yProps(1)} />
|
|
34
43
|
</Tabs>
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { makeStyles } from 'tss-react/mui'
|
|
2
|
+
|
|
3
|
+
import { ErrorMessage } from '@jbrowse/core/ui'
|
|
5
4
|
import {
|
|
6
5
|
AbstractTrackModel,
|
|
7
6
|
Feature,
|
|
8
7
|
getContainingView,
|
|
9
8
|
} from '@jbrowse/core/util'
|
|
10
|
-
import { ErrorMessage } from '@jbrowse/core/ui'
|
|
11
9
|
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
10
|
+
import { Button, DialogActions, DialogContent, MenuItem } from '@mui/material'
|
|
11
|
+
import { observer } from 'mobx-react'
|
|
12
|
+
import { makeStyles } from 'tss-react/mui'
|
|
12
13
|
|
|
13
14
|
// locals
|
|
15
|
+
import { getProteinSequence } from './calculateProteinSequence'
|
|
16
|
+
import { ncbiBlastLaunchView } from './ncbiBlastLaunchView'
|
|
17
|
+
import { useFeatureSequence } from './useFeatureSequence'
|
|
18
|
+
import TextField2 from '../../../TextField2'
|
|
14
19
|
import {
|
|
20
|
+
getGeneDisplayName,
|
|
15
21
|
getId,
|
|
16
22
|
getTranscriptDisplayName,
|
|
17
23
|
getTranscriptFeatures,
|
|
18
|
-
getGeneDisplayName,
|
|
19
24
|
} from '../../util'
|
|
20
|
-
import { getProteinSequence } from './calculateProteinSequence'
|
|
21
|
-
import { useFeatureSequence } from './useFeatureSequence'
|
|
22
|
-
import TextField2 from '../../../TextField2'
|
|
23
|
-
import { ncbiBlastLaunchView } from './ncbiBlastLaunchView'
|
|
24
25
|
|
|
25
26
|
const useStyles = makeStyles()({
|
|
26
27
|
dialogContent: {
|
|
@@ -67,7 +68,9 @@ const NcbiBlastPanel = observer(function NcbiBlastPanel2({
|
|
|
67
68
|
{error ? <ErrorMessage error={error} /> : null}
|
|
68
69
|
<TextField2
|
|
69
70
|
value={blastDatabase}
|
|
70
|
-
onChange={event =>
|
|
71
|
+
onChange={event => {
|
|
72
|
+
setBlastDatabase(event.target.value)
|
|
73
|
+
}}
|
|
71
74
|
label="BLAST blastDatabase"
|
|
72
75
|
select
|
|
73
76
|
>
|
|
@@ -80,7 +83,9 @@ const NcbiBlastPanel = observer(function NcbiBlastPanel2({
|
|
|
80
83
|
|
|
81
84
|
<TextField2
|
|
82
85
|
value={msaAlgorithm}
|
|
83
|
-
onChange={event =>
|
|
86
|
+
onChange={event => {
|
|
87
|
+
setMsaAlgorithm(event.target.value)
|
|
88
|
+
}}
|
|
84
89
|
label="MSA Algorithm"
|
|
85
90
|
select
|
|
86
91
|
>
|
|
@@ -93,7 +98,9 @@ const NcbiBlastPanel = observer(function NcbiBlastPanel2({
|
|
|
93
98
|
|
|
94
99
|
<TextField2
|
|
95
100
|
value={userSelection}
|
|
96
|
-
onChange={event =>
|
|
101
|
+
onChange={event => {
|
|
102
|
+
setUserSelection(event.target.value)
|
|
103
|
+
}}
|
|
97
104
|
label="Choose isoform to BLAST"
|
|
98
105
|
select
|
|
99
106
|
>
|
|
@@ -148,7 +155,9 @@ const NcbiBlastPanel = observer(function NcbiBlastPanel2({
|
|
|
148
155
|
<Button
|
|
149
156
|
color="secondary"
|
|
150
157
|
variant="contained"
|
|
151
|
-
onClick={() =>
|
|
158
|
+
onClick={() => {
|
|
159
|
+
handleClose()
|
|
160
|
+
}}
|
|
152
161
|
>
|
|
153
162
|
Cancel
|
|
154
163
|
</Button>
|
|
@@ -28,7 +28,7 @@ export function calculateProteinSequence({
|
|
|
28
28
|
let protein = ''
|
|
29
29
|
for (let i = 0; i < str.length; i += 3) {
|
|
30
30
|
// use & symbol for undefined codon, or partial slice
|
|
31
|
-
protein += codonTable[str.slice(i, i + 3)]
|
|
31
|
+
protein += codonTable[str.slice(i, i + 3)] ?? '&'
|
|
32
32
|
}
|
|
33
33
|
return protein
|
|
34
34
|
}
|
|
@@ -54,7 +54,7 @@ function getItemId(feat: Feat) {
|
|
|
54
54
|
// filters if successive elements share same start/end
|
|
55
55
|
export function dedupe(list: Feat[]) {
|
|
56
56
|
return list.filter(
|
|
57
|
-
(item, pos, ary) => !pos || getItemId(item) !== getItemId(ary[pos - 1]),
|
|
57
|
+
(item, pos, ary) => !pos || getItemId(item) !== getItemId(ary[pos - 1]!),
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import { Feature, getSession } from '@jbrowse/core/util'
|
|
4
3
|
import { getConf } from '@jbrowse/core/configuration'
|
|
4
|
+
import { AbstractSessionModel, Feature, getSession } from '@jbrowse/core/util'
|
|
5
5
|
|
|
6
6
|
export interface SeqState {
|
|
7
7
|
seq: string
|
|
@@ -14,6 +14,40 @@ export interface ErrorState {
|
|
|
14
14
|
}
|
|
15
15
|
const BPLIMIT = 500_000
|
|
16
16
|
|
|
17
|
+
async function fetchSeq({
|
|
18
|
+
start,
|
|
19
|
+
end,
|
|
20
|
+
refName,
|
|
21
|
+
session,
|
|
22
|
+
assemblyName,
|
|
23
|
+
}: {
|
|
24
|
+
start: number
|
|
25
|
+
end: number
|
|
26
|
+
refName: string
|
|
27
|
+
assemblyName: string
|
|
28
|
+
session: AbstractSessionModel
|
|
29
|
+
}) {
|
|
30
|
+
const { assemblyManager, rpcManager } = session
|
|
31
|
+
const assembly = await assemblyManager.waitForAssembly(assemblyName)
|
|
32
|
+
if (!assembly) {
|
|
33
|
+
throw new Error('assembly not found')
|
|
34
|
+
}
|
|
35
|
+
const sessionId = 'getSequence'
|
|
36
|
+
const feats = (await rpcManager.call(sessionId, 'CoreGetFeatures', {
|
|
37
|
+
adapterConfig: getConf(assembly, ['sequence', 'adapter']),
|
|
38
|
+
sessionId,
|
|
39
|
+
regions: [
|
|
40
|
+
{
|
|
41
|
+
start,
|
|
42
|
+
end,
|
|
43
|
+
refName: assembly.getCanonicalRefName(refName),
|
|
44
|
+
assemblyName,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
})) as Feature[]
|
|
48
|
+
return (feats[0]?.get('seq') as string | undefined) ?? ''
|
|
49
|
+
}
|
|
50
|
+
|
|
17
51
|
export function useFeatureSequence({
|
|
18
52
|
view,
|
|
19
53
|
feature,
|
|
@@ -27,41 +61,23 @@ export function useFeatureSequence({
|
|
|
27
61
|
}) {
|
|
28
62
|
const [sequence, setSequence] = useState<SeqState | ErrorState>()
|
|
29
63
|
const [error, setError] = useState<unknown>()
|
|
64
|
+
const assemblyName = view?.assemblyNames?.[0]
|
|
30
65
|
useEffect(() => {
|
|
31
66
|
if (view) {
|
|
32
|
-
const { assemblyManager, rpcManager } = getSession(view)
|
|
33
|
-
const [assemblyName] = view?.assemblyNames || []
|
|
34
|
-
async function fetchSeq(start: number, end: number, refName: string) {
|
|
35
|
-
const assembly = await assemblyManager.waitForAssembly(assemblyName)
|
|
36
|
-
if (!assembly) {
|
|
37
|
-
throw new Error('assembly not found')
|
|
38
|
-
}
|
|
39
|
-
const sessionId = 'getSequence'
|
|
40
|
-
const feats = await rpcManager.call(sessionId, 'CoreGetFeatures', {
|
|
41
|
-
adapterConfig: getConf(assembly, ['sequence', 'adapter']),
|
|
42
|
-
sessionId,
|
|
43
|
-
regions: [
|
|
44
|
-
{
|
|
45
|
-
start,
|
|
46
|
-
end,
|
|
47
|
-
refName: assembly.getCanonicalRefName(refName),
|
|
48
|
-
assemblyName,
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
const [feat] = feats as Feature[]
|
|
54
|
-
return (feat?.get('seq') as string | undefined) || ''
|
|
55
|
-
}
|
|
56
|
-
|
|
57
67
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
58
68
|
;(async () => {
|
|
59
69
|
try {
|
|
60
70
|
setError(undefined)
|
|
61
71
|
setSequence(undefined)
|
|
62
|
-
|
|
63
|
-
const { start, end, refName } = feature.toJSON() as
|
|
64
|
-
|
|
72
|
+
const session = getSession(view)
|
|
73
|
+
const { start, end, refName } = feature.toJSON() as {
|
|
74
|
+
start: number
|
|
75
|
+
end: number
|
|
76
|
+
refName: string
|
|
77
|
+
}
|
|
78
|
+
if (!assemblyName) {
|
|
79
|
+
throw new Error('No assembly found')
|
|
80
|
+
}
|
|
65
81
|
if (!forceLoad && end - start > BPLIMIT) {
|
|
66
82
|
setSequence({
|
|
67
83
|
error: `Genomic sequence larger than ${BPLIMIT}bp, use "force load" button to display`,
|
|
@@ -69,10 +85,29 @@ export function useFeatureSequence({
|
|
|
69
85
|
} else {
|
|
70
86
|
const b = start - upDownBp
|
|
71
87
|
const e = end + upDownBp
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
setSequence({
|
|
89
|
+
seq: await fetchSeq({
|
|
90
|
+
start,
|
|
91
|
+
end,
|
|
92
|
+
refName,
|
|
93
|
+
assemblyName,
|
|
94
|
+
session,
|
|
95
|
+
}),
|
|
96
|
+
upstream: await fetchSeq({
|
|
97
|
+
start: Math.max(0, b),
|
|
98
|
+
end: start,
|
|
99
|
+
refName,
|
|
100
|
+
assemblyName,
|
|
101
|
+
session,
|
|
102
|
+
}),
|
|
103
|
+
downstream: await fetchSeq({
|
|
104
|
+
start: end,
|
|
105
|
+
end: e,
|
|
106
|
+
refName,
|
|
107
|
+
assemblyName,
|
|
108
|
+
session,
|
|
109
|
+
}),
|
|
110
|
+
})
|
|
76
111
|
}
|
|
77
112
|
} catch (e) {
|
|
78
113
|
console.error(e)
|
|
@@ -80,6 +115,6 @@ export function useFeatureSequence({
|
|
|
80
115
|
}
|
|
81
116
|
})()
|
|
82
117
|
}
|
|
83
|
-
}, [feature, view, upDownBp, forceLoad])
|
|
118
|
+
}, [feature, view, upDownBp, assemblyName, forceLoad])
|
|
84
119
|
return { sequence, error }
|
|
85
120
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { ErrorMessage } from '@jbrowse/core/ui'
|
|
4
|
+
import {
|
|
5
|
+
AbstractTrackModel,
|
|
6
|
+
Feature,
|
|
7
|
+
getContainingView,
|
|
8
|
+
getSession,
|
|
9
|
+
} from '@jbrowse/core/util'
|
|
10
|
+
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
4
11
|
import {
|
|
5
12
|
Button,
|
|
6
13
|
DialogActions,
|
|
@@ -9,24 +16,18 @@ import {
|
|
|
9
16
|
TextField,
|
|
10
17
|
Typography,
|
|
11
18
|
} from '@mui/material'
|
|
12
|
-
import {
|
|
13
|
-
AbstractTrackModel,
|
|
14
|
-
Feature,
|
|
15
|
-
getContainingView,
|
|
16
|
-
getSession,
|
|
17
|
-
} from '@jbrowse/core/util'
|
|
19
|
+
import { observer } from 'mobx-react'
|
|
18
20
|
import { makeStyles } from 'tss-react/mui'
|
|
19
|
-
import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
20
21
|
|
|
21
22
|
// locals
|
|
23
|
+
import { fetchGeneList } from './fetchGeneList'
|
|
24
|
+
import { preCalculatedLaunchView } from './preCalculatedLaunchView'
|
|
22
25
|
import {
|
|
23
|
-
|
|
26
|
+
getGeneDisplayName,
|
|
24
27
|
getId,
|
|
28
|
+
getTranscriptDisplayName,
|
|
25
29
|
getTranscriptFeatures,
|
|
26
|
-
getGeneDisplayName,
|
|
27
30
|
} from '../../util'
|
|
28
|
-
import { fetchGeneList } from './fetchGeneList'
|
|
29
|
-
import { preCalculatedLaunchView } from './preCalculatedLaunchView'
|
|
30
31
|
|
|
31
32
|
const useStyles = makeStyles()({
|
|
32
33
|
dialogContent: {
|
|
@@ -86,7 +87,9 @@ const PreLoadedMSA = observer(function PreLoadedMSA2({
|
|
|
86
87
|
) : null}
|
|
87
88
|
<TextField
|
|
88
89
|
value={userSelection}
|
|
89
|
-
onChange={event =>
|
|
90
|
+
onChange={event => {
|
|
91
|
+
setUserSelection(event.target.value)
|
|
92
|
+
}}
|
|
90
93
|
label="Choose isoform to view MSA for"
|
|
91
94
|
select
|
|
92
95
|
>
|
|
@@ -138,7 +141,9 @@ const PreLoadedMSA = observer(function PreLoadedMSA2({
|
|
|
138
141
|
<Button
|
|
139
142
|
color="secondary"
|
|
140
143
|
variant="contained"
|
|
141
|
-
onClick={() =>
|
|
144
|
+
onClick={() => {
|
|
145
|
+
handleClose()
|
|
146
|
+
}}
|
|
142
147
|
>
|
|
143
148
|
Cancel
|
|
144
149
|
</Button>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
|
|
2
3
|
import { Box } from '@mui/material'
|
|
3
4
|
|
|
4
5
|
interface TabPanelProps {
|
|
@@ -7,7 +8,7 @@ interface TabPanelProps {
|
|
|
7
8
|
value: number
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export function CustomTabPanel(props: TabPanelProps) {
|
|
11
|
+
export default function CustomTabPanel(props: TabPanelProps) {
|
|
11
12
|
const { children, value, index, ...other } = props
|
|
12
13
|
|
|
13
14
|
return (
|
|
@@ -22,9 +23,3 @@ export function CustomTabPanel(props: TabPanelProps) {
|
|
|
22
23
|
</div>
|
|
23
24
|
)
|
|
24
25
|
}
|
|
25
|
-
export function a11yProps(index: number) {
|
|
26
|
-
return {
|
|
27
|
-
id: `gtab-${index}`,
|
|
28
|
-
'aria-controls': `gtabpanel-${index}`,
|
|
29
|
-
}
|
|
30
|
-
}
|