@jbrowse/plugin-bed 2.6.1 → 2.6.3
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/BedAdapter/BedAdapter.js +0 -1
- package/dist/BedAdapter/configSchema.js +0 -1
- package/dist/BedAdapter/index.js +0 -1
- package/dist/BedTabixAdapter/BedTabixAdapter.js +0 -1
- package/dist/BedTabixAdapter/configSchema.js +0 -1
- package/dist/BedTabixAdapter/index.js +0 -1
- package/dist/BedpeAdapter/BedpeAdapter.js +0 -1
- package/dist/BedpeAdapter/configSchema.js +0 -1
- package/dist/BedpeAdapter/index.js +0 -1
- package/dist/BigBedAdapter/BigBedAdapter.js +0 -1
- package/dist/BigBedAdapter/configSchema.js +0 -1
- package/dist/BigBedAdapter/index.js +0 -1
- package/dist/index.js +0 -1
- package/dist/util.js +0 -1
- package/esm/BedAdapter/BedAdapter.js +0 -1
- package/esm/BedAdapter/configSchema.js +0 -1
- package/esm/BedAdapter/index.js +0 -1
- package/esm/BedTabixAdapter/BedTabixAdapter.js +0 -1
- package/esm/BedTabixAdapter/configSchema.js +0 -1
- package/esm/BedTabixAdapter/index.js +0 -1
- package/esm/BedpeAdapter/BedpeAdapter.js +0 -1
- package/esm/BedpeAdapter/configSchema.js +0 -1
- package/esm/BedpeAdapter/index.js +0 -1
- package/esm/BigBedAdapter/BigBedAdapter.js +0 -1
- package/esm/BigBedAdapter/configSchema.js +0 -1
- package/esm/BigBedAdapter/index.js +0 -1
- package/esm/index.js +0 -1
- package/esm/util.js +0 -1
- package/package.json +3 -4
- package/dist/BedAdapter/BedAdapter.js.map +0 -1
- package/dist/BedAdapter/configSchema.js.map +0 -1
- package/dist/BedAdapter/index.js.map +0 -1
- package/dist/BedTabixAdapter/BedTabixAdapter.js.map +0 -1
- package/dist/BedTabixAdapter/configSchema.js.map +0 -1
- package/dist/BedTabixAdapter/index.js.map +0 -1
- package/dist/BedpeAdapter/BedpeAdapter.js.map +0 -1
- package/dist/BedpeAdapter/configSchema.js.map +0 -1
- package/dist/BedpeAdapter/index.js.map +0 -1
- package/dist/BigBedAdapter/BigBedAdapter.js.map +0 -1
- package/dist/BigBedAdapter/configSchema.js.map +0 -1
- package/dist/BigBedAdapter/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/util.js.map +0 -1
- package/esm/BedAdapter/BedAdapter.js.map +0 -1
- package/esm/BedAdapter/configSchema.js.map +0 -1
- package/esm/BedAdapter/index.js.map +0 -1
- package/esm/BedTabixAdapter/BedTabixAdapter.js.map +0 -1
- package/esm/BedTabixAdapter/configSchema.js.map +0 -1
- package/esm/BedTabixAdapter/index.js.map +0 -1
- package/esm/BedpeAdapter/BedpeAdapter.js.map +0 -1
- package/esm/BedpeAdapter/configSchema.js.map +0 -1
- package/esm/BedpeAdapter/index.js.map +0 -1
- package/esm/BigBedAdapter/BigBedAdapter.js.map +0 -1
- package/esm/BigBedAdapter/configSchema.js.map +0 -1
- package/esm/BigBedAdapter/index.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/util.js.map +0 -1
- package/src/BedAdapter/BedAdapter.test.ts +0 -166
- package/src/BedAdapter/BedAdapter.ts +0 -171
- package/src/BedAdapter/__snapshots__/BedAdapter.test.ts.snap +0 -437
- package/src/BedAdapter/configSchema.ts +0 -69
- package/src/BedAdapter/index.ts +0 -16
- package/src/BedAdapter/test_data/gwas.bed +0 -20
- package/src/BedAdapter/test_data/volvox-autosql.bed +0 -1
- package/src/BedAdapter/test_data/volvox-bed12.bed +0 -4
- package/src/BedAdapter/test_data/volvox.sort.bed +0 -109
- package/src/BedAdapter/test_data/volvox.sort.with.header.bed +0 -121
- package/src/BedTabixAdapter/BedTabixAdapter.test.ts +0 -196
- package/src/BedTabixAdapter/BedTabixAdapter.ts +0 -105
- package/src/BedTabixAdapter/__snapshots__/BedTabixAdapter.test.ts.snap +0 -437
- package/src/BedTabixAdapter/configSchema.ts +0 -71
- package/src/BedTabixAdapter/index.ts +0 -16
- package/src/BedTabixAdapter/test_data/gwas.bed.gz +0 -0
- package/src/BedTabixAdapter/test_data/gwas.bed.gz.tbi +0 -0
- package/src/BedTabixAdapter/test_data/volvox-autosql.bed.gz +0 -0
- package/src/BedTabixAdapter/test_data/volvox-autosql.bed.gz.tbi +0 -0
- package/src/BedTabixAdapter/test_data/volvox-bed12.bed.gz +0 -0
- package/src/BedTabixAdapter/test_data/volvox-bed12.bed.gz.tbi +0 -0
- package/src/BedTabixAdapter/test_data/volvox.sort.bed.gz +0 -0
- package/src/BedTabixAdapter/test_data/volvox.sort.bed.gz.tbi +0 -0
- package/src/BedTabixAdapter/test_data/volvox.sort.with.header.bed.gz +0 -0
- package/src/BedTabixAdapter/test_data/volvox.sort.with.header.bed.gz.tbi +0 -0
- package/src/BedpeAdapter/BedpeAdapter.ts +0 -208
- package/src/BedpeAdapter/configSchema.ts +0 -34
- package/src/BedpeAdapter/index.ts +0 -16
- package/src/BigBedAdapter/BigBedAdapter.test.ts +0 -28
- package/src/BigBedAdapter/BigBedAdapter.ts +0 -127
- package/src/BigBedAdapter/__snapshots__/BigBedAdapter.test.ts.snap +0 -254
- package/src/BigBedAdapter/configSchema.ts +0 -22
- package/src/BigBedAdapter/index.ts +0 -16
- package/src/BigBedAdapter/test_data/volvox.bb +0 -0
- package/src/__snapshots__/index.test.ts.snap +0 -3
- package/src/index.test.ts +0 -16
- package/src/index.ts +0 -133
- package/src/util.ts +0 -180
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ctgA 1 10 T>G 1 . 1815756 1815757 0,0,0 1 1 0 1 0.0108695652174 GNB1 2782 Splice_Region SNP T T G novel -- -- -- -- -- -- -- -- female TCGA-ACC not hispanic or latino TCGA-OR-A5KB-01A-11D-A30A-10 TCGA-OR-A5KB-11A-11D-A30A-10 09454ed6-64bc-4a35-af44-7c4344623d45
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
ctgA 1049 9000 EDEN.1 1000 + 1200 7608 0,0,0 4 451,903,501,2001 0,1950,3950,5950 EDEN EDEN - - -
|
|
2
|
-
ctgA 1049 9000 EDEN.2 1000 + 1200 7608 0,0,0 3 451,501,2001 0,3950,5950 EDEN EDEN - - -
|
|
3
|
-
ctgA 1299 9000 EDEN.3 1000 + 3300 7600 0,0,0 4 201,903,501,2001 0,1700,3700,5700 EDEN EDEN - - -
|
|
4
|
-
ctgA 17399 23000 rna-Apple3 1000 + 17999 21200 0,0,0 3 1401,501,2001 0,1600,3600 rna-Apple3 rna-Apple3 - - -
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
contigA 3000 3009
|
|
2
|
-
contigA 3105 3114
|
|
3
|
-
contigA 3152 3161
|
|
4
|
-
contigA 3171 3180
|
|
5
|
-
contigA 3174 3183
|
|
6
|
-
contigA 3213 3222
|
|
7
|
-
contigA 3465 3474
|
|
8
|
-
contigA 3795 3804
|
|
9
|
-
contigA 4035 4044
|
|
10
|
-
contigA 4073 4082
|
|
11
|
-
contigA 4074 4083
|
|
12
|
-
contigA 4166 4175
|
|
13
|
-
contigA 4179 4188
|
|
14
|
-
contigA 4204 4213
|
|
15
|
-
contigA 4248 4257
|
|
16
|
-
contigA 4260 4269
|
|
17
|
-
contigA 4577 4586
|
|
18
|
-
contigA 4828 4837
|
|
19
|
-
contigA 4901 4910
|
|
20
|
-
contigA 5006 5015
|
|
21
|
-
contigA 5051 5060
|
|
22
|
-
contigA 5201 5210
|
|
23
|
-
contigA 5260 5269
|
|
24
|
-
contigA 5281 5290
|
|
25
|
-
contigA 5349 5358
|
|
26
|
-
contigA 5353 5362
|
|
27
|
-
contigA 5423 5432
|
|
28
|
-
contigA 5457 5466
|
|
29
|
-
contigA 5548 5557
|
|
30
|
-
contigA 5626 5635
|
|
31
|
-
contigA 5835 5844
|
|
32
|
-
contigA 5909 5918
|
|
33
|
-
contigA 5927 5936
|
|
34
|
-
contigA 5969 5978
|
|
35
|
-
contigA 6070 6079
|
|
36
|
-
contigA 6185 6194
|
|
37
|
-
contigA 6285 6294
|
|
38
|
-
contigA 6363 6372
|
|
39
|
-
contigA 6559 6568
|
|
40
|
-
contigA 6834 6843
|
|
41
|
-
contigA 6908 6917
|
|
42
|
-
contigA 6918 6927
|
|
43
|
-
contigA 7141 7150
|
|
44
|
-
contigA 7173 7182
|
|
45
|
-
contigA 7569 7578
|
|
46
|
-
contigA 7619 7628
|
|
47
|
-
contigA 7654 7663
|
|
48
|
-
contigA 7671 7680
|
|
49
|
-
contigA 7707 7716
|
|
50
|
-
contigA 7739 7748
|
|
51
|
-
contigA 8077 8086
|
|
52
|
-
contigA 8128 8137
|
|
53
|
-
contigA 8132 8141
|
|
54
|
-
contigA 8210 8219
|
|
55
|
-
contigA 8267 8276
|
|
56
|
-
contigA 8328 8337
|
|
57
|
-
contigA 8524 8533
|
|
58
|
-
contigA 8659 8668
|
|
59
|
-
contigA 8660 8669
|
|
60
|
-
contigA 8742 8751
|
|
61
|
-
contigA 8811 8820
|
|
62
|
-
contigA 8816 8825
|
|
63
|
-
contigA 8964 8973
|
|
64
|
-
contigA 9048 9057
|
|
65
|
-
contigA 9054 9063
|
|
66
|
-
contigA 9136 9145
|
|
67
|
-
contigA 9243 9252
|
|
68
|
-
contigA 9320 9329
|
|
69
|
-
contigA 9366 9375
|
|
70
|
-
contigA 9525 9534
|
|
71
|
-
contigA 9580 9589
|
|
72
|
-
contigA 9610 9619
|
|
73
|
-
contigA 9744 9753
|
|
74
|
-
contigA 9753 9762
|
|
75
|
-
contigA 9759 9768
|
|
76
|
-
contigA 9807 9816
|
|
77
|
-
contigA 9853 9862
|
|
78
|
-
contigA 9884 9893
|
|
79
|
-
contigA 9920 9929
|
|
80
|
-
contigA 10043 10052
|
|
81
|
-
contigA 10216 10225
|
|
82
|
-
contigA 10217 10226
|
|
83
|
-
contigA 10252 10261
|
|
84
|
-
contigA 10384 10393
|
|
85
|
-
contigA 10498 10507
|
|
86
|
-
contigA 10585 10594
|
|
87
|
-
contigA 10684 10693
|
|
88
|
-
contigA 10781 10790
|
|
89
|
-
contigA 10875 10884
|
|
90
|
-
contigA 11004 11013
|
|
91
|
-
contigA 11095 11104
|
|
92
|
-
contigA 11182 11191
|
|
93
|
-
contigA 11207 11216
|
|
94
|
-
contigA 11241 11250
|
|
95
|
-
contigA 11335 11344
|
|
96
|
-
contigA 11340 11349
|
|
97
|
-
contigA 11535 11544
|
|
98
|
-
contigA 11543 11552
|
|
99
|
-
contigA 11549 11558
|
|
100
|
-
contigA 11653 11662
|
|
101
|
-
contigA 11675 11684
|
|
102
|
-
contigA 11689 11698
|
|
103
|
-
contigA 11774 11783
|
|
104
|
-
contigA 11832 11841
|
|
105
|
-
contigA 12386 12395
|
|
106
|
-
contigA 12408 12417
|
|
107
|
-
contigA 12441 12450
|
|
108
|
-
contigA 12530 12539
|
|
109
|
-
contigA 12738 12747
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
#this is a test header
|
|
2
|
-
#this is a test header
|
|
3
|
-
#this is a test header
|
|
4
|
-
#this is a test header
|
|
5
|
-
#this is a test header
|
|
6
|
-
#this is a test header
|
|
7
|
-
#this is a test header
|
|
8
|
-
#this is a test header
|
|
9
|
-
#this is a test header
|
|
10
|
-
#this is a test header
|
|
11
|
-
#this is a test header
|
|
12
|
-
#this is a test header
|
|
13
|
-
contigA 3000 3009
|
|
14
|
-
contigA 3105 3114
|
|
15
|
-
contigA 3152 3161
|
|
16
|
-
contigA 3171 3180
|
|
17
|
-
contigA 3174 3183
|
|
18
|
-
contigA 3213 3222
|
|
19
|
-
contigA 3465 3474
|
|
20
|
-
contigA 3795 3804
|
|
21
|
-
contigA 4035 4044
|
|
22
|
-
contigA 4073 4082
|
|
23
|
-
contigA 4074 4083
|
|
24
|
-
contigA 4166 4175
|
|
25
|
-
contigA 4179 4188
|
|
26
|
-
contigA 4204 4213
|
|
27
|
-
contigA 4248 4257
|
|
28
|
-
contigA 4260 4269
|
|
29
|
-
contigA 4577 4586
|
|
30
|
-
contigA 4828 4837
|
|
31
|
-
contigA 4901 4910
|
|
32
|
-
contigA 5006 5015
|
|
33
|
-
contigA 5051 5060
|
|
34
|
-
contigA 5201 5210
|
|
35
|
-
contigA 5260 5269
|
|
36
|
-
contigA 5281 5290
|
|
37
|
-
contigA 5349 5358
|
|
38
|
-
contigA 5353 5362
|
|
39
|
-
contigA 5423 5432
|
|
40
|
-
contigA 5457 5466
|
|
41
|
-
contigA 5548 5557
|
|
42
|
-
contigA 5626 5635
|
|
43
|
-
contigA 5835 5844
|
|
44
|
-
contigA 5909 5918
|
|
45
|
-
contigA 5927 5936
|
|
46
|
-
contigA 5969 5978
|
|
47
|
-
contigA 6070 6079
|
|
48
|
-
contigA 6185 6194
|
|
49
|
-
contigA 6285 6294
|
|
50
|
-
contigA 6363 6372
|
|
51
|
-
contigA 6559 6568
|
|
52
|
-
contigA 6834 6843
|
|
53
|
-
contigA 6908 6917
|
|
54
|
-
contigA 6918 6927
|
|
55
|
-
contigA 7141 7150
|
|
56
|
-
contigA 7173 7182
|
|
57
|
-
contigA 7569 7578
|
|
58
|
-
contigA 7619 7628
|
|
59
|
-
contigA 7654 7663
|
|
60
|
-
contigA 7671 7680
|
|
61
|
-
contigA 7707 7716
|
|
62
|
-
contigA 7739 7748
|
|
63
|
-
contigA 8077 8086
|
|
64
|
-
contigA 8128 8137
|
|
65
|
-
contigA 8132 8141
|
|
66
|
-
contigA 8210 8219
|
|
67
|
-
contigA 8267 8276
|
|
68
|
-
contigA 8328 8337
|
|
69
|
-
contigA 8524 8533
|
|
70
|
-
contigA 8659 8668
|
|
71
|
-
contigA 8660 8669
|
|
72
|
-
contigA 8742 8751
|
|
73
|
-
contigA 8811 8820
|
|
74
|
-
contigA 8816 8825
|
|
75
|
-
contigA 8964 8973
|
|
76
|
-
contigA 9048 9057
|
|
77
|
-
contigA 9054 9063
|
|
78
|
-
contigA 9136 9145
|
|
79
|
-
contigA 9243 9252
|
|
80
|
-
contigA 9320 9329
|
|
81
|
-
contigA 9366 9375
|
|
82
|
-
contigA 9525 9534
|
|
83
|
-
contigA 9580 9589
|
|
84
|
-
contigA 9610 9619
|
|
85
|
-
contigA 9744 9753
|
|
86
|
-
contigA 9753 9762
|
|
87
|
-
contigA 9759 9768
|
|
88
|
-
contigA 9807 9816
|
|
89
|
-
contigA 9853 9862
|
|
90
|
-
contigA 9884 9893
|
|
91
|
-
contigA 9920 9929
|
|
92
|
-
contigA 10043 10052
|
|
93
|
-
contigA 10216 10225
|
|
94
|
-
contigA 10217 10226
|
|
95
|
-
contigA 10252 10261
|
|
96
|
-
contigA 10384 10393
|
|
97
|
-
contigA 10498 10507
|
|
98
|
-
contigA 10585 10594
|
|
99
|
-
contigA 10684 10693
|
|
100
|
-
contigA 10781 10790
|
|
101
|
-
contigA 10875 10884
|
|
102
|
-
contigA 11004 11013
|
|
103
|
-
contigA 11095 11104
|
|
104
|
-
contigA 11182 11191
|
|
105
|
-
contigA 11207 11216
|
|
106
|
-
contigA 11241 11250
|
|
107
|
-
contigA 11335 11344
|
|
108
|
-
contigA 11340 11349
|
|
109
|
-
contigA 11535 11544
|
|
110
|
-
contigA 11543 11552
|
|
111
|
-
contigA 11549 11558
|
|
112
|
-
contigA 11653 11662
|
|
113
|
-
contigA 11675 11684
|
|
114
|
-
contigA 11689 11698
|
|
115
|
-
contigA 11774 11783
|
|
116
|
-
contigA 11832 11841
|
|
117
|
-
contigA 12386 12395
|
|
118
|
-
contigA 12408 12417
|
|
119
|
-
contigA 12441 12450
|
|
120
|
-
contigA 12530 12539
|
|
121
|
-
contigA 12738 12747
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { toArray } from 'rxjs/operators'
|
|
2
|
-
import { firstValueFrom } from 'rxjs'
|
|
3
|
-
import BedTabixAdapter from './BedTabixAdapter'
|
|
4
|
-
import MyConfigSchema from './configSchema'
|
|
5
|
-
|
|
6
|
-
test('adapter can fetch features from volvox-bed12.bed.gz', async () => {
|
|
7
|
-
const adapter = new BedTabixAdapter(
|
|
8
|
-
MyConfigSchema.create({
|
|
9
|
-
bedGzLocation: {
|
|
10
|
-
localPath: require.resolve('./test_data/volvox-bed12.bed.gz'),
|
|
11
|
-
locationType: 'LocalPathLocation',
|
|
12
|
-
},
|
|
13
|
-
index: {
|
|
14
|
-
location: {
|
|
15
|
-
localPath: require.resolve('./test_data/volvox-bed12.bed.gz.tbi'),
|
|
16
|
-
locationType: 'LocalPathLocation',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
}),
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
const features = adapter.getFeatures({
|
|
23
|
-
refName: 'ctgA',
|
|
24
|
-
start: 0,
|
|
25
|
-
end: 20000,
|
|
26
|
-
assemblyName: 'volvox',
|
|
27
|
-
})
|
|
28
|
-
expect(await adapter.hasDataForRefName('ctgA')).toBe(true)
|
|
29
|
-
expect(await adapter.hasDataForRefName('ctgB')).toBe(false)
|
|
30
|
-
|
|
31
|
-
const featuresArray = await firstValueFrom(features.pipe(toArray()))
|
|
32
|
-
const featuresJsonArray = featuresArray.map(f => f.toJSON())
|
|
33
|
-
expect(featuresJsonArray.slice(0, 10)).toMatchSnapshot()
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
test('adapter can fetch features from volvox.sort.bed.gz simple bed3', async () => {
|
|
37
|
-
const adapter = new BedTabixAdapter(
|
|
38
|
-
MyConfigSchema.create({
|
|
39
|
-
bedGzLocation: {
|
|
40
|
-
localPath: require.resolve('./test_data/volvox.sort.bed.gz'),
|
|
41
|
-
locationType: 'LocalPathLocation',
|
|
42
|
-
},
|
|
43
|
-
index: {
|
|
44
|
-
location: {
|
|
45
|
-
localPath: require.resolve('./test_data/volvox.sort.bed.gz.tbi'),
|
|
46
|
-
locationType: 'LocalPathLocation',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
const features = adapter.getFeatures({
|
|
53
|
-
refName: 'contigA',
|
|
54
|
-
start: 0,
|
|
55
|
-
end: 20000,
|
|
56
|
-
assemblyName: 'volvox',
|
|
57
|
-
})
|
|
58
|
-
expect(await adapter.hasDataForRefName('contigA')).toBe(true)
|
|
59
|
-
expect(await adapter.hasDataForRefName('ctgB')).toBe(false)
|
|
60
|
-
|
|
61
|
-
const featuresArray = await firstValueFrom(features.pipe(toArray()))
|
|
62
|
-
const featuresJsonArray = featuresArray.map(f => f.toJSON())
|
|
63
|
-
expect(featuresJsonArray.slice(0, 10)).toMatchSnapshot()
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
test('adapter can fetch features bed with autosql', async () => {
|
|
67
|
-
const adapter = new BedTabixAdapter(
|
|
68
|
-
MyConfigSchema.create({
|
|
69
|
-
bedGzLocation: {
|
|
70
|
-
localPath: require.resolve('./test_data/volvox-autosql.bed.gz'),
|
|
71
|
-
locationType: 'LocalPathLocation',
|
|
72
|
-
},
|
|
73
|
-
index: {
|
|
74
|
-
location: {
|
|
75
|
-
localPath: require.resolve('./test_data/volvox-autosql.bed.gz.tbi'),
|
|
76
|
-
locationType: 'LocalPathLocation',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
autoSql: `table gdcCancer
|
|
80
|
-
"somatic variants converted from MAF files obtained through the NCI GDC"
|
|
81
|
-
(
|
|
82
|
-
string chrom; "Chromosome (or contig, scaffold, etc.)"
|
|
83
|
-
uint chromStart; "Start position in chromosome"
|
|
84
|
-
uint chromEnd; "End position in chromosome"
|
|
85
|
-
string name; "Name of item"
|
|
86
|
-
uint score; "Score from 0-1000"
|
|
87
|
-
char[1] strand; "+ or -"
|
|
88
|
-
uint thickStart; "Start of where display should be thick (start codon)"
|
|
89
|
-
uint thickEnd; "End of where display should be thick (stop codon)"
|
|
90
|
-
uint reserved; "Used as itemRgb as of 2004-11-22"
|
|
91
|
-
int blockCount; "Number of blocks"
|
|
92
|
-
int[blockCount] blockSizes; "Comma separated list of block sizes"
|
|
93
|
-
int[blockCount] chromStarts; "Start positions relative to chromStart"
|
|
94
|
-
string sampleCount; "Number of samples with this variant"
|
|
95
|
-
string freq; "Variant frequency"
|
|
96
|
-
lstring Hugo_Symbol; "Hugo symbol"
|
|
97
|
-
lstring Entrez_Gene_Id; "Entrez Gene Id"
|
|
98
|
-
lstring Variant_Classification; "Class of variant"
|
|
99
|
-
lstring Variant_Type; "Type of variant"
|
|
100
|
-
lstring Reference_Allele; "Reference allele"
|
|
101
|
-
lstring Tumor_Seq_Allele1; "Tumor allele 1"
|
|
102
|
-
lstring Tumor_Seq_Allele2; "Tumor allele 2"
|
|
103
|
-
lstring dbSNP_RS; "dbSNP RS number"
|
|
104
|
-
lstring dbSNP_Val_Status; "dbSNP validation status"
|
|
105
|
-
lstring days_to_death; "Number of days till death"
|
|
106
|
-
lstring cigarettes_per_day; "Number of cigarettes per day"
|
|
107
|
-
lstring weight; "Weight"
|
|
108
|
-
lstring alcohol_history; "Any alcohol consumption?"
|
|
109
|
-
lstring alcohol_intensity; "Frequency of alcohol consumption"
|
|
110
|
-
lstring bmi; "Body mass index"
|
|
111
|
-
lstring years_smoked; "Number of years smoked"
|
|
112
|
-
lstring height; "Height"
|
|
113
|
-
lstring gender; "Gender"
|
|
114
|
-
lstring project_id; "TCGA Project id"
|
|
115
|
-
lstring ethnicity; "Ethnicity"
|
|
116
|
-
lstring Tumor_Sample_Barcode; "Tumor sample barcode"
|
|
117
|
-
lstring Matched_Norm_Sample_Barcode; "Matcheds normal sample barcode"
|
|
118
|
-
lstring case_id; "Case ID number"
|
|
119
|
-
)`,
|
|
120
|
-
}),
|
|
121
|
-
)
|
|
122
|
-
const features = adapter.getFeatures({
|
|
123
|
-
refName: 'ctgA',
|
|
124
|
-
start: 0,
|
|
125
|
-
end: 20000,
|
|
126
|
-
assemblyName: 'volvox',
|
|
127
|
-
})
|
|
128
|
-
expect(await adapter.hasDataForRefName('ctgA')).toBe(true)
|
|
129
|
-
expect(await adapter.hasDataForRefName('ctgB')).toBe(false)
|
|
130
|
-
|
|
131
|
-
const featuresArray = await firstValueFrom(features.pipe(toArray()))
|
|
132
|
-
const featuresJsonArray = featuresArray.map(f => f.toJSON())
|
|
133
|
-
expect(featuresJsonArray.slice(0, 10)).toMatchSnapshot()
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
test('adapter can fetch bed with header', async () => {
|
|
137
|
-
const adapter = new BedTabixAdapter(
|
|
138
|
-
MyConfigSchema.create({
|
|
139
|
-
bedGzLocation: {
|
|
140
|
-
localPath: require.resolve(
|
|
141
|
-
'./test_data/volvox.sort.with.header.bed.gz',
|
|
142
|
-
),
|
|
143
|
-
locationType: 'LocalPathLocation',
|
|
144
|
-
},
|
|
145
|
-
index: {
|
|
146
|
-
location: {
|
|
147
|
-
localPath: require.resolve(
|
|
148
|
-
'./test_data/volvox.sort.with.header.bed.gz.tbi',
|
|
149
|
-
),
|
|
150
|
-
locationType: 'LocalPathLocation',
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
}),
|
|
154
|
-
)
|
|
155
|
-
|
|
156
|
-
const features = adapter.getFeatures({
|
|
157
|
-
refName: 'contigA',
|
|
158
|
-
start: 0,
|
|
159
|
-
end: 20000,
|
|
160
|
-
assemblyName: 'volvox',
|
|
161
|
-
})
|
|
162
|
-
expect(await adapter.hasDataForRefName('contigA')).toBe(true)
|
|
163
|
-
expect(await adapter.hasDataForRefName('ctgB')).toBe(false)
|
|
164
|
-
|
|
165
|
-
const featuresArray = await firstValueFrom(features.pipe(toArray()))
|
|
166
|
-
const featuresJsonArray = featuresArray.map(f => f.toJSON())
|
|
167
|
-
expect(featuresJsonArray.slice(0, 10)).toMatchSnapshot()
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
test('adapter can use gwas header', async () => {
|
|
171
|
-
const adapter = new BedTabixAdapter(
|
|
172
|
-
MyConfigSchema.create({
|
|
173
|
-
bedGzLocation: {
|
|
174
|
-
localPath: require.resolve('./test_data/gwas.bed.gz'),
|
|
175
|
-
locationType: 'LocalPathLocation',
|
|
176
|
-
},
|
|
177
|
-
index: {
|
|
178
|
-
location: {
|
|
179
|
-
localPath: require.resolve('./test_data/gwas.bed.gz.tbi'),
|
|
180
|
-
locationType: 'LocalPathLocation',
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
}),
|
|
184
|
-
)
|
|
185
|
-
|
|
186
|
-
const features = adapter.getFeatures({
|
|
187
|
-
refName: '1',
|
|
188
|
-
start: 0,
|
|
189
|
-
end: 100_000,
|
|
190
|
-
assemblyName: 'hg19',
|
|
191
|
-
})
|
|
192
|
-
|
|
193
|
-
const featuresArray = await firstValueFrom(features.pipe(toArray()))
|
|
194
|
-
const featuresJsonArray = featuresArray.map(f => f.toJSON())
|
|
195
|
-
expect(featuresJsonArray.slice(0, 10)).toMatchSnapshot()
|
|
196
|
-
})
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import BED from '@gmod/bed'
|
|
2
|
-
import {
|
|
3
|
-
BaseFeatureDataAdapter,
|
|
4
|
-
BaseOptions,
|
|
5
|
-
} from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
6
|
-
import { openLocation } from '@jbrowse/core/util/io'
|
|
7
|
-
import { ObservableCreate } from '@jbrowse/core/util/rxjs'
|
|
8
|
-
import { FileLocation, Region, Feature } from '@jbrowse/core/util'
|
|
9
|
-
import { TabixIndexedFile } from '@gmod/tabix'
|
|
10
|
-
import { featureData } from '../util'
|
|
11
|
-
import PluginManager from '@jbrowse/core/PluginManager'
|
|
12
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration'
|
|
13
|
-
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache'
|
|
14
|
-
|
|
15
|
-
export default class BedTabixAdapter extends BaseFeatureDataAdapter {
|
|
16
|
-
private parser: BED
|
|
17
|
-
|
|
18
|
-
protected bed: TabixIndexedFile
|
|
19
|
-
|
|
20
|
-
protected columnNames: string[]
|
|
21
|
-
|
|
22
|
-
protected scoreColumn: string
|
|
23
|
-
|
|
24
|
-
public static capabilities = ['getFeatures', 'getRefNames']
|
|
25
|
-
|
|
26
|
-
public constructor(
|
|
27
|
-
config: AnyConfigurationModel,
|
|
28
|
-
getSubAdapter?: getSubAdapterType,
|
|
29
|
-
pluginManager?: PluginManager,
|
|
30
|
-
) {
|
|
31
|
-
super(config, getSubAdapter, pluginManager)
|
|
32
|
-
const bedGzLoc = this.getConf('bedGzLocation') as FileLocation
|
|
33
|
-
const type = this.getConf(['index', 'indexType'])
|
|
34
|
-
const loc = this.getConf(['index', 'location'])
|
|
35
|
-
const autoSql = this.getConf('autoSql')
|
|
36
|
-
const pm = this.pluginManager
|
|
37
|
-
|
|
38
|
-
this.bed = new TabixIndexedFile({
|
|
39
|
-
filehandle: openLocation(bedGzLoc, pm),
|
|
40
|
-
csiFilehandle: type === 'CSI' ? openLocation(loc, pm) : undefined,
|
|
41
|
-
tbiFilehandle: type !== 'CSI' ? openLocation(loc, pm) : undefined,
|
|
42
|
-
chunkCacheSize: 50 * 2 ** 20,
|
|
43
|
-
})
|
|
44
|
-
this.columnNames = this.getConf('columnNames')
|
|
45
|
-
this.scoreColumn = this.getConf('scoreColumn')
|
|
46
|
-
this.parser = new BED({ autoSql })
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public async getRefNames(opts: BaseOptions = {}) {
|
|
50
|
-
return this.bed.getReferenceSequenceNames(opts)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async getHeader() {
|
|
54
|
-
return this.bed.getHeader()
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async getNames() {
|
|
58
|
-
if (this.columnNames.length) {
|
|
59
|
-
return this.columnNames
|
|
60
|
-
}
|
|
61
|
-
const header = await this.bed.getHeader()
|
|
62
|
-
const defs = header.split(/\n|\r\n|\r/).filter(f => !!f)
|
|
63
|
-
const defline = defs.at(-1)
|
|
64
|
-
return defline?.includes('\t')
|
|
65
|
-
? defline
|
|
66
|
-
.slice(1)
|
|
67
|
-
.split('\t')
|
|
68
|
-
.map(f => f.trim())
|
|
69
|
-
: undefined
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
public getFeatures(query: Region, opts: BaseOptions = {}) {
|
|
73
|
-
return ObservableCreate<Feature>(async observer => {
|
|
74
|
-
const meta = await this.bed.getMetadata()
|
|
75
|
-
const { columnNumbers } = meta
|
|
76
|
-
const colRef = columnNumbers.ref - 1
|
|
77
|
-
const colStart = columnNumbers.start - 1
|
|
78
|
-
const colEnd = columnNumbers.end - 1
|
|
79
|
-
// colSame handles special case for tabix where a single column is both
|
|
80
|
-
// the start and end, this is assumed to be covering the base at this
|
|
81
|
-
// position (e.g. tabix -s 1 -b 2 -e 2) begin and end are same
|
|
82
|
-
const names = await this.getNames()
|
|
83
|
-
await this.bed.getLines(query.refName, query.start, query.end, {
|
|
84
|
-
lineCallback: (line, fileOffset) => {
|
|
85
|
-
observer.next(
|
|
86
|
-
featureData(
|
|
87
|
-
line,
|
|
88
|
-
colRef,
|
|
89
|
-
colStart,
|
|
90
|
-
colEnd,
|
|
91
|
-
this.scoreColumn,
|
|
92
|
-
this.parser,
|
|
93
|
-
`${this.id}-${fileOffset}`,
|
|
94
|
-
names,
|
|
95
|
-
),
|
|
96
|
-
)
|
|
97
|
-
},
|
|
98
|
-
signal: opts.signal,
|
|
99
|
-
})
|
|
100
|
-
observer.complete()
|
|
101
|
-
}, opts.signal)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
public freeResources(): void {}
|
|
105
|
-
}
|