jbrowse-plugin-msaview 2.4.2 → 2.4.4
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/LaunchMsaView/components/LaunchMsaViewDialog.js +3 -4
- package/dist/LaunchMsaView/components/LaunchMsaViewDialog.js.map +1 -1
- package/dist/LaunchMsaView/components/LaunchPanelContent.d.ts +5 -0
- package/dist/LaunchMsaView/components/LaunchPanelContent.js +16 -0
- package/dist/LaunchMsaView/components/LaunchPanelContent.js.map +1 -0
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js +22 -25
- package/dist/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js +12 -24
- package/dist/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.d.ts +7 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.js +10 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.js.map +1 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js +23 -32
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js +9 -15
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.d.ts +3 -2
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.d.ts +25 -0
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js +22 -32
- package/dist/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js +2 -9
- package/dist/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js +30 -29
- package/dist/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.js.map +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js +8 -6
- package/dist/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.js.map +1 -1
- package/dist/LaunchMsaView/components/SubmitCancelActions.d.ts +8 -0
- package/dist/LaunchMsaView/components/SubmitCancelActions.js +12 -0
- package/dist/LaunchMsaView/components/SubmitCancelActions.js.map +1 -0
- package/dist/LaunchMsaView/components/TranscriptSelector.d.ts +2 -2
- package/dist/LaunchMsaView/components/TranscriptSelector.js +2 -2
- package/dist/LaunchMsaView/components/TranscriptSelector.js.map +1 -1
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js +3 -13
- package/dist/LaunchMsaView/components/useSWRFeatureSequence.js.map +1 -1
- package/dist/LaunchMsaView/components/useTranscriptSelection.js +10 -12
- package/dist/LaunchMsaView/components/useTranscriptSelection.js.map +1 -1
- package/dist/LaunchMsaView/util.d.ts +4 -1
- package/dist/LaunchMsaView/util.js +29 -24
- package/dist/LaunchMsaView/util.js.map +1 -1
- package/dist/MsaViewPanel/model.d.ts +1 -0
- package/dist/jbrowse-plugin-msaview.umd.production.min.js +26 -25
- package/dist/jbrowse-plugin-msaview.umd.production.min.js.map +4 -4
- package/dist/{LaunchMsaView/components/PreLoadedMSA/consts.d.ts → utils/swrConfig.d.ts} +1 -1
- package/dist/{LaunchMsaView/components/PreLoadedMSA/consts.js → utils/swrConfig.js} +2 -2
- package/dist/utils/swrConfig.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +10 -10
- package/src/LaunchMsaView/components/LaunchMsaViewDialog.tsx +9 -6
- package/src/LaunchMsaView/components/LaunchPanelContent.tsx +27 -0
- package/src/LaunchMsaView/components/ManualMSALoader/ManualMSALoader.tsx +28 -60
- package/src/LaunchMsaView/components/NCBIBlastQuery/CachedBlastResults.tsx +21 -33
- package/src/LaunchMsaView/components/NCBIBlastQuery/MsaAlgorithmSelect.tsx +37 -0
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastAutomaticPanel.tsx +29 -75
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastManualPanel.tsx +10 -31
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastMethodSelector.tsx +5 -3
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastPanel.tsx +5 -2
- package/src/LaunchMsaView/components/NCBIBlastQuery/NCBIBlastRIDPanel.tsx +28 -78
- package/src/LaunchMsaView/components/NCBIBlastQuery/useCachedBlastResults.ts +2 -10
- package/src/LaunchMsaView/components/PreLoadedMSA/PreLoadedMSADataPanel.tsx +34 -57
- package/src/LaunchMsaView/components/PreLoadedMSA/fetchMSAData.ts +17 -8
- package/src/LaunchMsaView/components/SubmitCancelActions.tsx +41 -0
- package/src/LaunchMsaView/components/TranscriptSelector.tsx +3 -3
- package/src/LaunchMsaView/components/useSWRFeatureSequence.ts +6 -15
- package/src/LaunchMsaView/components/useTranscriptSelection.ts +13 -15
- package/src/LaunchMsaView/util.ts +35 -25
- package/src/MsaViewPanel/util.ts +3 -3
- package/src/{LaunchMsaView/components/PreLoadedMSA/consts.ts → utils/swrConfig.ts} +1 -1
- package/src/version.ts +1 -1
- package/dist/LaunchMsaView/components/PreLoadedMSA/consts.js.map +0 -1
|
@@ -5,26 +5,24 @@ import { useFeatureSequence } from './useFeatureSequence'
|
|
|
5
5
|
|
|
6
6
|
import type { Feature } from '@jbrowse/core/util'
|
|
7
7
|
|
|
8
|
-
function featureInValidIds(feature: Feature, validIds: string[]): boolean {
|
|
9
|
-
return validIds.some(id => featureMatchesId(feature, id))
|
|
10
|
-
}
|
|
11
|
-
|
|
12
8
|
function findValidSelection(
|
|
13
9
|
currentId: string,
|
|
14
10
|
options: Feature[],
|
|
15
11
|
validIds: string[] | undefined,
|
|
16
12
|
): string | undefined {
|
|
17
|
-
if (
|
|
18
|
-
|
|
13
|
+
if (validIds && validIds.length > 0) {
|
|
14
|
+
const currentFeature = options.find(opt => getId(opt) === currentId)
|
|
15
|
+
const currentIsValid =
|
|
16
|
+
currentFeature &&
|
|
17
|
+
validIds.some(id => featureMatchesId(currentFeature, id))
|
|
18
|
+
if (currentFeature && !currentIsValid) {
|
|
19
|
+
const validOption = options.find(opt =>
|
|
20
|
+
validIds.some(id => featureMatchesId(opt, id)),
|
|
21
|
+
)
|
|
22
|
+
return validOption ? getId(validOption) : undefined
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
|
-
|
|
21
|
-
const currentFeature = options.find(opt => getId(opt) === currentId)
|
|
22
|
-
if (!currentFeature || featureInValidIds(currentFeature, validIds)) {
|
|
23
|
-
return undefined
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const validOption = options.find(opt => featureInValidIds(opt, validIds))
|
|
27
|
-
return validOption ? getId(validOption) : undefined
|
|
25
|
+
return undefined
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
export function useTranscriptSelection({
|
|
@@ -39,7 +37,7 @@ export function useTranscriptSelection({
|
|
|
39
37
|
const options = useMemo(() => getSortedTranscriptFeatures(feature), [feature])
|
|
40
38
|
const [selectedId, setSelectedId] = useState(() => getId(options[0]))
|
|
41
39
|
const validatedSelectedId =
|
|
42
|
-
findValidSelection(selectedId, options, validIds)
|
|
40
|
+
findValidSelection(selectedId, options, validIds) ?? selectedId
|
|
43
41
|
const selectedTranscript = options.find(
|
|
44
42
|
val => getId(val) === validatedSelectedId,
|
|
45
43
|
)
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import { sum } from '@jbrowse/core/util'
|
|
1
|
+
import { getContainingView, sum } from '@jbrowse/core/util'
|
|
2
2
|
|
|
3
|
-
import type { Feature } from '@jbrowse/core/util'
|
|
3
|
+
import type { AbstractTrackModel, Feature } from '@jbrowse/core/util'
|
|
4
|
+
import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view'
|
|
5
|
+
|
|
6
|
+
export function getLinearGenomeView(model: AbstractTrackModel) {
|
|
7
|
+
return getContainingView(model) as LinearGenomeViewModel
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function uniqueDefined(vals: (string | undefined)[]): string[] {
|
|
11
|
+
return [...new Set(vals.filter((v): v is string => !!v))]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function joinDefined(sep: string, parts: (string | undefined)[]): string {
|
|
15
|
+
return parts.filter((p): p is string => !!p).join(sep)
|
|
16
|
+
}
|
|
4
17
|
|
|
5
18
|
export function getTranscriptFeatures(feature: Feature) {
|
|
6
19
|
// check if we are looking at a 'two-level' or 'three-level' feature by
|
|
@@ -42,16 +55,14 @@ export function getId(val?: Feature): string {
|
|
|
42
55
|
}
|
|
43
56
|
|
|
44
57
|
export function getMatchableIds(val?: Feature): string[] {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
].filter((id): id is string => !!id)
|
|
54
|
-
return [...new Set(ids)]
|
|
58
|
+
return val
|
|
59
|
+
? uniqueDefined([
|
|
60
|
+
val.id(),
|
|
61
|
+
val.get('name'),
|
|
62
|
+
val.get('id'),
|
|
63
|
+
val.get('transcript_id'),
|
|
64
|
+
])
|
|
65
|
+
: []
|
|
55
66
|
}
|
|
56
67
|
|
|
57
68
|
export function featureMatchesId(feature: Feature, id: string): boolean {
|
|
@@ -59,20 +70,20 @@ export function featureMatchesId(feature: Feature, id: string): boolean {
|
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
export function getTranscriptDisplayName(val?: Feature) {
|
|
62
|
-
return val
|
|
63
|
-
? ''
|
|
64
|
-
: [val.get('name'), val.get('id')].filter(f => !!f).join(' ')
|
|
73
|
+
return val ? joinDefined(' ', [val.get('name'), val.get('id')]) : ''
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
export function getGeneDisplayName(val?: Feature) {
|
|
68
|
-
return val
|
|
69
|
-
? ''
|
|
70
|
-
: [
|
|
77
|
+
return val
|
|
78
|
+
? joinDefined(' ', [
|
|
71
79
|
val.get('gene_name') ?? val.get('name'),
|
|
72
|
-
val.get('id') ? `(${val.get('id')})` :
|
|
73
|
-
]
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
val.get('id') ? `(${val.get('id')})` : undefined,
|
|
81
|
+
])
|
|
82
|
+
: ''
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function getBlastViewTitle(feature: Feature, transcript: Feature) {
|
|
86
|
+
return `BLAST - ${getGeneDisplayName(feature)} - ${getTranscriptDisplayName(transcript)}`
|
|
76
87
|
}
|
|
77
88
|
|
|
78
89
|
export function getSortedTranscriptFeatures(feature: Feature) {
|
|
@@ -87,12 +98,11 @@ export function cleanProteinSequence(seq: string) {
|
|
|
87
98
|
}
|
|
88
99
|
|
|
89
100
|
export function getGeneIdentifiers(feature: Feature): string[] {
|
|
90
|
-
|
|
101
|
+
return uniqueDefined([
|
|
91
102
|
feature.id(),
|
|
92
103
|
feature.get('id'),
|
|
93
104
|
feature.get('name'),
|
|
94
105
|
feature.get('gene_id'),
|
|
95
106
|
feature.get('gene_name'),
|
|
96
|
-
]
|
|
97
|
-
return [...new Set(ids)]
|
|
107
|
+
])
|
|
98
108
|
}
|
package/src/MsaViewPanel/util.ts
CHANGED
|
@@ -14,9 +14,9 @@ export function checkHovered(hovered: unknown): hovered is {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface AssemblyManagerLike {
|
|
17
|
-
get: (
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
get: (
|
|
18
|
+
name: string,
|
|
19
|
+
) => { getCanonicalRefName: (r: string) => string | undefined } | undefined
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export function getCanonicalRefName({
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.4.
|
|
1
|
+
export const version = '2.4.4'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../../../src/LaunchMsaView/components/PreLoadedMSA/consts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,iBAAiB,EAAE,KAAK;IACxB,qBAAqB,EAAE,KAAK;IAC5B,iBAAiB,EAAE,KAAK;IACxB,iBAAiB,EAAE,KAAK;IACxB,kBAAkB,EAAE,KAAK;IACzB,kBAAkB,EAAE,KAAK;CAC1B,CAAA"}
|