jbrowse-plugin-msaview 2.3.8 → 2.4.1
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 +4 -15
- package/dist/AddHighlightModel/GenomeMouseoverHighlight.js.map +1 -1
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js +11 -13
- package/dist/AddHighlightModel/MsaToGenomeHighlight.js.map +1 -1
- package/dist/AddHighlightModel/util.d.ts +6 -0
- package/dist/AddHighlightModel/util.js +6 -0
- package/dist/AddHighlightModel/util.js.map +1 -1
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.d.ts +2 -0
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +8 -4
- package/dist/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js.map +1 -1
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js +3 -8
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +7 -10
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +2 -5
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js +0 -3
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.d.ts +4 -4
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js +2 -2
- package/dist/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.d.ts +4 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js +2 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/consts.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +10 -21
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/types.d.ts +1 -0
- package/dist/LaunchMsaView/components/PreLoadedMSA/types.js +4 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/types.js.map +1 -1
- package/dist/LaunchMsaView/components/types.d.ts +0 -3
- package/dist/LaunchMsaView/components/useFeatureSequence.d.ts +4 -4
- package/dist/LaunchMsaView/components/useFeatureSequence.js +2 -4
- package/dist/LaunchMsaView/components/useFeatureSequence.js.map +1 -1
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.d.ts +4 -5
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js +11 -30
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js.map +1 -1
- package/dist/MsaViewPanel/afterCreateAutoruns.js +13 -17
- package/dist/MsaViewPanel/afterCreateAutoruns.js.map +1 -1
- package/dist/MsaViewPanel/components/ConnectStructureDialog.js +2 -2
- package/dist/MsaViewPanel/components/ConnectStructureDialog.js.map +1 -1
- package/dist/MsaViewPanel/components/LoadingBLAST.js +2 -3
- package/dist/MsaViewPanel/components/LoadingBLAST.js.map +1 -1
- package/dist/MsaViewPanel/model.d.ts +9 -11
- package/dist/MsaViewPanel/model.js +22 -23
- package/dist/MsaViewPanel/model.js.map +1 -1
- package/dist/MsaViewPanel/msaDataStore.d.ts +0 -1
- package/dist/MsaViewPanel/msaDataStore.js +0 -9
- package/dist/MsaViewPanel/msaDataStore.js.map +1 -1
- package/dist/MsaViewPanel/structureConnection.d.ts +6 -4
- package/dist/MsaViewPanel/structureConnection.js +6 -6
- package/dist/MsaViewPanel/structureConnection.js.map +1 -1
- package/dist/MsaViewPanel/structureConnection.test.js +1 -19
- package/dist/MsaViewPanel/structureConnection.test.js.map +1 -1
- package/dist/MsaViewPanel/util.d.ts +11 -0
- package/dist/MsaViewPanel/util.js +11 -3
- package/dist/MsaViewPanel/util.js.map +1 -1
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +25 -27
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
- package/dist/utils/blastCache.d.ts +7 -13
- package/dist/utils/blastCache.js +0 -12
- package/dist/utils/blastCache.js.map +1 -1
- package/dist/utils/msa.d.ts +2 -1
- package/dist/utils/msa.js +0 -3
- package/dist/utils/msa.js.map +1 -1
- package/dist/utils/ncbiBlast.d.ts +3 -2
- package/dist/utils/ncbiBlast.js +7 -7
- package/dist/utils/ncbiBlast.js.map +1 -1
- package/dist/utils/taxonomyNames.js +9 -7
- package/dist/utils/taxonomyNames.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +22 -20
- package/src/AddHighlightModel/GenomeMouseoverHighlight.tsx +8 -25
- package/src/AddHighlightModel/MsaToGenomeHighlight.tsx +16 -16
- package/src/AddHighlightModel/util.ts +11 -0
- package/src/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.ts +10 -4
- package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +3 -16
- package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +8 -12
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +6 -15
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.tsx +0 -9
- package/src/LaunchMsaView/components/NCBIBlastQuery/blastLaunchView.ts +6 -6
- package/src/LaunchMsaView/components/NCBIBlastQuery/consts.ts +7 -0
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +12 -27
- package/src/LaunchMsaView/components/PreLoadedMSA/types.ts +6 -0
- package/src/LaunchMsaView/components/types.ts +0 -3
- package/src/LaunchMsaView/components/useFeatureSequence.ts +1 -7
- package/src/LaunchMsaView/components/useSWRFeatureSequence.ts +10 -37
- package/src/MsaViewPanel/afterCreateAutoruns.ts +15 -17
- package/src/MsaViewPanel/components/ConnectStructureDialog.tsx +2 -2
- package/src/MsaViewPanel/components/LoadingBLAST.tsx +4 -3
- package/src/MsaViewPanel/model.ts +33 -33
- package/src/MsaViewPanel/msaDataStore.ts +0 -9
- package/src/MsaViewPanel/structureConnection.test.ts +0 -21
- package/src/MsaViewPanel/structureConnection.ts +7 -7
- package/src/MsaViewPanel/util.ts +27 -2
- package/src/utils/blastCache.ts +14 -37
- package/src/utils/msa.ts +5 -6
- package/src/utils/ncbiBlast.ts +18 -11
- package/src/utils/taxonomyNames.ts +13 -6
- package/src/version.ts +1 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.d.ts +0 -8
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js +0 -70
- package/dist/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.js.map +0 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.d.ts +0 -13
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.js +0 -12
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.js.map +0 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.d.ts +0 -6
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js +0 -25
- package/dist/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.js.map +0 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.d.ts +0 -2
- package/dist/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.js +0 -20
- package/dist/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.js.map +0 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/types.d.ts +0 -24
- package/dist/LaunchMsaView/components/EnsemblGeneTree/types.js +0 -2
- package/dist/LaunchMsaView/components/EnsemblGeneTree/types.js.map +0 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.d.ts +0 -10
- package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.js +0 -11
- package/dist/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.js.map +0 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/util.d.ts +0 -1
- package/dist/LaunchMsaView/components/EnsemblGeneTree/util.js +0 -2
- package/dist/LaunchMsaView/components/EnsemblGeneTree/util.js.map +0 -1
- package/src/LaunchMsaView/components/EnsemblGeneTree/EnsemblGeneTree.tsx +0 -123
- package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeLaunchView.ts +0 -30
- package/src/LaunchMsaView/components/EnsemblGeneTree/ensemblGeneTreeUtils.ts +0 -47
- package/src/LaunchMsaView/components/EnsemblGeneTree/gatherSequencesFromTree.ts +0 -22
- package/src/LaunchMsaView/components/EnsemblGeneTree/types.ts +0 -28
- package/src/LaunchMsaView/components/EnsemblGeneTree/useGeneTree.ts +0 -17
- package/src/LaunchMsaView/components/EnsemblGeneTree/util.ts +0 -6
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { BlastDatabase, BlastProgram, MsaAlgorithm } from '../LaunchMsaView/components/NCBIBlastQuery/consts';
|
|
1
2
|
export interface CachedBlastResult {
|
|
2
3
|
id: string;
|
|
3
4
|
proteinSequence: string;
|
|
4
|
-
blastDatabase:
|
|
5
|
-
blastProgram:
|
|
6
|
-
msaAlgorithm:
|
|
5
|
+
blastDatabase: BlastDatabase;
|
|
6
|
+
blastProgram: BlastProgram;
|
|
7
|
+
msaAlgorithm: MsaAlgorithm;
|
|
7
8
|
msa: string;
|
|
8
9
|
tree: string;
|
|
9
10
|
treeMetadata: string;
|
|
@@ -14,17 +15,11 @@ export interface CachedBlastResult {
|
|
|
14
15
|
transcriptName?: string;
|
|
15
16
|
geneName?: string;
|
|
16
17
|
}
|
|
17
|
-
export declare function getCachedBlastResult({ proteinSequence, blastDatabase, blastProgram, transcriptId, }: {
|
|
18
|
-
proteinSequence: string;
|
|
19
|
-
blastDatabase: string;
|
|
20
|
-
blastProgram: string;
|
|
21
|
-
transcriptId?: string;
|
|
22
|
-
}): Promise<any>;
|
|
23
18
|
export declare function saveBlastResult({ proteinSequence, blastDatabase, blastProgram, msaAlgorithm, msa, tree, treeMetadata, rid, geneId, transcriptId, transcriptName, geneName, }: {
|
|
24
19
|
proteinSequence: string;
|
|
25
|
-
blastDatabase:
|
|
26
|
-
blastProgram:
|
|
27
|
-
msaAlgorithm:
|
|
20
|
+
blastDatabase: BlastDatabase;
|
|
21
|
+
blastProgram: BlastProgram;
|
|
22
|
+
msaAlgorithm: MsaAlgorithm;
|
|
28
23
|
msa: string;
|
|
29
24
|
tree: string;
|
|
30
25
|
treeMetadata: string;
|
|
@@ -35,6 +30,5 @@ export declare function saveBlastResult({ proteinSequence, blastDatabase, blastP
|
|
|
35
30
|
geneName?: string;
|
|
36
31
|
}): Promise<CachedBlastResult>;
|
|
37
32
|
export declare function getAllCachedResults(): Promise<any[]>;
|
|
38
|
-
export declare function getCachedResultsByGeneId(geneId: string): Promise<any[]>;
|
|
39
33
|
export declare function deleteCachedResult(id: string): Promise<void>;
|
|
40
34
|
export declare function clearAllCachedResults(): Promise<void>;
|
package/dist/utils/blastCache.js
CHANGED
|
@@ -20,11 +20,6 @@ function createCacheKey(proteinSequence, blastDatabase, blastProgram, transcript
|
|
|
20
20
|
}
|
|
21
21
|
return `${blastDatabase}:${blastProgram}:${proteinSequence}`;
|
|
22
22
|
}
|
|
23
|
-
export async function getCachedBlastResult({ proteinSequence, blastDatabase, blastProgram, transcriptId, }) {
|
|
24
|
-
const db = await getDB();
|
|
25
|
-
const id = createCacheKey(proteinSequence, blastDatabase, blastProgram, transcriptId);
|
|
26
|
-
return db.get(STORE_NAME, id);
|
|
27
|
-
}
|
|
28
23
|
export async function saveBlastResult({ proteinSequence, blastDatabase, blastProgram, msaAlgorithm, msa, tree, treeMetadata, rid, geneId, transcriptId, transcriptName, geneName, }) {
|
|
29
24
|
const db = await getDB();
|
|
30
25
|
const id = createCacheKey(proteinSequence, blastDatabase, blastProgram, transcriptId);
|
|
@@ -52,13 +47,6 @@ export async function getAllCachedResults() {
|
|
|
52
47
|
const results = await db.getAll(STORE_NAME);
|
|
53
48
|
return results.toSorted((a, b) => b.timestamp - a.timestamp);
|
|
54
49
|
}
|
|
55
|
-
export async function getCachedResultsByGeneId(geneId) {
|
|
56
|
-
const db = await getDB();
|
|
57
|
-
const results = await db.getAll(STORE_NAME);
|
|
58
|
-
return results
|
|
59
|
-
.filter(r => r.geneId === geneId)
|
|
60
|
-
.toSorted((a, b) => b.timestamp - a.timestamp);
|
|
61
|
-
}
|
|
62
50
|
export async function deleteCachedResult(id) {
|
|
63
51
|
const db = await getDB();
|
|
64
52
|
await db.delete(STORE_NAME, id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blastCache.js","sourceRoot":"","sources":["../../src/utils/blastCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"blastCache.js","sourceRoot":"","sources":["../../src/utils/blastCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAQ5B,MAAM,OAAO,GAAG,6BAA6B,CAAA;AAC7C,MAAM,UAAU,GAAG,eAAe,CAAA;AAClC,MAAM,UAAU,GAAG,CAAC,CAAA;AAmBpB,KAAK,UAAU,KAAK;IAClB,OAAO,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE;QACjC,OAAO,CAAC,EAAE,EAAE,UAAU;YACpB,IAAI,UAAU,GAAG,CAAC,IAAI,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC/D,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAA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B,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IAC3C,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAA;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EAAU;IACjD,MAAM,EAAE,GAAG,MAAM,KAAK,EAAE,CAAA;IACxB,MAAM,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;AACjC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,MAAM,EAAE,GAAG,MAAM,KAAK,EAAE,CAAA;IACxB,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;AAC5B,CAAC"}
|
package/dist/utils/msa.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { MsaAlgorithm } from '../LaunchMsaView/components/NCBIBlastQuery/consts';
|
|
1
2
|
export declare function launchMSA({ algorithm, sequence, onProgress, }: {
|
|
2
|
-
algorithm:
|
|
3
|
+
algorithm: MsaAlgorithm;
|
|
3
4
|
sequence: string;
|
|
4
5
|
onProgress: (arg: string) => void;
|
|
5
6
|
}): Promise<{
|
package/dist/utils/msa.js
CHANGED
|
@@ -40,9 +40,6 @@ async function wait({ onProgress, jobId, algorithm, }) {
|
|
|
40
40
|
}
|
|
41
41
|
export async function launchMSA({ algorithm, sequence, onProgress, }) {
|
|
42
42
|
const config = algorithms[algorithm];
|
|
43
|
-
if (!config) {
|
|
44
|
-
throw new Error(`unknown algorithm: ${algorithm}`);
|
|
45
|
-
}
|
|
46
43
|
onProgress(`Launching ${algorithm} MSA...`);
|
|
47
44
|
const jobId = await textfetch(`${base}/${algorithm}/run`, {
|
|
48
45
|
method: 'POST',
|
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;
|
|
1
|
+
{"version":3,"file":"msa.js","sourceRoot":"","sources":["../../src/utils/msa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAI5C,MAAM,IAAI,GAAG,2CAA2C,CAAA;AAExD,MAAM,UAAU,GAOZ;IACF,QAAQ,EAAE;QACR,MAAM,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE;QAC1C,SAAS,EAAE,iBAAiB;QAC5B,UAAU,EAAE,WAAW;KACxB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE;QACxE,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,WAAW;KACxB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,SAAS,EAAE;QAC5D,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,WAAW;KACxB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,SAAS,EAAE;QAC5D,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,WAAW;KACxB;CACF,CAAA;AAED,KAAK,UAAU,IAAI,CAAC,EAClB,UAAU,EACV,KAAK,EACL,SAAS,GAKV;IACC,uEAAuE;IACvE,OAAO,IAAI,EAAE,CAAC;QACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5B,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;YACnB,UAAU,CAAC,gCAAgC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;QACtD,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,IAAI,IAAI,SAAS,WAAW,KAAK,EAAE,CAAC,CAAA;QAEtE,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;YAC1B,MAAK;QACP,CAAC;aAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,EAAE,CAAC,CAAA;QAClD,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,EAC9B,SAAS,EACT,QAAQ,EACR,UAAU,GAKX;IACC,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;IAEpC,UAAU,CAAC,aAAa,SAAS,SAAS,CAAC,CAAA;IAE3C,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,GAAG,IAAI,IAAI,SAAS,MAAM,EAAE;QACxD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,eAAe,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;KAC1D,CAAC,CAAA;IACF,MAAM,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAA;IAC5C,OAAO;QACL,GAAG,EAAE,MAAM,SAAS,CAClB,GAAG,IAAI,IAAI,SAAS,WAAW,KAAK,IAAI,MAAM,CAAC,SAAS,EAAE,CAC3D;QACD,IAAI,EAAE,MAAM,SAAS,CACnB,GAAG,IAAI,IAAI,SAAS,WAAW,KAAK,IAAI,MAAM,CAAC,UAAU,EAAE,CAC5D;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BlastDatabase, BlastProgram } from '../LaunchMsaView/components/NCBIBlastQuery/consts';
|
|
1
2
|
export declare function queryBlastFromRid({ rid, baseUrl, onProgress, }: {
|
|
2
3
|
rid: string;
|
|
3
4
|
baseUrl: string;
|
|
@@ -13,8 +14,8 @@ export declare function queryBlastFromRid({ rid, baseUrl, onProgress, }: {
|
|
|
13
14
|
}>;
|
|
14
15
|
export declare function queryBlast({ query, blastDatabase, blastProgram, baseUrl, onProgress, onRid, }: {
|
|
15
16
|
query: string;
|
|
16
|
-
blastDatabase:
|
|
17
|
-
blastProgram:
|
|
17
|
+
blastDatabase: BlastDatabase;
|
|
18
|
+
blastProgram: BlastProgram;
|
|
18
19
|
baseUrl: string;
|
|
19
20
|
onProgress: (arg: string) => void;
|
|
20
21
|
onRid: (arg: string) => void;
|
package/dist/utils/ncbiBlast.js
CHANGED
|
@@ -31,7 +31,7 @@ async function initialQuery({ query, blastProgram, blastDatabase, baseUrl, }) {
|
|
|
31
31
|
PROGRAM: blastProgram === 'quick-blastp' ? 'blastp' : blastProgram,
|
|
32
32
|
DATABASE: blastDatabase,
|
|
33
33
|
QUERY: query,
|
|
34
|
-
...(blastDatabase === '
|
|
34
|
+
...(blastDatabase === 'nr_cluster_seq'
|
|
35
35
|
? {
|
|
36
36
|
CLUSTERED_DB: 'on',
|
|
37
37
|
DB_TYPE: 'Experimental Databases',
|
|
@@ -64,17 +64,16 @@ async function waitForRid({ rid, onProgress, baseUrl, }) {
|
|
|
64
64
|
onProgress(`Re-checking BLAST status in... ${iter - i}`);
|
|
65
65
|
}
|
|
66
66
|
const res = await textfetch(`${baseUrl}?CMD=Get&FORMAT_OBJECT=SearchInfo&RID=${rid}`);
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const isReady = /\s+Status=READY/m.test(res);
|
|
67
|
+
const statusMatch = /\s+Status=(\S+)/m.exec(res);
|
|
68
|
+
const status = statusMatch?.[1];
|
|
70
69
|
const hasHits = /\s+ThereAreHits=yes/m.test(res);
|
|
71
|
-
if (
|
|
70
|
+
if (status === 'WAITING') {
|
|
72
71
|
continue;
|
|
73
72
|
}
|
|
74
|
-
if (
|
|
73
|
+
if (status === 'FAILED') {
|
|
75
74
|
throw new Error(`BLAST ${rid} failed`);
|
|
76
75
|
}
|
|
77
|
-
if (
|
|
76
|
+
if (status === 'READY') {
|
|
78
77
|
if (hasHits) {
|
|
79
78
|
return true;
|
|
80
79
|
}
|
|
@@ -82,6 +81,7 @@ async function waitForRid({ rid, onProgress, baseUrl, }) {
|
|
|
82
81
|
throw new Error('No hits found');
|
|
83
82
|
}
|
|
84
83
|
}
|
|
84
|
+
throw new Error(`BLAST ${rid} returned unexpected status: ${status ?? 'unknown'}`);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
//# sourceMappingURL=ncbiBlast.js.map
|
|
@@ -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;AAQvD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EACtC,GAAG,EACH,OAAO,EACP,UAAU,GAKX;IACC,UAAU,CAAC,kCAAkC,GAAG,KAAK,CAAC,CAAA;IACtD,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,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,EAC/B,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CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -12,9 +12,12 @@ async function getDB() {
|
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
async function
|
|
15
|
+
async function getCachedTaxonomies(taxids) {
|
|
16
16
|
const db = await getDB();
|
|
17
|
-
|
|
17
|
+
const tx = db.transaction(STORE_NAME, 'readonly');
|
|
18
|
+
const results = await Promise.all(taxids.map(taxid => tx.store.get(taxid)));
|
|
19
|
+
await tx.done;
|
|
20
|
+
return results;
|
|
18
21
|
}
|
|
19
22
|
async function saveTaxonomyCache(entries) {
|
|
20
23
|
const db = await getDB();
|
|
@@ -27,8 +30,10 @@ async function saveTaxonomyCache(entries) {
|
|
|
27
30
|
export async function fetchTaxonomyInfo(taxids) {
|
|
28
31
|
const result = new Map();
|
|
29
32
|
const uncachedTaxids = [];
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
const cachedResults = await getCachedTaxonomies(taxids);
|
|
34
|
+
for (let i = 0; i < taxids.length; i++) {
|
|
35
|
+
const taxid = taxids[i];
|
|
36
|
+
const cached = cachedResults[i];
|
|
32
37
|
if (cached) {
|
|
33
38
|
result.set(taxid, {
|
|
34
39
|
sciname: cached.sciname,
|
|
@@ -96,9 +101,6 @@ export async function fetchTaxonomyInfo(taxids) {
|
|
|
96
101
|
result.set(taxid, { sciname: sci, commonName: name });
|
|
97
102
|
toCache.push({ taxid, sciname: sci, commonName: name });
|
|
98
103
|
}
|
|
99
|
-
else {
|
|
100
|
-
toCache.push({ taxid, sciname: '', commonName: undefined });
|
|
101
|
-
}
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
106
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taxonomyNames.js","sourceRoot":"","sources":["../../src/utils/taxonomyNames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AAE5B,MAAM,OAAO,GAAG,gCAAgC,CAAA;AA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MAAM,OAAO,GAAG,yCAAyC,CAAC,IAAI,CAC5D,QAAQ,CACT,CAAA;oBACD,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,CAAA;oBAElD,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;oBAC9B,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;oBACrD,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;gBACzD,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAA;QACxD,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAA;IAClC,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.
|
|
1
|
+
export declare const version = "2.4.1";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '2.
|
|
1
|
+
export const version = '2.4.1';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.4.1",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "jbrowse-plugin-msaview",
|
|
5
5
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@emotion/styled": "^11.14.1",
|
|
20
|
-
"g2p_mapper": "^2.0.
|
|
20
|
+
"g2p_mapper": "^2.0.2",
|
|
21
21
|
"idb": "^8.0.3",
|
|
22
22
|
"pako-esm2": "^2.0.2",
|
|
23
23
|
"react-msaview": "^5.0.16",
|
|
@@ -27,37 +27,37 @@
|
|
|
27
27
|
"@emotion/react": "^11.14.0",
|
|
28
28
|
"@eslint/js": "^10.0.1",
|
|
29
29
|
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
|
|
30
|
-
"@jbrowse/core": "^4.2.
|
|
30
|
+
"@jbrowse/core": "^4.2.1",
|
|
31
31
|
"@jbrowse/mobx-state-tree": "^5.6.0",
|
|
32
|
-
"@jbrowse/plugin-linear-genome-view": "^4.2.
|
|
33
|
-
"@mui/icons-material": "^7.3.
|
|
34
|
-
"@mui/material": "^7.3.
|
|
35
|
-
"@mui/system": "^7.3.
|
|
36
|
-
"@mui/x-data-grid": "^8.28.
|
|
37
|
-
"@types/node": "^25.
|
|
32
|
+
"@jbrowse/plugin-linear-genome-view": "^4.2.1",
|
|
33
|
+
"@mui/icons-material": "^7.3.11",
|
|
34
|
+
"@mui/material": "^7.3.11",
|
|
35
|
+
"@mui/system": "^7.3.11",
|
|
36
|
+
"@mui/x-data-grid": "^8.28.5",
|
|
37
|
+
"@types/node": "^25.7.0",
|
|
38
38
|
"@types/react": "^19.2.14",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.59.
|
|
40
|
-
"@typescript-eslint/parser": "^8.59.
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.59.3",
|
|
40
|
+
"@typescript-eslint/parser": "^8.59.3",
|
|
41
41
|
"esbuild": "^0.28.0",
|
|
42
|
-
"eslint": "^10.
|
|
42
|
+
"eslint": "^10.3.0",
|
|
43
43
|
"eslint-plugin-import-x": "^4.16.2",
|
|
44
44
|
"eslint-plugin-react": "^7.37.5",
|
|
45
45
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
46
46
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
47
|
-
"mobx": "^6.15.
|
|
47
|
+
"mobx": "^6.15.3",
|
|
48
48
|
"mobx-react": "^9.2.1",
|
|
49
49
|
"prettier": "^3.8.3",
|
|
50
50
|
"pretty-bytes": "^7.1.0",
|
|
51
|
-
"puppeteer": "^24.
|
|
52
|
-
"react": "^19.2.
|
|
53
|
-
"react-dom": "^19.2.
|
|
51
|
+
"puppeteer": "^24.43.1",
|
|
52
|
+
"react": "^19.2.6",
|
|
53
|
+
"react-dom": "^19.2.6",
|
|
54
54
|
"rimraf": "^6.1.3",
|
|
55
55
|
"rxjs": "^7.8.2",
|
|
56
56
|
"serve": "^14.2.6",
|
|
57
|
-
"tss-react": "^4.9.
|
|
57
|
+
"tss-react": "^4.9.21",
|
|
58
58
|
"typescript": "^6.0.3",
|
|
59
|
-
"typescript-eslint": "^8.59.
|
|
60
|
-
"vitest": "^4.1.
|
|
59
|
+
"typescript-eslint": "^8.59.3",
|
|
60
|
+
"vitest": "^4.1.6"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"clean": "rimraf dist",
|
|
@@ -73,6 +73,8 @@
|
|
|
73
73
|
"test:setup:version": "node scripts/test-versions.mjs setup",
|
|
74
74
|
"test:versions": "node scripts/test-versions.mjs run",
|
|
75
75
|
"test:version": "node scripts/test-versions.mjs run",
|
|
76
|
-
"
|
|
76
|
+
"preversion": "pnpm lint",
|
|
77
|
+
"version": "node -e \"console.log('export const version = \\'' + require('./package.json').version + '\\'')\" > src/version.ts && git add src/version.ts",
|
|
78
|
+
"postversion": "git push --follow-tags"
|
|
77
79
|
}
|
|
78
80
|
}
|
|
@@ -3,7 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import { getSession } from '@jbrowse/core/util'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
|
|
6
|
-
import { useStyles } from './util'
|
|
6
|
+
import { hasHoverPosition, useStyles } from './util'
|
|
7
7
|
|
|
8
8
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
9
9
|
|
|
@@ -12,25 +12,11 @@ const GenomeMouseoverHighlight = observer(function ({
|
|
|
12
12
|
}: {
|
|
13
13
|
model: LinearGenomeViewModel
|
|
14
14
|
}) {
|
|
15
|
-
const
|
|
16
|
-
const { hovered, views } = session
|
|
17
|
-
|
|
18
|
-
// Early return if no MSA view exists
|
|
15
|
+
const { hovered, views } = getSession(model)
|
|
19
16
|
const hasMsaView = views.some(s => s.type === 'MsaView')
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// Early return if no hover position
|
|
25
|
-
if (
|
|
26
|
-
!hovered ||
|
|
27
|
-
typeof hovered !== 'object' ||
|
|
28
|
-
!('hoverPosition' in hovered)
|
|
29
|
-
) {
|
|
30
|
-
return null
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return <GenomeMouseoverHighlightRenderer model={model} hovered={hovered} />
|
|
17
|
+
return hasMsaView && hasHoverPosition(hovered) ? (
|
|
18
|
+
<GenomeMouseoverHighlightRenderer model={model} hovered={hovered} />
|
|
19
|
+
) : null
|
|
34
20
|
})
|
|
35
21
|
|
|
36
22
|
const GenomeMouseoverHighlightRenderer = observer(function ({
|
|
@@ -38,17 +24,14 @@ const GenomeMouseoverHighlightRenderer = observer(function ({
|
|
|
38
24
|
hovered,
|
|
39
25
|
}: {
|
|
40
26
|
model: LinearGenomeViewModel
|
|
41
|
-
hovered:
|
|
27
|
+
hovered: { hoverPosition: { coord: number; refName: string } }
|
|
42
28
|
}) {
|
|
43
29
|
const { classes } = useStyles()
|
|
44
30
|
const { offsetPx } = model
|
|
45
|
-
const { coord, refName } = hovered.hoverPosition
|
|
46
|
-
coord: number
|
|
47
|
-
refName: string
|
|
48
|
-
}
|
|
31
|
+
const { coord, refName } = hovered.hoverPosition
|
|
49
32
|
|
|
50
33
|
const s = model.bpToPx({ refName, coord: coord - 1 })
|
|
51
|
-
const e = model.bpToPx({ refName, coord
|
|
34
|
+
const e = model.bpToPx({ refName, coord })
|
|
52
35
|
|
|
53
36
|
if (s && e) {
|
|
54
37
|
const width = Math.max(Math.abs(e.offsetPx - s.offsetPx), 4)
|
|
@@ -3,32 +3,33 @@ import React from 'react'
|
|
|
3
3
|
import { getSession } from '@jbrowse/core/util'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
|
|
6
|
-
import { useStyles } from './util'
|
|
6
|
+
import { hasHoverPosition, useStyles } from './util'
|
|
7
|
+
import { getCanonicalRefName } from '../MsaViewPanel/util'
|
|
7
8
|
|
|
8
9
|
import type { JBrowsePluginMsaViewModel } from '../MsaViewPanel/model'
|
|
9
10
|
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
10
11
|
|
|
11
12
|
type LGV = LinearGenomeViewModel
|
|
12
13
|
|
|
13
|
-
// Outer component: only re-renders when MSA view or highlights change
|
|
14
14
|
const MsaToGenomeHighlight = observer(function MsaToGenomeHighlight2({
|
|
15
15
|
model,
|
|
16
16
|
}: {
|
|
17
17
|
model: LGV
|
|
18
18
|
}) {
|
|
19
|
-
const { views } = getSession(model)
|
|
19
|
+
const { views, hovered } = getSession(model)
|
|
20
20
|
const msaView = views.find(f => f.type === 'MsaView') as
|
|
21
21
|
| JBrowsePluginMsaViewModel
|
|
22
22
|
| undefined
|
|
23
|
-
|
|
24
23
|
const highlights = msaView?.connectedHighlights
|
|
25
24
|
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
// Suppress codon highlight while hovering the LGV — GenomeMouseoverHighlight
|
|
26
|
+
// handles the single-bp display in that case
|
|
27
|
+
return !hasHoverPosition(hovered) && highlights?.length ? (
|
|
28
|
+
<MsaToGenomeHighlightRenderer
|
|
29
|
+
model={model}
|
|
30
|
+
highlights={Array.from(highlights)}
|
|
31
|
+
/>
|
|
32
|
+
) : null
|
|
32
33
|
})
|
|
33
34
|
|
|
34
35
|
// Inner component: handles the scroll-dependent rendering
|
|
@@ -41,17 +42,16 @@ const MsaToGenomeHighlightRenderer = observer(function ({
|
|
|
41
42
|
}) {
|
|
42
43
|
const { classes } = useStyles()
|
|
43
44
|
const { assemblyManager } = getSession(model)
|
|
44
|
-
const assembly = assemblyManager.get(model.assemblyNames[0]!)
|
|
45
45
|
const { offsetPx } = model
|
|
46
46
|
|
|
47
|
-
if (!assembly) {
|
|
48
|
-
return null
|
|
49
|
-
}
|
|
50
|
-
|
|
51
47
|
return (
|
|
52
48
|
<>
|
|
53
49
|
{highlights.map((r, idx) => {
|
|
54
|
-
const refName =
|
|
50
|
+
const refName = getCanonicalRefName({
|
|
51
|
+
assemblyManager,
|
|
52
|
+
assemblyNames: model.assemblyNames,
|
|
53
|
+
refName: r.refName,
|
|
54
|
+
})
|
|
55
55
|
const s = model.bpToPx({ refName, coord: r.start })
|
|
56
56
|
const e = model.bpToPx({ refName, coord: r.end })
|
|
57
57
|
if (s && e) {
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { makeStyles } from 'tss-react/mui'
|
|
2
2
|
|
|
3
|
+
export function hasHoverPosition(
|
|
4
|
+
hovered: unknown,
|
|
5
|
+
): hovered is { hoverPosition: { coord: number; refName: string } } {
|
|
6
|
+
return (
|
|
7
|
+
!!hovered &&
|
|
8
|
+
typeof hovered === 'object' &&
|
|
9
|
+
'hoverPosition' in hovered &&
|
|
10
|
+
!!hovered.hoverPosition
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
export const useStyles = makeStyles()({
|
|
4
15
|
highlight: {
|
|
5
16
|
height: '100%',
|
|
@@ -40,18 +40,24 @@ export default class BgzipFastaMsaAdapter extends BaseAdapter {
|
|
|
40
40
|
return this.refNamesP
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
getMsaRegex() {
|
|
44
|
+
return new RegExp(this.getConf('msaRegex'))
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
refNameToMsaId(refName: string) {
|
|
48
|
+
return refName.split(this.getMsaRegex())[0]!
|
|
49
|
+
}
|
|
50
|
+
|
|
43
51
|
async getMSAList() {
|
|
44
52
|
const refNames = await this.getMSARefs()
|
|
45
|
-
const
|
|
46
|
-
const re = new RegExp(val)
|
|
47
|
-
const list = new Set(refNames.map(name => name.split(re)[0]!))
|
|
53
|
+
const list = new Set(refNames.map(name => this.refNameToMsaId(name)))
|
|
48
54
|
return [...list]
|
|
49
55
|
}
|
|
50
56
|
|
|
51
57
|
async getMSA(id: string) {
|
|
52
58
|
const adapter = await this.configure()
|
|
53
59
|
const refNames = await adapter.getRefNames()
|
|
54
|
-
const rows = refNames.filter(refName =>
|
|
60
|
+
const rows = refNames.filter(refName => this.refNameToMsaId(refName) === id)
|
|
55
61
|
return firstValueFrom(
|
|
56
62
|
adapter
|
|
57
63
|
.getFeaturesInMultipleRegions(
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import { readConfObject } from '@jbrowse/core/configuration'
|
|
4
3
|
import { Dialog } from '@jbrowse/core/ui'
|
|
5
4
|
import { getSession } from '@jbrowse/core/util'
|
|
6
5
|
import { Tab, Tabs } from '@mui/material'
|
|
7
6
|
|
|
8
|
-
import EnsemblGeneTree from './EnsemblGeneTree/EnsemblGeneTree'
|
|
9
7
|
import ManualMSALoader from './ManualMSALoader/ManualMSALoader'
|
|
10
8
|
import NCBIBlastPanel from './NCBIBlastQuery/NCBIBlastPanel'
|
|
11
9
|
import PreLoadedMSA from './PreLoadedMSA/PreLoadedMSADataPanel'
|
|
10
|
+
import { readMsaDatasets } from './PreLoadedMSA/types'
|
|
12
11
|
import TabPanel from './TabPanel'
|
|
13
12
|
|
|
14
|
-
import type { Dataset } from './PreLoadedMSA/types'
|
|
15
13
|
import type { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
16
14
|
|
|
17
15
|
export default function LaunchMsaViewDialog({
|
|
@@ -24,11 +22,8 @@ export default function LaunchMsaViewDialog({
|
|
|
24
22
|
model: AbstractTrackModel
|
|
25
23
|
}) {
|
|
26
24
|
const session = getSession(model)
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
| Dataset[]
|
|
30
|
-
| undefined
|
|
31
|
-
const hasPreloadedDatasets = datasets && datasets.length > 0
|
|
25
|
+
const datasets = readMsaDatasets(session.jbrowse)
|
|
26
|
+
const hasPreloadedDatasets = !!datasets?.length
|
|
32
27
|
|
|
33
28
|
const [value, setValue] = useState('ncbi_blast')
|
|
34
29
|
|
|
@@ -43,7 +38,6 @@ export default function LaunchMsaViewDialog({
|
|
|
43
38
|
{hasPreloadedDatasets ? (
|
|
44
39
|
<Tab label="Pre-loaded MSA datasets" value="preloaded_msa" />
|
|
45
40
|
) : null}
|
|
46
|
-
<Tab label="Ensembl GeneTree" value="ensembl_genetree" />
|
|
47
41
|
<Tab label="Manual upload" value="manual_msa" />
|
|
48
42
|
</Tabs>
|
|
49
43
|
<TabPanel value={value} index="ncbi_blast">
|
|
@@ -62,13 +56,6 @@ export default function LaunchMsaViewDialog({
|
|
|
62
56
|
/>
|
|
63
57
|
</TabPanel>
|
|
64
58
|
) : null}
|
|
65
|
-
<TabPanel value={value} index="ensembl_genetree">
|
|
66
|
-
<EnsemblGeneTree
|
|
67
|
-
model={model}
|
|
68
|
-
feature={feature}
|
|
69
|
-
handleClose={handleClose}
|
|
70
|
-
/>
|
|
71
|
-
</TabPanel>
|
|
72
59
|
<TabPanel value={value} index="manual_msa">
|
|
73
60
|
<ManualMSALoader
|
|
74
61
|
model={model}
|
|
@@ -77,10 +77,10 @@ const ManualMSALoader = observer(function PreLoadedMSA2({
|
|
|
77
77
|
setSelectedId,
|
|
78
78
|
selectedTranscript,
|
|
79
79
|
proteinSequence,
|
|
80
|
-
error
|
|
80
|
+
error,
|
|
81
81
|
} = useTranscriptSelection({ feature, view })
|
|
82
82
|
|
|
83
|
-
const e = launchViewError ??
|
|
83
|
+
const e = launchViewError ?? error
|
|
84
84
|
return (
|
|
85
85
|
<>
|
|
86
86
|
<DialogContent className={classes.dialogContent}>
|
|
@@ -198,17 +198,13 @@ const ManualMSALoader = observer(function PreLoadedMSA2({
|
|
|
198
198
|
}
|
|
199
199
|
onClick={() => {
|
|
200
200
|
try {
|
|
201
|
-
if (!selectedTranscript) {
|
|
202
|
-
return
|
|
203
|
-
}
|
|
204
|
-
|
|
205
201
|
setLaunchViewError(undefined)
|
|
206
202
|
launchView({
|
|
207
203
|
session,
|
|
208
204
|
newViewTitle: getGeneDisplayName(selectedTranscript),
|
|
209
205
|
view,
|
|
210
|
-
feature: selectedTranscript
|
|
211
|
-
querySeqName: querySeqName.trim()
|
|
206
|
+
feature: selectedTranscript!,
|
|
207
|
+
querySeqName: querySeqName.trim(),
|
|
212
208
|
...(inputMethod === 'file'
|
|
213
209
|
? {
|
|
214
210
|
msaFilehandle: msaFileLocation,
|
|
@@ -217,15 +213,15 @@ const ManualMSALoader = observer(function PreLoadedMSA2({
|
|
|
217
213
|
: {
|
|
218
214
|
data: {
|
|
219
215
|
msa: msaText,
|
|
220
|
-
tree: treeText
|
|
216
|
+
tree: treeText,
|
|
221
217
|
},
|
|
222
218
|
}),
|
|
223
219
|
})
|
|
224
220
|
|
|
225
221
|
handleClose()
|
|
226
|
-
} catch (
|
|
227
|
-
console.error(
|
|
228
|
-
setLaunchViewError(
|
|
222
|
+
} catch (err) {
|
|
223
|
+
console.error(err)
|
|
224
|
+
setLaunchViewError(err)
|
|
229
225
|
}
|
|
230
226
|
}}
|
|
231
227
|
>
|