jbrowse-plugin-msaview 2.6.6 → 2.6.7
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/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.js +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js +2 -2
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +1 -1
- package/dist/LaunchMsaView/components/calculateProteinSequence.d.ts +1 -2
- package/dist/LaunchMsaView/components/calculateProteinSequence.js +4 -2
- package/dist/MsaViewPanel/msaDataStore.js +7 -2
- package/dist/MsaViewPanel/util.d.ts +0 -11
- package/dist/MsaViewPanel/util.js +0 -7
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +24 -24
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +3 -3
- package/dist/utils/blastCache.js +13 -5
- package/dist/utils/domainCache.js +7 -2
- package/dist/utils/fetch.d.ts +0 -2
- package/dist/utils/fetch.js +0 -21
- package/dist/utils/ncbiDomains.js +10 -3
- package/dist/utils/taxonomyNames.js +7 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -2
- package/src/BgzipFastaMsaAdapter/BgzipFastaMsaAdapter.ts +1 -1
- package/src/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.ts +2 -1
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +1 -1
- package/src/LaunchMsaView/components/calculateProteinSequence.ts +4 -3
- package/src/MsaViewPanel/msaDataStore.ts +8 -2
- package/src/MsaViewPanel/util.ts +0 -24
- package/src/utils/blastCache.ts +14 -3
- package/src/utils/domainCache.ts +8 -2
- package/src/utils/fetch.ts +0 -28
- package/src/utils/ncbiDomains.ts +10 -3
- package/src/utils/taxonomyNames.ts +8 -2
- package/src/version.ts +1 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.d.ts +0 -1
- package/dist/LaunchMsaView/components/ManualMSALoader/fetchGeneList.js +0 -11
- package/src/LaunchMsaView/components/ManualMSALoader/fetchGeneList.ts +0 -13
|
@@ -44,7 +44,7 @@ export default class BgzipFastaMsaAdapter extends BaseAdapter {
|
|
|
44
44
|
}
|
|
45
45
|
async getMSA(id) {
|
|
46
46
|
const adapter = await this.configure();
|
|
47
|
-
const refNames = await
|
|
47
|
+
const refNames = await this.getMSARefs();
|
|
48
48
|
const rows = refNames.filter(refName => this.refNameToMsaId(refName) === id);
|
|
49
49
|
return firstValueFrom(adapter
|
|
50
50
|
.getFeaturesInMultipleRegions(rows.map(refName => ({
|
|
@@ -2,7 +2,7 @@ import useSWR from 'swr';
|
|
|
2
2
|
import { clearAllCachedResults, deleteCachedResult, getAllCachedResults, } from '../../../utils/blastCache';
|
|
3
3
|
import { staticSwrConfig } from '../../../utils/swrConfig';
|
|
4
4
|
export function useCachedBlastResults(geneIds) {
|
|
5
|
-
const { data: results, error, mutate, } = useSWR(`cached-blast-${geneIds.join(',')}`, async () => {
|
|
5
|
+
const { data: results, error, isLoading, mutate, } = useSWR(`cached-blast-${geneIds.join(',')}`, async () => {
|
|
6
6
|
const cached = await getAllCachedResults();
|
|
7
7
|
return cached.filter(r => r.geneId && geneIds.includes(r.geneId));
|
|
8
8
|
}, staticSwrConfig);
|
|
@@ -17,7 +17,7 @@ export function useCachedBlastResults(geneIds) {
|
|
|
17
17
|
return {
|
|
18
18
|
results: results ?? [],
|
|
19
19
|
error,
|
|
20
|
-
isLoading
|
|
20
|
+
isLoading,
|
|
21
21
|
handleDelete,
|
|
22
22
|
handleClearAll,
|
|
23
23
|
};
|
|
@@ -38,7 +38,7 @@ const PreLoadedMSA = observer(function ({ model, feature, handleClose, }) {
|
|
|
38
38
|
});
|
|
39
39
|
const { selectedId, selectedTranscript } = transcriptSelection;
|
|
40
40
|
const { data: msaData, isLoading: msaDataLoading, error: msaDataFetchError, } = useSWR(selectedId && selectedDataset && msaList
|
|
41
|
-
? `${selectedDataset.datasetId}-${selectedId}
|
|
41
|
+
? `${selectedDataset.datasetId}-${selectedId}-msa`
|
|
42
42
|
: null, () => fetchMSA({
|
|
43
43
|
msaId: selectedId,
|
|
44
44
|
config: selectedDataset.adapter,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { Feat } from './types';
|
|
2
2
|
import type { Feature } from '@jbrowse/core/util';
|
|
3
3
|
export declare function stitch(subfeats: Feat[], sequence: string): string;
|
|
4
|
-
export declare function calculateProteinSequence({ cds, sequence,
|
|
4
|
+
export declare function calculateProteinSequence({ cds, sequence, }: {
|
|
5
5
|
cds: Feat[];
|
|
6
6
|
sequence: string;
|
|
7
|
-
codonTable: Record<string, string>;
|
|
8
7
|
}): string;
|
|
9
8
|
export declare function revlist(list: Feat[], seqlen: number): {
|
|
10
9
|
start: number;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { dedupe, defaultCodonTable, generateCodonTable, revcom, } from '@jbrowse/core/util';
|
|
2
|
+
// pure constant: the standard codon table never varies, so build it once rather
|
|
3
|
+
// than on every translation (which runs on every panel re-render)
|
|
4
|
+
const codonTable = generateCodonTable(defaultCodonTable);
|
|
2
5
|
export function stitch(subfeats, sequence) {
|
|
3
6
|
return subfeats.map(sub => sequence.slice(sub.start, sub.end)).join('');
|
|
4
7
|
}
|
|
5
|
-
export function calculateProteinSequence({ cds, sequence,
|
|
8
|
+
export function calculateProteinSequence({ cds, sequence, }) {
|
|
6
9
|
const str = stitch(cds, sequence);
|
|
7
10
|
let protein = '';
|
|
8
11
|
for (let i = 0; i < str.length; i += 3) {
|
|
@@ -33,6 +36,5 @@ export function getProteinSequenceFromFeature({ feature, seq, }) {
|
|
|
33
36
|
return calculateProteinSequence({
|
|
34
37
|
cds: strand === -1 ? revlist(cds, seq.length) : cds,
|
|
35
38
|
sequence: strand === -1 ? revcom(seq) : seq,
|
|
36
|
-
codonTable: generateCodonTable(defaultCodonTable),
|
|
37
39
|
});
|
|
38
40
|
}
|
|
@@ -2,15 +2,20 @@ import { openDB } from 'idb';
|
|
|
2
2
|
const DB_NAME = 'jbrowse-msaview-data';
|
|
3
3
|
const DB_VERSION = 1;
|
|
4
4
|
const STORE_NAME = 'msa-data';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
let dbPromise;
|
|
6
|
+
function getDB() {
|
|
7
|
+
dbPromise ??= openDB(DB_NAME, DB_VERSION, {
|
|
7
8
|
upgrade(db) {
|
|
8
9
|
if (!db.objectStoreNames.contains(STORE_NAME)) {
|
|
9
10
|
const store = db.createObjectStore(STORE_NAME, { keyPath: 'id' });
|
|
10
11
|
store.createIndex('timestamp', 'timestamp', { unique: false });
|
|
11
12
|
}
|
|
12
13
|
},
|
|
14
|
+
}).catch((e) => {
|
|
15
|
+
dbPromise = undefined;
|
|
16
|
+
throw e;
|
|
13
17
|
});
|
|
18
|
+
return dbPromise;
|
|
14
19
|
}
|
|
15
20
|
export function generateDataStoreId() {
|
|
16
21
|
return `msa-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
@@ -4,16 +4,6 @@ export declare function hasHoverPosition(hovered: unknown): hovered is {
|
|
|
4
4
|
refName: string;
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
|
-
interface AssemblyManagerLike {
|
|
8
|
-
get: (name: string) => {
|
|
9
|
-
getCanonicalRefName: (r: string) => string | undefined;
|
|
10
|
-
} | undefined;
|
|
11
|
-
}
|
|
12
|
-
export declare function getCanonicalRefName({ assemblyManager, assemblyNames, refName, }: {
|
|
13
|
-
assemblyManager: AssemblyManagerLike;
|
|
14
|
-
assemblyNames: string[] | undefined;
|
|
15
|
-
refName: string;
|
|
16
|
-
}): string;
|
|
17
7
|
/**
|
|
18
8
|
* Extracts UniProt ID from an AlphaFold URL
|
|
19
9
|
* Examples:
|
|
@@ -21,4 +11,3 @@ export declare function getCanonicalRefName({ assemblyManager, assemblyNames, re
|
|
|
21
11
|
* - https://alphafold.ebi.ac.uk/files/msa/AF-P12345-F1-msa_v6.a3m -> P12345
|
|
22
12
|
*/
|
|
23
13
|
export declare function getUniprotIdFromAlphaFoldUrl(url: string): string | undefined;
|
|
24
|
-
export {};
|
|
@@ -4,13 +4,6 @@ export function hasHoverPosition(hovered) {
|
|
|
4
4
|
'hoverPosition' in hovered &&
|
|
5
5
|
!!hovered.hoverPosition);
|
|
6
6
|
}
|
|
7
|
-
export function getCanonicalRefName({ assemblyManager, assemblyNames, refName, }) {
|
|
8
|
-
const assemblyName = assemblyNames?.[0];
|
|
9
|
-
if (assemblyName) {
|
|
10
|
-
return (assemblyManager.get(assemblyName)?.getCanonicalRefName(refName) ?? refName);
|
|
11
|
-
}
|
|
12
|
-
return refName;
|
|
13
|
-
}
|
|
14
7
|
/**
|
|
15
8
|
* Extracts UniProt ID from an AlphaFold URL
|
|
16
9
|
* Examples:
|