jbrowse-plugin-msaview 2.1.0 → 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/EnsemblGeneTree/EnsemblGeneTree.js +28 -33
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js.map +1 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.js +0 -6
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.js.map +1 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.d.ts +1 -0
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js +12 -22
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js.map +1 -1
- 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.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/LaunchMsaViewDialog.js +5 -5
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
- package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/NcbiBlastPanel.d.ts → ManualMSALoader/ManualMSALoader.d.ts} +2 -2
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +103 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -0
- package/dist/LaunchMsaView/components/{EnsemblGeneTree → ManualMSALoader}/fetchGeneList.js.map +1 -1
- 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/{MSALoader/MSALoader.d.ts → NCBIBlastQuery/NCBIBlastAutomaticPanel.d.ts} +4 -2
- 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 +17 -16
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
- 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/{NewNCBIBlastQuery/calculateProteinSequence.d.ts → calculateProteinSequence.d.ts} +1 -2
- package/dist/LaunchMsaView/components/calculateProteinSequence.js +39 -0
- package/dist/LaunchMsaView/components/calculateProteinSequence.js.map +1 -0
- package/dist/LaunchMsaView/components/fetchSeq.js.map +1 -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} +2 -1
- package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/useFeatureSequence.js → useFeatureSequence.js} +12 -1
- 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 +3 -4
- 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 +41 -51
- 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 +39 -55
- package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.ts +0 -6
- package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.ts +19 -54
- 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/LaunchMsaViewDialog.tsx +9 -5
- package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +219 -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 +27 -37
- package/src/LaunchMsaView/components/TranscriptSelector.tsx +99 -0
- package/src/LaunchMsaView/components/{NewNCBIBlastQuery/calculateProteinSequence.ts → calculateProteinSequence.ts} +12 -22
- package/src/LaunchMsaView/components/{NewNCBIBlastQuery/useFeatureSequence.ts → useFeatureSequence.ts} +16 -2
- 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/MSALoader/MSALoader.js +0 -94
- package/dist/LaunchMsaView/components/MSALoader/MSALoader.js.map +0 -1
- package/dist/LaunchMsaView/components/MSALoader/fetchGeneList.d.ts +0 -1
- package/dist/LaunchMsaView/components/MSALoader/fetchGeneList.js +0 -12
- package/dist/LaunchMsaView/components/MSALoader/fetchGeneList.js.map +0 -1
- package/dist/LaunchMsaView/components/MSALoader/preCalculatedLaunchView.d.ts +0 -9
- package/dist/LaunchMsaView/components/MSALoader/preCalculatedLaunchView.js +0 -36
- package/dist/LaunchMsaView/components/MSALoader/preCalculatedLaunchView.js.map +0 -1
- 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.js +0 -47
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/calculateProteinSequence.js.map +0 -1
- package/dist/LaunchMsaView/components/NewNCBIBlastQuery/fetchSeq.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/types.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/OpenInNewIcon.d.ts +0 -3
- package/dist/OpenInNewIcon.js +0 -8
- package/dist/OpenInNewIcon.js.map +0 -1
- package/src/LaunchMsaView/components/MSALoader/MSALoader.tsx +0 -130
- package/src/LaunchMsaView/components/MSALoader/fetchGeneList.ts +0 -13
- package/src/LaunchMsaView/components/MSALoader/preCalculatedLaunchView.ts +0 -55
- package/src/LaunchMsaView/components/NewNCBIBlastQuery/NcbiBlastPanel.tsx +0 -171
- package/src/LaunchMsaView/components/NewNCBIBlastQuery/index.tsx +0 -1
- package/src/OpenInNewIcon.tsx +0 -14
- /package/dist/LaunchMsaView/components/{NewNCBIBlastQuery → EnsemblGeneTree}/types.js +0 -0
- /package/dist/LaunchMsaView/components/{EnsemblGeneTree → ManualMSALoader}/fetchGeneList.d.ts +0 -0
- /package/dist/LaunchMsaView/components/{EnsemblGeneTree → ManualMSALoader}/fetchGeneList.js +0 -0
- /package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/fetchSeq.d.ts → fetchSeq.d.ts} +0 -0
- /package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/fetchSeq.js → fetchSeq.js} +0 -0
- /package/dist/LaunchMsaView/components/{NewNCBIBlastQuery/types.d.ts → types.d.ts} +0 -0
- /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/{EnsemblGeneTree → ManualMSALoader}/fetchGeneList.ts +0 -0
- /package/src/LaunchMsaView/components/{NewNCBIBlastQuery/fetchSeq.ts → fetchSeq.ts} +0 -0
- /package/src/LaunchMsaView/components/{NewNCBIBlastQuery/types.ts → types.ts} +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":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGvD,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,KAAK,EACL,aAAa,EACb,YAAY,EACZ,OAAO,EACP,UAAU,EACV,KAAK,GAQN;IACC,UAAU,CAAC,6BAA6B,CAAC,CAAA;IACzC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,YAAY,CAAC;QACjC,KAAK;QACL,aAAa;QACb,YAAY;QACZ,OAAO;KACR,CAAC,CAAA;IACF,KAAK,CAAC,GAAG,CAAC,CAAA;IACV,MAAM,UAAU,CAAC;QACf,GAAG;QACH,UAAU;QACV,OAAO;KACR,CAAC,CAAA;IACF,MAAM,GAAG,GAAG,MAAM,SAAS,CACzB,GAAG,OAAO,gBAAgB,GAAG,8CAA8C,CAC5E,CAAA;IACD,OAAO;QACL,GAAG;QACH,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;KAC5D,CAAA;AACH,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,EAC1B,KAAK,EACL,YAAY,EACZ,aAAa,EACb,OAAO,GAMR;IACC,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,OAAO,EAAE;QACnC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,eAAe,CAAC;YACxB,GAAG,EAAE,KAAK;YACV,OAAO,EAAE,YAAY,KAAK,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY;YAClE,QAAQ,EAAE,aAAa;YACvB,KAAK,EAAE,KAAK;YACZ,GAAG,CAAC,aAAa,KAAK,kBAAkB;gBACtC,CAAC,CAAC;oBACE,YAAY,EAAE,IAAI;oBAClB,OAAO,EAAE,wBAAwB;iBAClC;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,YAAY,KAAK,cAAc;gBACjC,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE;gBAClC,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;KACH,CAAC,CAAA;IAEF,4EAA4E;IAC5E,qEAAqE;IACrE,8DAA8D;IAC9D,MAAM,GAAG,GAAG,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAC9C,MAAM,IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAEhD,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACzD,CAAC;IACD,OAAO;QACL,GAAG;QACH,IAAI;KACL,CAAA;AACH,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,EACxB,GAAG,EACH,UAAU,EACV,OAAO,GAKR;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,OAAO,yCAAyC,GAAG,EAAE,CACzD,CAAA;QACD,MAAM,SAAS,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAChD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC9C,MAAM,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC5C,MAAM,OAAO,GAAG,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEhD,IAAI,SAAS,EAAE,CAAC;YACd,SAAQ;QACV,CAAC;QAED,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC,CAAA;QACxC,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,IAAI,CAAA;YACb,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAA;YAClC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -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.
|
|
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
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import { ErrorMessage, LoadingEllipses } from '@jbrowse/core/ui'
|
|
4
4
|
import {
|
|
@@ -7,36 +7,28 @@ import {
|
|
|
7
7
|
getContainingView,
|
|
8
8
|
getSession,
|
|
9
9
|
} from '@jbrowse/core/util'
|
|
10
|
-
import {
|
|
11
|
-
Button,
|
|
12
|
-
DialogActions,
|
|
13
|
-
DialogContent,
|
|
14
|
-
MenuItem,
|
|
15
|
-
TextField,
|
|
16
|
-
Typography,
|
|
17
|
-
} from '@mui/material'
|
|
10
|
+
import { Button, DialogActions, DialogContent, Link } from '@mui/material'
|
|
18
11
|
import { observer } from 'mobx-react'
|
|
19
12
|
import { makeStyles } from 'tss-react/mui'
|
|
20
13
|
|
|
21
14
|
import { ensemblGeneTreeLaunchView } from './ensemblGeneTreeLaunchView'
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
getTranscriptDisplayName,
|
|
27
|
-
getTranscriptFeatures,
|
|
28
|
-
} from '../../util'
|
|
15
|
+
import { useGeneTree } from './useGeneTree'
|
|
16
|
+
import { getGeneDisplayName, getId, getTranscriptFeatures } from '../../util'
|
|
17
|
+
import TranscriptSelector from '../TranscriptSelector'
|
|
18
|
+
import { useFeatureSequence } from '../useFeatureSequence'
|
|
29
19
|
|
|
30
20
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
31
21
|
|
|
22
|
+
|
|
32
23
|
const useStyles = makeStyles()({
|
|
33
24
|
dialogContent: {
|
|
34
25
|
width: '80em',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
gap: 16,
|
|
35
29
|
},
|
|
36
30
|
})
|
|
37
31
|
|
|
38
|
-
type Ret = Awaited<ReturnType<typeof geneTreeFetcher>>
|
|
39
|
-
|
|
40
32
|
const EnsemblGeneTree = observer(function ({
|
|
41
33
|
model,
|
|
42
34
|
feature,
|
|
@@ -49,54 +41,46 @@ const EnsemblGeneTree = observer(function ({
|
|
|
49
41
|
const session = getSession(model)
|
|
50
42
|
const view = getContainingView(model) as LinearGenomeViewModel
|
|
51
43
|
const { classes } = useStyles()
|
|
52
|
-
const [
|
|
53
|
-
const [treeData, setTreeData] = useState<Ret>()
|
|
54
|
-
const [isTreeLoading, setIsTreeLoading] = useState(false)
|
|
55
|
-
const [treeError, setTreeError] = useState<unknown>()
|
|
44
|
+
const [launchViewError, setLaunchViewError] = useState<unknown>()
|
|
56
45
|
const options = getTranscriptFeatures(feature)
|
|
57
46
|
const [userSelection, setUserSelection] = useState(getId(options[0]))
|
|
47
|
+
const { treeData, isTreeLoading, treeError } = useGeneTree(userSelection)
|
|
48
|
+
const selectedTranscript = options.find(val => getId(val) === userSelection)!
|
|
58
49
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
setIsTreeLoading(true)
|
|
64
|
-
const result = await geneTreeFetcher(userSelection)
|
|
65
|
-
setTreeData(result)
|
|
66
|
-
} catch (e) {
|
|
67
|
-
console.error(e)
|
|
68
|
-
setTreeError(e)
|
|
69
|
-
} finally {
|
|
70
|
-
setIsTreeLoading(false)
|
|
71
|
-
}
|
|
72
|
-
})()
|
|
73
|
-
}, [userSelection])
|
|
50
|
+
const { proteinSequence, error: featureSequenceError } = useFeatureSequence({
|
|
51
|
+
view,
|
|
52
|
+
feature: selectedTranscript,
|
|
53
|
+
})
|
|
74
54
|
|
|
75
55
|
const loadingMessage = isTreeLoading
|
|
76
56
|
? 'Loading tree data from Ensembl GeneTree'
|
|
77
57
|
: undefined
|
|
78
|
-
const e = treeError ??
|
|
58
|
+
const e = treeError ?? launchViewError ?? featureSequenceError
|
|
79
59
|
|
|
80
60
|
return (
|
|
81
61
|
<>
|
|
82
62
|
<DialogContent className={classes.dialogContent}>
|
|
83
63
|
{e ? <ErrorMessage error={e} /> : null}
|
|
84
64
|
{loadingMessage ? <LoadingEllipses message={loadingMessage} /> : null}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
+
/>
|
|
100
84
|
</DialogContent>
|
|
101
85
|
|
|
102
86
|
<DialogActions>
|
|
@@ -108,7 +92,7 @@ const EnsemblGeneTree = observer(function ({
|
|
|
108
92
|
if (!treeData) {
|
|
109
93
|
return
|
|
110
94
|
}
|
|
111
|
-
|
|
95
|
+
setLaunchViewError(undefined)
|
|
112
96
|
|
|
113
97
|
ensemblGeneTreeLaunchView({
|
|
114
98
|
feature,
|
|
@@ -120,7 +104,7 @@ const EnsemblGeneTree = observer(function ({
|
|
|
120
104
|
handleClose()
|
|
121
105
|
} catch (e) {
|
|
122
106
|
console.error(e)
|
|
123
|
-
|
|
107
|
+
setLaunchViewError(e)
|
|
124
108
|
}
|
|
125
109
|
}}
|
|
126
110
|
>
|
|
@@ -21,14 +21,8 @@ export function ensemblGeneTreeLaunchView({
|
|
|
21
21
|
session.addView('MsaView', {
|
|
22
22
|
type: 'MsaView',
|
|
23
23
|
displayName: newViewTitle,
|
|
24
|
-
treeAreaWidth: 200,
|
|
25
|
-
treeWidth: 100,
|
|
26
|
-
drawNodeBubbles: false,
|
|
27
|
-
labelsAlignRight: true,
|
|
28
|
-
showBranchLen: false,
|
|
29
24
|
colWidth: 10,
|
|
30
25
|
rowHeight: 12,
|
|
31
|
-
colorSchemeName: 'percent_identity_dynamic',
|
|
32
26
|
data,
|
|
33
27
|
connectedViewId: view.id,
|
|
34
28
|
connectedFeature: feature.toJSON(),
|
|
@@ -1,55 +1,7 @@
|
|
|
1
|
+
import { gatherSequencesFromTree } from './gatherSequencesFromTree'
|
|
2
|
+
import { TreeNode } from './types'
|
|
1
3
|
import { fetchWithLocalStorageCache, jsonfetch, textfetch } from './util'
|
|
2
4
|
|
|
3
|
-
interface TreeNodeSequence {
|
|
4
|
-
mol_seq: {
|
|
5
|
-
seq: string
|
|
6
|
-
location?: string
|
|
7
|
-
}
|
|
8
|
-
id: {
|
|
9
|
-
accession: string
|
|
10
|
-
}[]
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface TreeNodeTaxonomy {
|
|
14
|
-
common_name: string
|
|
15
|
-
scientific_name: string
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// This is a self-referential tree data structure
|
|
19
|
-
interface TreeNode {
|
|
20
|
-
children?: TreeNode[]
|
|
21
|
-
sequence?: TreeNodeSequence
|
|
22
|
-
taxonomy: TreeNodeTaxonomy
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface TreeRow {
|
|
26
|
-
id: string
|
|
27
|
-
seq: string
|
|
28
|
-
species: string
|
|
29
|
-
genomicLocString?: string
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function gatherSequencesFromTree(tree: TreeNode, arr: TreeRow[] = []) {
|
|
33
|
-
if (tree.children) {
|
|
34
|
-
for (const child of tree.children) {
|
|
35
|
-
if (child.sequence) {
|
|
36
|
-
const id = child.sequence.id[0]?.accession
|
|
37
|
-
if (id) {
|
|
38
|
-
arr.push({
|
|
39
|
-
id,
|
|
40
|
-
seq: child.sequence.mol_seq.seq,
|
|
41
|
-
species:
|
|
42
|
-
child.taxonomy.common_name || child.taxonomy.scientific_name,
|
|
43
|
-
genomicLocString: child.sequence.mol_seq.location,
|
|
44
|
-
})
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
gatherSequencesFromTree(child, arr)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return arr
|
|
51
|
-
}
|
|
52
|
-
|
|
53
5
|
const base = 'https://rest.ensembl.org'
|
|
54
6
|
|
|
55
7
|
export async function geneTreeFetcher(id2: string) {
|
|
@@ -60,22 +12,35 @@ export async function geneTreeFetcher(id2: string) {
|
|
|
60
12
|
),
|
|
61
13
|
)
|
|
62
14
|
const treeBase = `${base}/genetree/member/id/${species}/${id}`
|
|
63
|
-
const
|
|
64
|
-
jsonfetch<{ tree: TreeNode }>(
|
|
15
|
+
const geneTreeResult = await fetchWithLocalStorageCache(`${id}-msa`, () =>
|
|
16
|
+
jsonfetch<{ tree: TreeNode; id: string }>(
|
|
65
17
|
`${treeBase}?content-type=application/json;aligned=1;sequence=pep`,
|
|
66
18
|
),
|
|
67
19
|
)
|
|
68
20
|
|
|
21
|
+
// we query again to get newick format tree. could probably extract from json
|
|
22
|
+
// as alternative
|
|
69
23
|
const tree = await fetchWithLocalStorageCache<string>(`${id}-tree`, () =>
|
|
70
24
|
textfetch(`${treeBase}?nh_format=simple;content-type=text/x-nh`),
|
|
71
25
|
)
|
|
72
26
|
|
|
73
|
-
const res = gatherSequencesFromTree(
|
|
27
|
+
const res = gatherSequencesFromTree(geneTreeResult.tree)
|
|
74
28
|
return {
|
|
29
|
+
geneTreeId: geneTreeResult.id,
|
|
75
30
|
tree,
|
|
76
31
|
msa: res.map(r => `>${r.id}\n${r.seq}`).join('\n'),
|
|
77
32
|
treeMetadata: JSON.stringify(
|
|
78
|
-
Object.fromEntries(
|
|
33
|
+
Object.fromEntries(
|
|
34
|
+
res.map(
|
|
35
|
+
r =>
|
|
36
|
+
[
|
|
37
|
+
r.id,
|
|
38
|
+
{
|
|
39
|
+
genome: r.species,
|
|
40
|
+
},
|
|
41
|
+
] as const,
|
|
42
|
+
),
|
|
43
|
+
),
|
|
79
44
|
),
|
|
80
45
|
}
|
|
81
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
|
+
}
|
|
@@ -5,8 +5,8 @@ import { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
|
5
5
|
import { Tab, Tabs } from '@mui/material'
|
|
6
6
|
|
|
7
7
|
import EnsemblGeneTree from './EnsemblGeneTree/EnsemblGeneTree'
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import ManualMSALoader from './ManualMSALoader/ManualMSALoader'
|
|
9
|
+
import NCBIBlastPanel from './NCBIBlastQuery/NCBIBlastPanel'
|
|
10
10
|
import PreLoadedMSA from './PreLoadedMSA/PreLoadedMSADataPanel'
|
|
11
11
|
import TabPanel from './TabPanel'
|
|
12
12
|
|
|
@@ -39,10 +39,10 @@ export default function LaunchProteinViewDialog({
|
|
|
39
39
|
<Tab label="NCBI BLAST query" value={0} />
|
|
40
40
|
<Tab label="UCSC 100-way dataset" value={1} />
|
|
41
41
|
<Tab label="Ensembl GeneTree" value={2} />
|
|
42
|
-
<Tab label="Manually open MSA" value={3} />
|
|
42
|
+
<Tab label="Manually open MSA/tree" value={3} />
|
|
43
43
|
</Tabs>
|
|
44
44
|
<TabPanel value={value} index={0}>
|
|
45
|
-
<
|
|
45
|
+
<NCBIBlastPanel
|
|
46
46
|
handleClose={handleClose}
|
|
47
47
|
feature={feature}
|
|
48
48
|
model={model}
|
|
@@ -63,7 +63,11 @@ export default function LaunchProteinViewDialog({
|
|
|
63
63
|
/>
|
|
64
64
|
</TabPanel>
|
|
65
65
|
<TabPanel value={value} index={3}>
|
|
66
|
-
<
|
|
66
|
+
<ManualMSALoader
|
|
67
|
+
model={model}
|
|
68
|
+
feature={feature}
|
|
69
|
+
handleClose={handleClose}
|
|
70
|
+
/>
|
|
67
71
|
</TabPanel>
|
|
68
72
|
</Dialog>
|
|
69
73
|
)
|