@jbrowse/plugin-linear-genome-view 2.1.7 → 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/BaseLinearDisplay/components/LinearBlocks.d.ts +2 -2
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +2 -22
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +146 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +600 -464
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +19 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -1
- package/dist/BasicTrack/configSchema.d.ts +3 -0
- package/dist/BasicTrack/configSchema.js +18 -0
- package/dist/BasicTrack/configSchema.js.map +1 -0
- package/dist/BasicTrack/index.d.ts +3 -0
- package/dist/BasicTrack/index.js +18 -0
- package/dist/BasicTrack/index.js.map +1 -0
- package/dist/FeatureTrack/configSchema.d.ts +3 -0
- package/dist/FeatureTrack/configSchema.js +21 -0
- package/dist/FeatureTrack/configSchema.js.map +1 -0
- package/dist/FeatureTrack/index.d.ts +3 -0
- package/dist/FeatureTrack/index.js +18 -0
- package/dist/FeatureTrack/index.js.map +1 -0
- package/dist/LinearBareDisplay/configSchema.d.ts +5 -1
- package/dist/LinearBareDisplay/configSchema.js +12 -1
- package/dist/LinearBareDisplay/configSchema.js.map +1 -1
- package/dist/LinearBareDisplay/model.d.ts +16 -0
- package/dist/LinearBareDisplay/model.js +16 -0
- package/dist/LinearBareDisplay/model.js.map +1 -1
- package/dist/LinearBasicDisplay/configSchema.d.ts +5 -1
- package/dist/LinearBasicDisplay/configSchema.js +16 -1
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +77 -6
- package/dist/LinearBasicDisplay/model.js +167 -111
- package/dist/LinearBasicDisplay/model.js.map +1 -1
- package/dist/LinearGenomeView/components/ImportForm.js +34 -28
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.js +1 -21
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +7 -5
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +26 -34
- package/dist/LinearGenomeView/index.d.ts +189 -15
- package/dist/LinearGenomeView/index.js +266 -27
- package/dist/LinearGenomeView/index.js.map +1 -1
- package/dist/index.d.ts +12 -84
- package/dist/index.js +4 -25
- package/dist/index.js.map +1 -1
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +2 -2
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +2 -22
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +146 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +600 -464
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +19 -1
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -1
- package/esm/BasicTrack/configSchema.d.ts +3 -0
- package/esm/BasicTrack/configSchema.js +16 -0
- package/esm/BasicTrack/configSchema.js.map +1 -0
- package/esm/BasicTrack/index.d.ts +3 -0
- package/esm/BasicTrack/index.js +13 -0
- package/esm/BasicTrack/index.js.map +1 -0
- package/esm/FeatureTrack/configSchema.d.ts +3 -0
- package/esm/FeatureTrack/configSchema.js +19 -0
- package/esm/FeatureTrack/configSchema.js.map +1 -0
- package/esm/FeatureTrack/index.d.ts +3 -0
- package/esm/FeatureTrack/index.js +13 -0
- package/esm/FeatureTrack/index.js.map +1 -0
- package/esm/LinearBareDisplay/configSchema.d.ts +5 -1
- package/esm/LinearBareDisplay/configSchema.js +14 -2
- package/esm/LinearBareDisplay/configSchema.js.map +1 -1
- package/esm/LinearBareDisplay/model.d.ts +16 -0
- package/esm/LinearBareDisplay/model.js +16 -0
- package/esm/LinearBareDisplay/model.js.map +1 -1
- package/esm/LinearBasicDisplay/configSchema.d.ts +5 -1
- package/esm/LinearBasicDisplay/configSchema.js +18 -2
- package/esm/LinearBasicDisplay/configSchema.js.map +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +77 -6
- package/esm/LinearBasicDisplay/model.js +167 -111
- package/esm/LinearBasicDisplay/model.js.map +1 -1
- package/esm/LinearGenomeView/components/ImportForm.js +36 -30
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +2 -22
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +7 -5
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +26 -34
- package/esm/LinearGenomeView/index.d.ts +189 -15
- package/esm/LinearGenomeView/index.js +266 -27
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/esm/index.d.ts +12 -84
- package/esm/index.js +4 -25
- package/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +2 -24
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +695 -555
- package/src/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.ts +20 -1
- package/src/BasicTrack/configSchema.ts +23 -0
- package/src/BasicTrack/index.ts +22 -0
- package/src/FeatureTrack/configSchema.ts +27 -0
- package/src/FeatureTrack/index.ts +21 -0
- package/src/LinearBareDisplay/configSchema.ts +15 -2
- package/src/LinearBareDisplay/model.ts +16 -0
- package/src/LinearBasicDisplay/configSchema.ts +19 -2
- package/src/LinearBasicDisplay/model.ts +63 -11
- package/src/LinearGenomeView/components/ImportForm.tsx +79 -63
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +2 -26
- package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +21 -18
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +204 -204
- package/src/LinearGenomeView/index.test.ts +33 -26
- package/src/LinearGenomeView/index.tsx +317 -60
- package/src/index.ts +6 -46
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { waitFor } from '@testing-library/react'
|
|
1
2
|
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
2
3
|
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
|
|
3
4
|
import {
|
|
@@ -10,7 +11,7 @@ import { Instance, types } from 'mobx-state-tree'
|
|
|
10
11
|
import { LinearGenomeViewStateModel, stateModelFactory } from '.'
|
|
11
12
|
import { BaseLinearDisplayComponent } from '..'
|
|
12
13
|
import { stateModelFactory as LinearBasicDisplayStateModelFactory } from '../LinearBareDisplay'
|
|
13
|
-
import
|
|
14
|
+
import hg38Regions from './hg38DisplayedRegions.json'
|
|
14
15
|
import volvoxDisplayedRegions from './volvoxDisplayedRegions.json'
|
|
15
16
|
|
|
16
17
|
// use initializer function to avoid having console.warn jest.fn in a global
|
|
@@ -77,6 +78,9 @@ function initialize() {
|
|
|
77
78
|
get(str: string) {
|
|
78
79
|
return self.assemblies.get(str)
|
|
79
80
|
},
|
|
81
|
+
waitForAssembly(str: string) {
|
|
82
|
+
return self.assemblies.get(str)
|
|
83
|
+
},
|
|
80
84
|
}))
|
|
81
85
|
const LinearGenomeModel = stateModelFactory(stubManager)
|
|
82
86
|
const Session = types
|
|
@@ -599,7 +603,7 @@ test('can perform pxToBp on human genome things with ellided blocks (zoomed in)'
|
|
|
599
603
|
)
|
|
600
604
|
const width = 800
|
|
601
605
|
model.setWidth(width)
|
|
602
|
-
model.setDisplayedRegions(
|
|
606
|
+
model.setDisplayedRegions(hg38Regions)
|
|
603
607
|
model.setNewView(6359.273152497633, 503862)
|
|
604
608
|
expect(model.pxToBp(0).refName).toBe('Y')
|
|
605
609
|
expect(model.pxToBp(400).refName).toBe('Y')
|
|
@@ -624,7 +628,7 @@ test('can perform pxToBp on human genome things with ellided blocks (zoomed out)
|
|
|
624
628
|
)
|
|
625
629
|
const width = 800
|
|
626
630
|
model.setWidth(width)
|
|
627
|
-
model.setDisplayedRegions(
|
|
631
|
+
model.setDisplayedRegions(hg38Regions)
|
|
628
632
|
model.setNewView(3209286.105, -225.5083315372467)
|
|
629
633
|
// chr1 to the left
|
|
630
634
|
expect(model.pxToBp(0).refName).toBe('1')
|
|
@@ -887,12 +891,12 @@ describe('get sequence for selected displayed regions', () => {
|
|
|
887
891
|
})
|
|
888
892
|
})
|
|
889
893
|
|
|
890
|
-
test('navToLocString with human assembly', () => {
|
|
894
|
+
test('navToLocString with human assembly', async () => {
|
|
891
895
|
const { LinearGenomeModel } = initialize()
|
|
892
896
|
const HumanAssembly = types
|
|
893
897
|
.model({})
|
|
894
898
|
.volatile(() => ({
|
|
895
|
-
regions:
|
|
899
|
+
regions: hg38Regions,
|
|
896
900
|
}))
|
|
897
901
|
.views(() => ({
|
|
898
902
|
getCanonicalRefName(refName: string) {
|
|
@@ -910,6 +914,9 @@ test('navToLocString with human assembly', () => {
|
|
|
910
914
|
get(str: string) {
|
|
911
915
|
return self.assemblies.get(str)
|
|
912
916
|
},
|
|
917
|
+
waitForAssembly(str: string) {
|
|
918
|
+
return self.assemblies.get(str)
|
|
919
|
+
},
|
|
913
920
|
}))
|
|
914
921
|
|
|
915
922
|
const HumanSession = types.model({
|
|
@@ -926,7 +933,7 @@ test('navToLocString with human assembly', () => {
|
|
|
926
933
|
assemblies: {
|
|
927
934
|
hg38: {
|
|
928
935
|
// @ts-ignore
|
|
929
|
-
regions:
|
|
936
|
+
regions: hg38Regions,
|
|
930
937
|
},
|
|
931
938
|
},
|
|
932
939
|
},
|
|
@@ -934,25 +941,25 @@ test('navToLocString with human assembly', () => {
|
|
|
934
941
|
type: 'LinearGenomeView',
|
|
935
942
|
},
|
|
936
943
|
})
|
|
944
|
+
const { view } = model
|
|
937
945
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
)
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
)
|
|
948
|
-
model.view.navToLocString('chr3:1,000,000,000-1,100,000,000')
|
|
946
|
+
view.setWidth(800)
|
|
947
|
+
view.setDisplayedRegions(hg38Regions.slice(0, 1))
|
|
948
|
+
const w = view.width
|
|
949
|
+
|
|
950
|
+
view.navToLocString('2')
|
|
951
|
+
await waitFor(() => expect(view.bpPerPx).toBe(hg38Regions[1].end / w))
|
|
952
|
+
|
|
953
|
+
view.navToLocString('chr3')
|
|
954
|
+
await waitFor(() => expect(view.bpPerPx).toBe(hg38Regions[2].end / w))
|
|
949
955
|
|
|
950
|
-
|
|
951
|
-
expect(
|
|
952
|
-
|
|
956
|
+
view.navToLocString('chr3:1,000,000,000-1,100,000,000')
|
|
957
|
+
await waitFor(() => expect(view.bpPerPx).toBe(0.02))
|
|
958
|
+
await waitFor(() => expect(view.offsetPx).toBe(9914777550))
|
|
959
|
+
view.navToLocString('chr3:-1,100,000,000..-1,000,000,000')
|
|
953
960
|
})
|
|
954
961
|
|
|
955
|
-
test('multi region', () => {
|
|
962
|
+
test('multi region', async () => {
|
|
956
963
|
const { Session, LinearGenomeModel } = initialize()
|
|
957
964
|
const model = Session.create({
|
|
958
965
|
configuration: {},
|
|
@@ -966,11 +973,11 @@ test('multi region', () => {
|
|
|
966
973
|
model.setDisplayedRegions(volvoxDisplayedRegions.slice(0, 1))
|
|
967
974
|
|
|
968
975
|
model.navToLocString('ctgA ctgB')
|
|
969
|
-
expect(model.displayedRegions[0].refName).toBe('ctgA')
|
|
970
|
-
expect(model.displayedRegions[1].refName).toBe('ctgB')
|
|
976
|
+
await waitFor(() => expect(model.displayedRegions[0].refName).toBe('ctgA'))
|
|
977
|
+
await waitFor(() => expect(model.displayedRegions[1].refName).toBe('ctgB'))
|
|
971
978
|
})
|
|
972
979
|
|
|
973
|
-
test('space separated locstring', () => {
|
|
980
|
+
test('space separated locstring', async () => {
|
|
974
981
|
const { Session, LinearGenomeModel } = initialize()
|
|
975
982
|
const model = Session.create({
|
|
976
983
|
configuration: {},
|
|
@@ -985,6 +992,6 @@ test('space separated locstring', () => {
|
|
|
985
992
|
|
|
986
993
|
model.navToLocString('ctgA 0 100')
|
|
987
994
|
|
|
988
|
-
expect(model.offsetPx).toBe(0)
|
|
989
|
-
expect(model.bpPerPx).toBe(0.125)
|
|
995
|
+
await waitFor(() => expect(model.offsetPx).toBe(0))
|
|
996
|
+
await waitFor(() => expect(model.bpPerPx).toBe(0.125))
|
|
990
997
|
})
|