jbrowse-plugin-msaview 2.0.6 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js +3 -3
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +1 -1
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js +3 -1
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js.map +1 -1
- package/dist/ExternalLink.d.ts +3 -0
- package/dist/ExternalLink.js +11 -0
- package/dist/ExternalLink.js.map +1 -0
- package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/NcbiBlastPanel.d.ts → EnsemblGeneTree/EnsemblGeneTree.d.ts} +2 -2
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js +76 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js.map +1 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.d.ts +13 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.js +12 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.js.map +1 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.d.ts +6 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js +25 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js.map +1 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.d.ts +2 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.js +20 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.js.map +1 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/types.d.ts +24 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/types.js +2 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/types.js.map +1 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.d.ts +10 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.js +27 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.js.map +1 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/util.d.ts +4 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/util.js +38 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/util.js.map +1 -0
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js +22 -16
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.d.ts +8 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +103 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.d.ts +1 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.js +12 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.js.map +1 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.d.ts +14 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js +12 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/launchView.js.map +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.d.ts +10 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +89 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.d.ts +10 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js +55 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js.map +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.d.ts +5 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js +11 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js.map +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.d.ts +7 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js +30 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js.map +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.d.ts +5 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js +26 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.js.map +1 -0
- package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/ncbiBlastLaunchView.d.ts → NCBIBlastQuery/blastLaunchView.d.ts} +2 -1
- package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/ncbiBlastLaunchView.js → NCBIBlastQuery/blastLaunchView.js} +3 -6
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js.map +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.d.ts +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js +2 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js.map +1 -0
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +18 -19
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/TabPanel.d.ts +6 -0
- package/dist/LaunchMsaView/components/TabPanel.js +6 -0
- package/dist/LaunchMsaView/components/TabPanel.js.map +1 -0
- package/dist/LaunchMsaView/components/TranscriptSelector.d.ts +10 -0
- package/dist/LaunchMsaView/components/TranscriptSelector.js +45 -0
- package/dist/LaunchMsaView/components/TranscriptSelector.js.map +1 -0
- package/dist/LaunchMsaView/components/calculateProteinSequence.d.ts +17 -0
- package/dist/LaunchMsaView/components/calculateProteinSequence.js +39 -0
- package/dist/LaunchMsaView/components/calculateProteinSequence.js.map +1 -0
- package/dist/LaunchMsaView/components/fetchSeq.d.ts +8 -0
- package/dist/LaunchMsaView/components/fetchSeq.js +23 -0
- package/dist/LaunchMsaView/components/fetchSeq.js.map +1 -0
- package/dist/LaunchMsaView/components/types.d.ts +10 -0
- package/dist/LaunchMsaView/components/types.js +2 -0
- package/dist/LaunchMsaView/components/types.js.map +1 -0
- package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/useFeatureSequence.d.ts → useFeatureSequence.d.ts} +3 -6
- package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/useFeatureSequence.js → useFeatureSequence.js} +13 -23
- package/dist/LaunchMsaView/components/useFeatureSequence.js.map +1 -0
- package/dist/LaunchMsaView/components/util.js.map +1 -0
- package/dist/LaunchMsaView/util.d.ts +5 -1
- package/dist/LaunchMsaView/util.js +15 -1
- package/dist/LaunchMsaView/util.js.map +1 -1
- package/dist/MsaViewPanel/components/LoadingBLAST.d.ts +2 -1
- package/dist/MsaViewPanel/components/LoadingBLAST.js +6 -6
- package/dist/MsaViewPanel/components/LoadingBLAST.js.map +1 -1
- package/dist/MsaViewPanel/components/MsaViewPanel.js +1 -1
- package/dist/MsaViewPanel/components/MsaViewPanel.js.map +1 -1
- package/dist/MsaViewPanel/components/RIDLink.d.ts +2 -1
- package/dist/MsaViewPanel/components/RIDLink.js +6 -9
- package/dist/MsaViewPanel/components/RIDLink.js.map +1 -1
- package/dist/MsaViewPanel/doLaunchBlast.js +18 -20
- package/dist/MsaViewPanel/doLaunchBlast.js.map +1 -1
- package/dist/MsaViewPanel/model.d.ts +15 -12
- package/dist/MsaViewPanel/model.js.map +1 -1
- package/dist/ReadOnlyTextField2.d.ts +4 -0
- package/dist/ReadOnlyTextField2.js +20 -0
- package/dist/ReadOnlyTextField2.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +33 -31
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
- package/dist/utils/fetch.d.ts +1 -1
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/ncbiBlast.d.ts +2 -2
- package/dist/utils/ncbiBlast.js +29 -15
- package/dist/utils/ncbiBlast.js.map +1 -1
- package/dist/utils/types.d.ts +20 -0
- package/dist/utils/types.js +2 -0
- package/dist/utils/types.js.map +1 -0
- package/package.json +3 -3
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +3 -3
- package/src/AddHighlightModel/MsaToGenomeHighlight.tsx +2 -1
- package/src/ExternalLink.tsx +15 -0
- package/src/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.tsx +127 -0
- package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.ts +30 -0
- package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.ts +46 -0
- package/src/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.ts +22 -0
- package/src/LaunchMsaView/components/EnsemblGeneTree/types.ts +28 -0
- package/src/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.ts +29 -0
- package/src/LaunchMsaView/components/EnsemblGeneTree/util.ts +45 -0
- package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +36 -21
- package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +219 -0
- package/src/LaunchMsaView/components/ManualMSALoader/fetchGeneList.ts +13 -0
- package/src/LaunchMsaView/components/ManualMSALoader/launchView.ts +34 -0
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +226 -0
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.tsx +111 -0
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.tsx +34 -0
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.tsx +82 -0
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBISettingsDialog.tsx +75 -0
- package/src/LaunchMsaView/components/{NewNCBIBlastQuery/ncbiBlastLaunchView.ts → NCBIBlastQuery/blastLaunchView.ts} +4 -5
- package/src/LaunchMsaView/components/NCBIBlastQuery/consts.ts +1 -0
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +28 -44
- package/src/LaunchMsaView/components/TabPanel.tsx +19 -0
- package/src/LaunchMsaView/components/TranscriptSelector.tsx +99 -0
- package/src/LaunchMsaView/components/calculateProteinSequence.ts +68 -0
- package/src/LaunchMsaView/components/fetchSeq.ts +37 -0
- package/src/LaunchMsaView/components/types.ts +11 -0
- package/src/LaunchMsaView/components/{NewNCBIBlastQuery/useFeatureSequence.ts → useFeatureSequence.ts} +20 -42
- package/src/LaunchMsaView/util.ts +22 -2
- package/src/MsaViewPanel/components/LoadingBLAST.tsx +26 -8
- package/src/MsaViewPanel/components/MsaViewPanel.tsx +5 -1
- package/src/MsaViewPanel/components/RIDLink.tsx +8 -8
- package/src/MsaViewPanel/doLaunchBlast.ts +29 -30
- package/src/MsaViewPanel/model.ts +1 -0
- package/src/ReadOnlyTextField2.tsx +33 -0
- package/src/index.ts +23 -0
- package/src/utils/fetch.ts +2 -2
- package/src/utils/ncbiBlast.ts +40 -30
- package/src/utils/types.ts +14 -0
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.js +0 -85
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.js.map +0 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.d.ts +0 -26
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.js +0 -48
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.js.map +0 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/index.d.ts +0 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/index.js +0 -2
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/index.js.map +0 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/ncbiBlastLaunchView.js.map +0 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/useFeatureSequence.js.map +0 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/util.js.map +0 -1
- package/dist/LaunchMsaView/components/TabUtils.d.ts +0 -8
- package/dist/LaunchMsaView/components/TabUtils.js +0 -7
- package/dist/LaunchMsaView/components/TabUtils.js.map +0 -1
- package/dist/LaunchMsaView/components/tabUtil.d.ts +0 -4
- package/dist/LaunchMsaView/components/tabUtil.js +0 -7
- package/dist/LaunchMsaView/components/tabUtil.js.map +0 -1
- package/dist/OpenInNewIcon.d.ts +0 -3
- package/dist/OpenInNewIcon.js +0 -8
- package/dist/OpenInNewIcon.js.map +0 -1
- package/src/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.tsx +0 -171
- package/src/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.ts +0 -92
- package/src/LaunchMsaView/components/NewNCBIBlastQuery/index.tsx +0 -1
- package/src/LaunchMsaView/components/TabUtils.tsx +0 -25
- package/src/LaunchMsaView/components/tabUtil.ts +0 -6
- package/src/OpenInNewIcon.tsx +0 -14
- /package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/util.d.ts → util.d.ts} +0 -0
- /package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/util.js → util.js} +0 -0
- /package/src/LaunchMsaView/components/{NewNCBIBlastQuery/util.ts → util.ts} +0 -0
package/dist/utils/fetch.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function myfetch(url: string, args?: RequestInit): Promise<Response>;
|
|
2
2
|
export declare function textfetch(url: string, args?: RequestInit): Promise<string>;
|
|
3
|
-
export declare function jsonfetch(url: string, args?: RequestInit): Promise<
|
|
3
|
+
export declare function jsonfetch<T>(url: string, args?: RequestInit): Promise<T>;
|
|
4
4
|
export declare function timeout(time: number): Promise<unknown>;
|
package/dist/utils/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,GAAW,EAAE,IAAkB;IAC3D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEvC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,QAAQ,QAAQ,CAAC,MAAM,aAAa,GAAG,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CACnE,CAAA;IACH,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,IAAkB;IAC7D,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACzC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;AACxB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,GAAW,EAAE,IAAkB;IAC3D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAEvC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,QAAQ,QAAQ,CAAC,MAAM,aAAa,GAAG,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CACnE,CAAA;IACH,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,IAAkB;IAC7D,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACzC,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;AACxB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAI,GAAW,EAAE,IAAkB;IAChE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IACzC,OAAO,QAAQ,CAAC,IAAI,EAAgB,CAAA;AACtC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAA;AAClD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare function queryBlast({ query, blastDatabase, blastProgram, onProgress, onRid, }: {
|
|
1
|
+
export declare function queryBlast({ query, blastDatabase, blastProgram, baseUrl, onProgress, onRid, }: {
|
|
3
2
|
query: string;
|
|
4
3
|
blastDatabase: string;
|
|
5
4
|
blastProgram: string;
|
|
5
|
+
baseUrl: string;
|
|
6
6
|
onProgress: (arg: string) => void;
|
|
7
7
|
onRid: (arg: string) => void;
|
|
8
8
|
}): Promise<{
|
package/dist/utils/ncbiBlast.js
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { jsonfetch, textfetch, timeout } from './fetch';
|
|
2
|
-
export
|
|
3
|
-
export async function queryBlast({ query, blastDatabase, blastProgram, onProgress, onRid, }) {
|
|
2
|
+
export async function queryBlast({ query, blastDatabase, blastProgram, baseUrl, onProgress, onRid, }) {
|
|
4
3
|
onProgress('Submitting to NCBI BLAST...');
|
|
5
4
|
const { rid } = await initialQuery({
|
|
6
5
|
query,
|
|
7
6
|
blastDatabase,
|
|
8
7
|
blastProgram,
|
|
8
|
+
baseUrl,
|
|
9
9
|
});
|
|
10
10
|
onRid(rid);
|
|
11
|
-
await waitForRid({
|
|
12
|
-
|
|
11
|
+
await waitForRid({
|
|
12
|
+
rid,
|
|
13
|
+
onProgress,
|
|
14
|
+
baseUrl,
|
|
15
|
+
});
|
|
16
|
+
const ret = await jsonfetch(`${baseUrl}?CMD=Get&RID=${rid}&FORMAT_TYPE=JSON2_S&FORMAT_OBJECT=Alignment`);
|
|
13
17
|
return {
|
|
14
18
|
rid,
|
|
15
19
|
hits: ret.BlastOutput2[0]?.report.results.search.hits ?? [],
|
|
16
20
|
};
|
|
17
21
|
}
|
|
18
|
-
async function initialQuery({ query, blastProgram, blastDatabase, }) {
|
|
19
|
-
const res = await textfetch(
|
|
22
|
+
async function initialQuery({ query, blastProgram, blastDatabase, baseUrl, }) {
|
|
23
|
+
const res = await textfetch(baseUrl, {
|
|
20
24
|
method: 'POST',
|
|
21
25
|
body: new URLSearchParams({
|
|
22
26
|
CMD: 'Put',
|
|
23
|
-
PROGRAM: blastProgram,
|
|
27
|
+
PROGRAM: blastProgram === 'quick-blastp' ? 'blastp' : blastProgram,
|
|
24
28
|
DATABASE: blastDatabase,
|
|
25
29
|
QUERY: query,
|
|
26
30
|
...(blastDatabase === 'nr_clustered_seq'
|
|
@@ -29,6 +33,9 @@ async function initialQuery({ query, blastProgram, blastDatabase, }) {
|
|
|
29
33
|
DB_TYPE: 'Experimental Databases',
|
|
30
34
|
}
|
|
31
35
|
: {}),
|
|
36
|
+
...(blastProgram === 'quick-blastp'
|
|
37
|
+
? { BLAST_PROGRAMS: 'kmerBlastp' }
|
|
38
|
+
: {}),
|
|
32
39
|
}),
|
|
33
40
|
});
|
|
34
41
|
// the initial submission/query to the BLAST "REST API" does not return JSON
|
|
@@ -39,9 +46,12 @@ async function initialQuery({ query, blastProgram, blastDatabase, }) {
|
|
|
39
46
|
if (!rid) {
|
|
40
47
|
throw new Error('Failed to get RID from BLAST request');
|
|
41
48
|
}
|
|
42
|
-
return {
|
|
49
|
+
return {
|
|
50
|
+
rid,
|
|
51
|
+
rtoe,
|
|
52
|
+
};
|
|
43
53
|
}
|
|
44
|
-
async function waitForRid({ rid, onProgress, }) {
|
|
54
|
+
async function waitForRid({ rid, onProgress, baseUrl, }) {
|
|
45
55
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
46
56
|
while (true) {
|
|
47
57
|
const iter = 20;
|
|
@@ -49,15 +59,19 @@ async function waitForRid({ rid, onProgress, }) {
|
|
|
49
59
|
await timeout(1000);
|
|
50
60
|
onProgress(`Re-checking BLAST status in... ${iter - i}`);
|
|
51
61
|
}
|
|
52
|
-
const res = await textfetch(`${
|
|
53
|
-
|
|
62
|
+
const res = await textfetch(`${baseUrl}?CMD=Get&FORMAT_OBJECT=SearchInfo&RID=${rid}`);
|
|
63
|
+
const isWaiting = /\s+Status=WAITING/m.test(res);
|
|
64
|
+
const isFailed = /\s+Status=FAILED/m.test(res);
|
|
65
|
+
const isReady = /\s+Status=READY/m.test(res);
|
|
66
|
+
const hasHits = /\s+ThereAreHits=yes/m.test(res);
|
|
67
|
+
if (isWaiting) {
|
|
54
68
|
continue;
|
|
55
69
|
}
|
|
56
|
-
|
|
57
|
-
throw new Error(`BLAST ${rid} failed
|
|
70
|
+
if (isFailed) {
|
|
71
|
+
throw new Error(`BLAST ${rid} failed`);
|
|
58
72
|
}
|
|
59
|
-
|
|
60
|
-
if (
|
|
73
|
+
if (isReady) {
|
|
74
|
+
if (hasHits) {
|
|
61
75
|
return true;
|
|
62
76
|
}
|
|
63
77
|
else {
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"ncbiBlast.js","sourceRoot":"","sources":["../../src/utils/ncbiBlast.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface BlastResults {
|
|
2
|
+
BlastOutput2: {
|
|
3
|
+
report: {
|
|
4
|
+
results: {
|
|
5
|
+
search: {
|
|
6
|
+
hits: {
|
|
7
|
+
description: {
|
|
8
|
+
accession: string;
|
|
9
|
+
id: string;
|
|
10
|
+
sciname: string;
|
|
11
|
+
}[];
|
|
12
|
+
hsps: {
|
|
13
|
+
hseq: string;
|
|
14
|
+
}[];
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.0
|
|
2
|
+
"version": "2.2.0",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "jbrowse-plugin-msaview",
|
|
5
5
|
"keywords": [
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"@mui/x-data-grid": "^8.2.0",
|
|
53
53
|
"@types/node": "^22.10.7",
|
|
54
54
|
"@types/pako": "^2.0.1",
|
|
55
|
-
"@types/react": "^19.
|
|
55
|
+
"@types/react": "^19.1.6",
|
|
56
56
|
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
57
57
|
"@typescript-eslint/parser": "^8.0.1",
|
|
58
|
-
"esbuild": "^0.25.
|
|
58
|
+
"esbuild": "^0.25.5",
|
|
59
59
|
"eslint": "^9.0.0",
|
|
60
60
|
"eslint-plugin-import": "^2.31.0",
|
|
61
61
|
"eslint-plugin-react": "^7.20.3",
|
|
@@ -7,7 +7,7 @@ import { useStyles } from './util'
|
|
|
7
7
|
|
|
8
8
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
9
9
|
|
|
10
|
-
const GenomeMouseoverHighlight = observer(function
|
|
10
|
+
const GenomeMouseoverHighlight = observer(function ({
|
|
11
11
|
model,
|
|
12
12
|
}: {
|
|
13
13
|
model: LinearGenomeViewModel
|
|
@@ -16,11 +16,11 @@ const GenomeMouseoverHighlight = observer(function GenomeMouseoverHighlight2({
|
|
|
16
16
|
return hovered &&
|
|
17
17
|
typeof hovered === 'object' &&
|
|
18
18
|
'hoverPosition' in hovered ? (
|
|
19
|
-
<
|
|
19
|
+
<GenomeMouseoverHighlightPostNullCheck model={model} />
|
|
20
20
|
) : null
|
|
21
21
|
})
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const GenomeMouseoverHighlightPostNullCheck = observer(function ({
|
|
24
24
|
model,
|
|
25
25
|
}: {
|
|
26
26
|
model: LinearGenomeViewModel
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import OpenInNewIcon from '@mui/icons-material/OpenInNew'
|
|
4
|
+
import { Link } from '@mui/material'
|
|
5
|
+
|
|
6
|
+
import type { LinkProps } from '@mui/material'
|
|
7
|
+
|
|
8
|
+
export default function ExternalLink(props: LinkProps) {
|
|
9
|
+
const { children, ...rest } = props
|
|
10
|
+
return (
|
|
11
|
+
<Link {...rest} target="_blank" rel="noreferrer">
|
|
12
|
+
{children} <OpenInNewIcon fontSize="small" />
|
|
13
|
+
</Link>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui'
|
|
4
|
+
import {
|
|
5
|
+
AbstractTrackModel,
|
|
6
|
+
Feature,
|
|
7
|
+
getContainingView,
|
|
8
|
+
getSession,
|
|
9
|
+
} from '@jbrowse/core/util'
|
|
10
|
+
import { Button, DialogActions, DialogContent, Link } from '@mui/material'
|
|
11
|
+
import { observer } from 'mobx-react'
|
|
12
|
+
import { makeStyles } from 'tss-react/mui'
|
|
13
|
+
|
|
14
|
+
import { ensemblGeneTreeLaunchView } from './ensemblGeneTreeLaunchView'
|
|
15
|
+
import { useGeneTree } from './useGeneTree'
|
|
16
|
+
import { getGeneDisplayName, getId, getTranscriptFeatures } from '../../util'
|
|
17
|
+
import TranscriptSelector from '../TranscriptSelector'
|
|
18
|
+
import { useFeatureSequence } from '../useFeatureSequence'
|
|
19
|
+
|
|
20
|
+
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const useStyles = makeStyles()({
|
|
24
|
+
dialogContent: {
|
|
25
|
+
width: '80em',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
gap: 16,
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const EnsemblGeneTree = observer(function ({
|
|
33
|
+
model,
|
|
34
|
+
feature,
|
|
35
|
+
handleClose,
|
|
36
|
+
}: {
|
|
37
|
+
model: AbstractTrackModel
|
|
38
|
+
feature: Feature
|
|
39
|
+
handleClose: () => void
|
|
40
|
+
}) {
|
|
41
|
+
const session = getSession(model)
|
|
42
|
+
const view = getContainingView(model) as LinearGenomeViewModel
|
|
43
|
+
const { classes } = useStyles()
|
|
44
|
+
const [launchViewError, setLaunchViewError] = useState<unknown>()
|
|
45
|
+
const options = getTranscriptFeatures(feature)
|
|
46
|
+
const [userSelection, setUserSelection] = useState(getId(options[0]))
|
|
47
|
+
const { treeData, isTreeLoading, treeError } = useGeneTree(userSelection)
|
|
48
|
+
const selectedTranscript = options.find(val => getId(val) === userSelection)!
|
|
49
|
+
|
|
50
|
+
const { proteinSequence, error: featureSequenceError } = useFeatureSequence({
|
|
51
|
+
view,
|
|
52
|
+
feature: selectedTranscript,
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const loadingMessage = isTreeLoading
|
|
56
|
+
? 'Loading tree data from Ensembl GeneTree'
|
|
57
|
+
: undefined
|
|
58
|
+
const e = treeError ?? launchViewError ?? featureSequenceError
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<>
|
|
62
|
+
<DialogContent className={classes.dialogContent}>
|
|
63
|
+
{e ? <ErrorMessage error={e} /> : null}
|
|
64
|
+
{loadingMessage ? <LoadingEllipses message={loadingMessage} /> : null}
|
|
65
|
+
{treeData ? (
|
|
66
|
+
<div>
|
|
67
|
+
<div>Found Ensembl Compara GeneTree: {treeData.geneTreeId}</div>
|
|
68
|
+
<Link
|
|
69
|
+
target="_blank"
|
|
70
|
+
href={`https://useast.ensembl.org/Multi/GeneTree/Image?gt=${treeData.geneTreeId}`}
|
|
71
|
+
>
|
|
72
|
+
See {treeData.geneTreeId} at Ensembl
|
|
73
|
+
</Link>
|
|
74
|
+
</div>
|
|
75
|
+
) : null}
|
|
76
|
+
|
|
77
|
+
<TranscriptSelector
|
|
78
|
+
feature={feature}
|
|
79
|
+
options={options}
|
|
80
|
+
selectedTranscriptId={userSelection}
|
|
81
|
+
onTranscriptChange={setUserSelection}
|
|
82
|
+
proteinSequence={proteinSequence}
|
|
83
|
+
/>
|
|
84
|
+
</DialogContent>
|
|
85
|
+
|
|
86
|
+
<DialogActions>
|
|
87
|
+
<Button
|
|
88
|
+
color="primary"
|
|
89
|
+
variant="contained"
|
|
90
|
+
onClick={() => {
|
|
91
|
+
try {
|
|
92
|
+
if (!treeData) {
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
setLaunchViewError(undefined)
|
|
96
|
+
|
|
97
|
+
ensemblGeneTreeLaunchView({
|
|
98
|
+
feature,
|
|
99
|
+
view,
|
|
100
|
+
session,
|
|
101
|
+
newViewTitle: getGeneDisplayName(feature),
|
|
102
|
+
data: treeData,
|
|
103
|
+
})
|
|
104
|
+
handleClose()
|
|
105
|
+
} catch (e) {
|
|
106
|
+
console.error(e)
|
|
107
|
+
setLaunchViewError(e)
|
|
108
|
+
}
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
Submit
|
|
112
|
+
</Button>
|
|
113
|
+
<Button
|
|
114
|
+
color="secondary"
|
|
115
|
+
variant="contained"
|
|
116
|
+
onClick={() => {
|
|
117
|
+
handleClose()
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
Cancel
|
|
121
|
+
</Button>
|
|
122
|
+
</DialogActions>
|
|
123
|
+
</>
|
|
124
|
+
)
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
export default EnsemblGeneTree
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AbstractSessionModel, Feature } from '@jbrowse/core/util'
|
|
2
|
+
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
3
|
+
|
|
4
|
+
export function ensemblGeneTreeLaunchView({
|
|
5
|
+
session,
|
|
6
|
+
newViewTitle,
|
|
7
|
+
view,
|
|
8
|
+
feature,
|
|
9
|
+
data,
|
|
10
|
+
}: {
|
|
11
|
+
session: AbstractSessionModel
|
|
12
|
+
newViewTitle: string
|
|
13
|
+
view: LinearGenomeViewModel
|
|
14
|
+
feature: Feature
|
|
15
|
+
data: {
|
|
16
|
+
tree: string
|
|
17
|
+
msa: string
|
|
18
|
+
treeMetadata: string
|
|
19
|
+
}
|
|
20
|
+
}) {
|
|
21
|
+
session.addView('MsaView', {
|
|
22
|
+
type: 'MsaView',
|
|
23
|
+
displayName: newViewTitle,
|
|
24
|
+
colWidth: 10,
|
|
25
|
+
rowHeight: 12,
|
|
26
|
+
data,
|
|
27
|
+
connectedViewId: view.id,
|
|
28
|
+
connectedFeature: feature.toJSON(),
|
|
29
|
+
})
|
|
30
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { gatherSequencesFromTree } from './gatherSequencesFromTree'
|
|
2
|
+
import { TreeNode } from './types'
|
|
3
|
+
import { fetchWithLocalStorageCache, jsonfetch, textfetch } from './util'
|
|
4
|
+
|
|
5
|
+
const base = 'https://rest.ensembl.org'
|
|
6
|
+
|
|
7
|
+
export async function geneTreeFetcher(id2: string) {
|
|
8
|
+
const id = id2.replace(/\..*/, '')
|
|
9
|
+
const { species } = await fetchWithLocalStorageCache(`${id}-ensembl`, () =>
|
|
10
|
+
jsonfetch<{ species: string }>(
|
|
11
|
+
`${base}/lookup/id/${id}?content-type=application/json`,
|
|
12
|
+
),
|
|
13
|
+
)
|
|
14
|
+
const treeBase = `${base}/genetree/member/id/${species}/${id}`
|
|
15
|
+
const geneTreeResult = await fetchWithLocalStorageCache(`${id}-msa`, () =>
|
|
16
|
+
jsonfetch<{ tree: TreeNode; id: string }>(
|
|
17
|
+
`${treeBase}?content-type=application/json;aligned=1;sequence=pep`,
|
|
18
|
+
),
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
// we query again to get newick format tree. could probably extract from json
|
|
22
|
+
// as alternative
|
|
23
|
+
const tree = await fetchWithLocalStorageCache<string>(`${id}-tree`, () =>
|
|
24
|
+
textfetch(`${treeBase}?nh_format=simple;content-type=text/x-nh`),
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
const res = gatherSequencesFromTree(geneTreeResult.tree)
|
|
28
|
+
return {
|
|
29
|
+
geneTreeId: geneTreeResult.id,
|
|
30
|
+
tree,
|
|
31
|
+
msa: res.map(r => `>${r.id}\n${r.seq}`).join('\n'),
|
|
32
|
+
treeMetadata: JSON.stringify(
|
|
33
|
+
Object.fromEntries(
|
|
34
|
+
res.map(
|
|
35
|
+
r =>
|
|
36
|
+
[
|
|
37
|
+
r.id,
|
|
38
|
+
{
|
|
39
|
+
genome: r.species,
|
|
40
|
+
},
|
|
41
|
+
] as const,
|
|
42
|
+
),
|
|
43
|
+
),
|
|
44
|
+
),
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TreeNode, TreeRow } from './types'
|
|
2
|
+
|
|
3
|
+
export function gatherSequencesFromTree(tree: TreeNode, arr: TreeRow[] = []) {
|
|
4
|
+
if (tree.children) {
|
|
5
|
+
for (const child of tree.children) {
|
|
6
|
+
if (child.sequence) {
|
|
7
|
+
const id = child.sequence.id[0]?.accession
|
|
8
|
+
if (id) {
|
|
9
|
+
arr.push({
|
|
10
|
+
id,
|
|
11
|
+
seq: child.sequence.mol_seq.seq,
|
|
12
|
+
species:
|
|
13
|
+
child.taxonomy.common_name || child.taxonomy.scientific_name,
|
|
14
|
+
genomicLocString: child.sequence.mol_seq.location,
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
gatherSequencesFromTree(child, arr)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return arr
|
|
22
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface TreeNodeSequence {
|
|
2
|
+
mol_seq: {
|
|
3
|
+
seq: string
|
|
4
|
+
location?: string
|
|
5
|
+
}
|
|
6
|
+
id: {
|
|
7
|
+
accession: string
|
|
8
|
+
}[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface TreeNodeTaxonomy {
|
|
12
|
+
common_name: string
|
|
13
|
+
scientific_name: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// This is a self-referential tree data structure
|
|
17
|
+
export interface TreeNode {
|
|
18
|
+
children?: TreeNode[]
|
|
19
|
+
sequence?: TreeNodeSequence
|
|
20
|
+
taxonomy: TreeNodeTaxonomy
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface TreeRow {
|
|
24
|
+
id: string
|
|
25
|
+
seq: string
|
|
26
|
+
species: string
|
|
27
|
+
genomicLocString?: string
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { geneTreeFetcher } from './ensemblGeneTreeUtils'
|
|
4
|
+
|
|
5
|
+
type Ret = Awaited<ReturnType<typeof geneTreeFetcher>>
|
|
6
|
+
|
|
7
|
+
export function useGeneTree(geneId: string) {
|
|
8
|
+
const [treeData, setTreeData] = useState<Ret>()
|
|
9
|
+
const [isTreeLoading, setIsTreeLoading] = useState(false)
|
|
10
|
+
const [treeError, setTreeError] = useState<unknown>()
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
14
|
+
;(async () => {
|
|
15
|
+
try {
|
|
16
|
+
setIsTreeLoading(true)
|
|
17
|
+
const result = await geneTreeFetcher(geneId)
|
|
18
|
+
setTreeData(result)
|
|
19
|
+
} catch (e) {
|
|
20
|
+
console.error(e)
|
|
21
|
+
setTreeError(e)
|
|
22
|
+
} finally {
|
|
23
|
+
setIsTreeLoading(false)
|
|
24
|
+
}
|
|
25
|
+
})()
|
|
26
|
+
}, [geneId])
|
|
27
|
+
|
|
28
|
+
return { treeData, isTreeLoading, treeError }
|
|
29
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ungzip } from 'pako'
|
|
2
|
+
|
|
3
|
+
export async function jsonfetch<T>(url: string, arg?: RequestInit) {
|
|
4
|
+
const res = await fetch(url, arg)
|
|
5
|
+
if (!res.ok) {
|
|
6
|
+
throw new Error(`HTTP ${res.status} from ${url}: ${await res.text()}`)
|
|
7
|
+
}
|
|
8
|
+
return res.json() as Promise<T>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function textfetch(url: string, arg?: RequestInit) {
|
|
12
|
+
const res = await fetch(url, arg)
|
|
13
|
+
if (!res.ok) {
|
|
14
|
+
throw new Error(`HTTP ${res.status} from ${url}`)
|
|
15
|
+
}
|
|
16
|
+
return res.text()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function fetchWithLocalStorageCache<T>(
|
|
20
|
+
key: string,
|
|
21
|
+
fetchFn: () => Promise<T>,
|
|
22
|
+
): Promise<T> {
|
|
23
|
+
const cachedData = localStorage.getItem(key)
|
|
24
|
+
|
|
25
|
+
if (cachedData) {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(cachedData) as T
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error(`Error parsing cached data for ${key}:`, error)
|
|
30
|
+
// Continue to fetch fresh data if parsing fails
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const data = await fetchFn()
|
|
35
|
+
localStorage.setItem(key, JSON.stringify(data))
|
|
36
|
+
return data
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function unzipfetch(url: string, arg?: RequestInit) {
|
|
40
|
+
const res = await fetch(url, arg)
|
|
41
|
+
if (!res.ok) {
|
|
42
|
+
throw new Error(`HTTP ${res.status} from ${url}: ${await res.text()}`)
|
|
43
|
+
}
|
|
44
|
+
return ungzip(await res.arrayBuffer(), { to: 'string' })
|
|
45
|
+
}
|
|
@@ -2,12 +2,13 @@ import React, { useState } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { Dialog } from '@jbrowse/core/ui'
|
|
4
4
|
import { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
5
|
-
import {
|
|
5
|
+
import { Tab, Tabs } from '@mui/material'
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import EnsemblGeneTree from './EnsemblGeneTree/EnsemblGeneTree'
|
|
8
|
+
import ManualMSALoader from './ManualMSALoader/ManualMSALoader'
|
|
9
|
+
import NCBIBlastPanel from './NCBIBlastQuery/NCBIBlastPanel'
|
|
8
10
|
import PreLoadedMSA from './PreLoadedMSA/PreLoadedMSADataPanel'
|
|
9
|
-
import
|
|
10
|
-
import { a11yProps } from './tabUtil'
|
|
11
|
+
import TabPanel from './TabPanel'
|
|
11
12
|
|
|
12
13
|
export default function LaunchProteinViewDialog({
|
|
13
14
|
handleClose,
|
|
@@ -24,36 +25,50 @@ export default function LaunchProteinViewDialog({
|
|
|
24
25
|
<Dialog
|
|
25
26
|
maxWidth="xl"
|
|
26
27
|
title="Launch MSA view"
|
|
28
|
+
open
|
|
27
29
|
onClose={() => {
|
|
28
30
|
handleClose()
|
|
29
31
|
}}
|
|
30
|
-
open
|
|
31
32
|
>
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</
|
|
43
|
-
<
|
|
44
|
-
<
|
|
33
|
+
<Tabs
|
|
34
|
+
value={value}
|
|
35
|
+
onChange={(_, val) => {
|
|
36
|
+
setValue(val)
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
<Tab label="NCBI BLAST query" value={0} />
|
|
40
|
+
<Tab label="UCSC 100-way dataset" value={1} />
|
|
41
|
+
<Tab label="Ensembl GeneTree" value={2} />
|
|
42
|
+
<Tab label="Manually open MSA/tree" value={3} />
|
|
43
|
+
</Tabs>
|
|
44
|
+
<TabPanel value={value} index={0}>
|
|
45
|
+
<NCBIBlastPanel
|
|
45
46
|
handleClose={handleClose}
|
|
46
47
|
feature={feature}
|
|
47
48
|
model={model}
|
|
48
49
|
/>
|
|
49
|
-
</
|
|
50
|
-
<
|
|
50
|
+
</TabPanel>
|
|
51
|
+
<TabPanel value={value} index={1}>
|
|
51
52
|
<PreLoadedMSA
|
|
52
53
|
model={model}
|
|
53
54
|
feature={feature}
|
|
54
55
|
handleClose={handleClose}
|
|
55
56
|
/>
|
|
56
|
-
</
|
|
57
|
+
</TabPanel>
|
|
58
|
+
<TabPanel value={value} index={2}>
|
|
59
|
+
<EnsemblGeneTree
|
|
60
|
+
model={model}
|
|
61
|
+
feature={feature}
|
|
62
|
+
handleClose={handleClose}
|
|
63
|
+
/>
|
|
64
|
+
</TabPanel>
|
|
65
|
+
<TabPanel value={value} index={3}>
|
|
66
|
+
<ManualMSALoader
|
|
67
|
+
model={model}
|
|
68
|
+
feature={feature}
|
|
69
|
+
handleClose={handleClose}
|
|
70
|
+
/>
|
|
71
|
+
</TabPanel>
|
|
57
72
|
</Dialog>
|
|
58
73
|
)
|
|
59
74
|
}
|