@jbrowse/plugin-bed 2.6.1 → 2.6.2
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,171 +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 { Region, Feature } from '@jbrowse/core/util'
|
|
9
|
-
import { featureData } from '../util'
|
|
10
|
-
import IntervalTree from '@flatten-js/interval-tree'
|
|
11
|
-
import { unzip } from '@gmod/bgzf-filehandle'
|
|
12
|
-
|
|
13
|
-
function isGzip(buf: Buffer) {
|
|
14
|
-
return buf[0] === 31 && buf[1] === 139 && buf[2] === 8
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default class BedAdapter extends BaseFeatureDataAdapter {
|
|
18
|
-
protected bedFeatures?: Promise<{
|
|
19
|
-
header: string
|
|
20
|
-
features: Record<string, string[]>
|
|
21
|
-
parser: BED
|
|
22
|
-
columnNames: string[]
|
|
23
|
-
scoreColumn: string
|
|
24
|
-
colRef: number
|
|
25
|
-
colStart: number
|
|
26
|
-
colEnd: number
|
|
27
|
-
}>
|
|
28
|
-
|
|
29
|
-
protected intervalTrees: {
|
|
30
|
-
[key: string]: Promise<IntervalTree | undefined> | undefined
|
|
31
|
-
} = {}
|
|
32
|
-
|
|
33
|
-
public static capabilities = ['getFeatures', 'getRefNames']
|
|
34
|
-
|
|
35
|
-
private async loadDataP(opts: BaseOptions = {}) {
|
|
36
|
-
const pm = this.pluginManager
|
|
37
|
-
const bedLoc = this.getConf('bedLocation')
|
|
38
|
-
const buf = await openLocation(bedLoc, pm).readFile(opts)
|
|
39
|
-
const buffer = isGzip(buf) ? await unzip(buf) : buf
|
|
40
|
-
// 512MB max chrome string length is 512MB
|
|
41
|
-
if (buffer.length > 536_870_888) {
|
|
42
|
-
throw new Error('Data exceeds maximum string length (512MB)')
|
|
43
|
-
}
|
|
44
|
-
const data = new TextDecoder('utf8', { fatal: true }).decode(buffer)
|
|
45
|
-
const lines = data.split(/\n|\r\n|\r/).filter(f => !!f)
|
|
46
|
-
const headerLines = []
|
|
47
|
-
let i = 0
|
|
48
|
-
for (; i < lines.length && lines[i].startsWith('#'); i++) {
|
|
49
|
-
headerLines.push(lines[i])
|
|
50
|
-
}
|
|
51
|
-
const header = headerLines.join('\n')
|
|
52
|
-
const features = {} as Record<string, string[]>
|
|
53
|
-
for (; i < lines.length; i++) {
|
|
54
|
-
const line = lines[i]
|
|
55
|
-
const tab = line.indexOf('\t')
|
|
56
|
-
const refName = line.slice(0, tab)
|
|
57
|
-
if (!features[refName]) {
|
|
58
|
-
features[refName] = []
|
|
59
|
-
}
|
|
60
|
-
features[refName].push(line)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const autoSql = this.getConf('autoSql') as string
|
|
64
|
-
const parser = new BED({ autoSql })
|
|
65
|
-
const columnNames = this.getConf('columnNames')
|
|
66
|
-
const scoreColumn = this.getConf('scoreColumn')
|
|
67
|
-
const colRef = this.getConf('colRef')
|
|
68
|
-
const colStart = this.getConf('colStart')
|
|
69
|
-
const colEnd = this.getConf('colEnd')
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
header,
|
|
73
|
-
features,
|
|
74
|
-
parser,
|
|
75
|
-
columnNames,
|
|
76
|
-
scoreColumn,
|
|
77
|
-
colRef,
|
|
78
|
-
colStart,
|
|
79
|
-
colEnd,
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
private async loadData(opts: BaseOptions = {}) {
|
|
84
|
-
if (!this.bedFeatures) {
|
|
85
|
-
this.bedFeatures = this.loadDataP(opts).catch(e => {
|
|
86
|
-
this.bedFeatures = undefined
|
|
87
|
-
throw e
|
|
88
|
-
})
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return this.bedFeatures
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
public async getRefNames(opts: BaseOptions = {}) {
|
|
95
|
-
const { features } = await this.loadData(opts)
|
|
96
|
-
return Object.keys(features)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
async getHeader(opts: BaseOptions = {}) {
|
|
100
|
-
const { header } = await this.loadData(opts)
|
|
101
|
-
return header
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
async getNames() {
|
|
105
|
-
const { header, columnNames } = await this.loadData()
|
|
106
|
-
if (columnNames.length) {
|
|
107
|
-
return columnNames
|
|
108
|
-
}
|
|
109
|
-
const defs = header.split(/\n|\r\n|\r/).filter(f => !!f)
|
|
110
|
-
const defline = defs.at(-1)
|
|
111
|
-
return defline?.includes('\t')
|
|
112
|
-
? defline
|
|
113
|
-
.slice(1)
|
|
114
|
-
.split('\t')
|
|
115
|
-
.map(field => field.trim())
|
|
116
|
-
: undefined
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
private async loadFeatureIntervalTreeHelper(refName: string) {
|
|
120
|
-
const { colRef, colStart, colEnd, features, parser, scoreColumn } =
|
|
121
|
-
await this.loadData()
|
|
122
|
-
const lines = features[refName]
|
|
123
|
-
if (!lines) {
|
|
124
|
-
return undefined
|
|
125
|
-
}
|
|
126
|
-
const names = await this.getNames()
|
|
127
|
-
|
|
128
|
-
const intervalTree = new IntervalTree()
|
|
129
|
-
const ret = lines.map((f, i) => {
|
|
130
|
-
const uniqueId = `${this.id}-${refName}-${i}`
|
|
131
|
-
return featureData(
|
|
132
|
-
f,
|
|
133
|
-
colRef,
|
|
134
|
-
colStart,
|
|
135
|
-
colEnd,
|
|
136
|
-
scoreColumn,
|
|
137
|
-
parser,
|
|
138
|
-
uniqueId,
|
|
139
|
-
names,
|
|
140
|
-
)
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
for (const obj of ret) {
|
|
144
|
-
intervalTree.insert([obj.get('start'), obj.get('end')], obj)
|
|
145
|
-
}
|
|
146
|
-
return intervalTree
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
private async loadFeatureIntervalTree(refName: string) {
|
|
150
|
-
if (!this.intervalTrees[refName]) {
|
|
151
|
-
this.intervalTrees[refName] = this.loadFeatureIntervalTreeHelper(
|
|
152
|
-
refName,
|
|
153
|
-
).catch(e => {
|
|
154
|
-
this.intervalTrees[refName] = undefined
|
|
155
|
-
throw e
|
|
156
|
-
})
|
|
157
|
-
}
|
|
158
|
-
return this.intervalTrees[refName]
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
public getFeatures(query: Region, opts: BaseOptions = {}) {
|
|
162
|
-
return ObservableCreate<Feature>(async observer => {
|
|
163
|
-
const { start, end, refName } = query
|
|
164
|
-
const intervalTree = await this.loadFeatureIntervalTree(refName)
|
|
165
|
-
intervalTree?.search([start, end]).forEach(f => observer.next(f))
|
|
166
|
-
observer.complete()
|
|
167
|
-
}, opts.signal)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
public freeResources(): void {}
|
|
171
|
-
}
|
|
@@ -1,437 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`adapter can fetch bed with header 1`] = `
|
|
4
|
-
[
|
|
5
|
-
{
|
|
6
|
-
"end": 3009,
|
|
7
|
-
"refName": "contigA",
|
|
8
|
-
"start": 3000,
|
|
9
|
-
"strand": 0,
|
|
10
|
-
"uniqueId": "test-contigA-0",
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"end": 3114,
|
|
14
|
-
"refName": "contigA",
|
|
15
|
-
"start": 3105,
|
|
16
|
-
"strand": 0,
|
|
17
|
-
"uniqueId": "test-contigA-1",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"end": 3161,
|
|
21
|
-
"refName": "contigA",
|
|
22
|
-
"start": 3152,
|
|
23
|
-
"strand": 0,
|
|
24
|
-
"uniqueId": "test-contigA-2",
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"end": 3180,
|
|
28
|
-
"refName": "contigA",
|
|
29
|
-
"start": 3171,
|
|
30
|
-
"strand": 0,
|
|
31
|
-
"uniqueId": "test-contigA-3",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"end": 3183,
|
|
35
|
-
"refName": "contigA",
|
|
36
|
-
"start": 3174,
|
|
37
|
-
"strand": 0,
|
|
38
|
-
"uniqueId": "test-contigA-4",
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"end": 3222,
|
|
42
|
-
"refName": "contigA",
|
|
43
|
-
"start": 3213,
|
|
44
|
-
"strand": 0,
|
|
45
|
-
"uniqueId": "test-contigA-5",
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"end": 3474,
|
|
49
|
-
"refName": "contigA",
|
|
50
|
-
"start": 3465,
|
|
51
|
-
"strand": 0,
|
|
52
|
-
"uniqueId": "test-contigA-6",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"end": 3804,
|
|
56
|
-
"refName": "contigA",
|
|
57
|
-
"start": 3795,
|
|
58
|
-
"strand": 0,
|
|
59
|
-
"uniqueId": "test-contigA-7",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"end": 4044,
|
|
63
|
-
"refName": "contigA",
|
|
64
|
-
"start": 4035,
|
|
65
|
-
"strand": 0,
|
|
66
|
-
"uniqueId": "test-contigA-8",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"end": 4082,
|
|
70
|
-
"refName": "contigA",
|
|
71
|
-
"start": 4073,
|
|
72
|
-
"strand": 0,
|
|
73
|
-
"uniqueId": "test-contigA-9",
|
|
74
|
-
},
|
|
75
|
-
]
|
|
76
|
-
`;
|
|
77
|
-
|
|
78
|
-
exports[`adapter can fetch features bed with autosql 1`] = `
|
|
79
|
-
[
|
|
80
|
-
{
|
|
81
|
-
"Entrez_Gene_Id": "2782",
|
|
82
|
-
"Hugo_Symbol": "GNB1",
|
|
83
|
-
"Matched_Norm_Sample_Barcode": "TCGA-OR-A5KB-11A-11D-A30A-10",
|
|
84
|
-
"Reference_Allele": "T",
|
|
85
|
-
"Tumor_Sample_Barcode": "TCGA-OR-A5KB-01A-11D-A30A-10",
|
|
86
|
-
"Tumor_Seq_Allele1": "T",
|
|
87
|
-
"Tumor_Seq_Allele2": "G",
|
|
88
|
-
"Variant_Classification": "Splice_Region",
|
|
89
|
-
"Variant_Type": "SNP",
|
|
90
|
-
"alcohol_history": "--",
|
|
91
|
-
"alcohol_intensity": "--",
|
|
92
|
-
"bmi": "--",
|
|
93
|
-
"case_id": "09454ed6-64bc-4a35-af44-7c4344623d45",
|
|
94
|
-
"cigarettes_per_day": "--",
|
|
95
|
-
"days_to_death": "--",
|
|
96
|
-
"dbSNP_RS": "novel",
|
|
97
|
-
"dbSNP_Val_Status": "",
|
|
98
|
-
"end": 10,
|
|
99
|
-
"ethnicity": "not hispanic or latino",
|
|
100
|
-
"freq": "0.0108695652174",
|
|
101
|
-
"gender": "female",
|
|
102
|
-
"height": "--",
|
|
103
|
-
"name": "T>G",
|
|
104
|
-
"project_id": "TCGA-ACC",
|
|
105
|
-
"refName": "ctgA",
|
|
106
|
-
"reserved": "0,0,0",
|
|
107
|
-
"sampleCount": "1",
|
|
108
|
-
"score": 1,
|
|
109
|
-
"start": 1,
|
|
110
|
-
"strand": 0,
|
|
111
|
-
"subfeatures": [
|
|
112
|
-
{
|
|
113
|
-
"end": 2,
|
|
114
|
-
"parentId": "test-ctgA-0",
|
|
115
|
-
"start": 1,
|
|
116
|
-
"strand": 0,
|
|
117
|
-
"type": "three_prime_UTR",
|
|
118
|
-
"uniqueId": "test-ctgA-0-0",
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
"type": "mRNA",
|
|
122
|
-
"uniqueId": "test-ctgA-0",
|
|
123
|
-
"weight": "--",
|
|
124
|
-
"years_smoked": "--",
|
|
125
|
-
},
|
|
126
|
-
]
|
|
127
|
-
`;
|
|
128
|
-
|
|
129
|
-
exports[`adapter can fetch features from volvox.sort.bed simple bed3 1`] = `
|
|
130
|
-
[
|
|
131
|
-
{
|
|
132
|
-
"end": 3009,
|
|
133
|
-
"refName": "contigA",
|
|
134
|
-
"start": 3000,
|
|
135
|
-
"strand": 0,
|
|
136
|
-
"uniqueId": "test-contigA-0",
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"end": 3114,
|
|
140
|
-
"refName": "contigA",
|
|
141
|
-
"start": 3105,
|
|
142
|
-
"strand": 0,
|
|
143
|
-
"uniqueId": "test-contigA-1",
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"end": 3161,
|
|
147
|
-
"refName": "contigA",
|
|
148
|
-
"start": 3152,
|
|
149
|
-
"strand": 0,
|
|
150
|
-
"uniqueId": "test-contigA-2",
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
"end": 3180,
|
|
154
|
-
"refName": "contigA",
|
|
155
|
-
"start": 3171,
|
|
156
|
-
"strand": 0,
|
|
157
|
-
"uniqueId": "test-contigA-3",
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
"end": 3183,
|
|
161
|
-
"refName": "contigA",
|
|
162
|
-
"start": 3174,
|
|
163
|
-
"strand": 0,
|
|
164
|
-
"uniqueId": "test-contigA-4",
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"end": 3222,
|
|
168
|
-
"refName": "contigA",
|
|
169
|
-
"start": 3213,
|
|
170
|
-
"strand": 0,
|
|
171
|
-
"uniqueId": "test-contigA-5",
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"end": 3474,
|
|
175
|
-
"refName": "contigA",
|
|
176
|
-
"start": 3465,
|
|
177
|
-
"strand": 0,
|
|
178
|
-
"uniqueId": "test-contigA-6",
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"end": 3804,
|
|
182
|
-
"refName": "contigA",
|
|
183
|
-
"start": 3795,
|
|
184
|
-
"strand": 0,
|
|
185
|
-
"uniqueId": "test-contigA-7",
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"end": 4044,
|
|
189
|
-
"refName": "contigA",
|
|
190
|
-
"start": 4035,
|
|
191
|
-
"strand": 0,
|
|
192
|
-
"uniqueId": "test-contigA-8",
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"end": 4082,
|
|
196
|
-
"refName": "contigA",
|
|
197
|
-
"start": 4073,
|
|
198
|
-
"strand": 0,
|
|
199
|
-
"uniqueId": "test-contigA-9",
|
|
200
|
-
},
|
|
201
|
-
]
|
|
202
|
-
`;
|
|
203
|
-
|
|
204
|
-
exports[`adapter can fetch features from volvox-bed12.bed 1`] = `
|
|
205
|
-
[
|
|
206
|
-
{
|
|
207
|
-
"end": 9000,
|
|
208
|
-
"itemRgb": "0,0,0",
|
|
209
|
-
"name": "EDEN.1",
|
|
210
|
-
"refName": "ctgA",
|
|
211
|
-
"score": 1000,
|
|
212
|
-
"start": 1049,
|
|
213
|
-
"strand": 1,
|
|
214
|
-
"subfeatures": [
|
|
215
|
-
{
|
|
216
|
-
"end": 1200,
|
|
217
|
-
"parentId": "test-ctgA-0",
|
|
218
|
-
"start": 1049,
|
|
219
|
-
"strand": 1,
|
|
220
|
-
"type": "five_prime_UTR",
|
|
221
|
-
"uniqueId": "test-ctgA-0-0",
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
"end": 1500,
|
|
225
|
-
"parentId": "test-ctgA-0",
|
|
226
|
-
"start": 1200,
|
|
227
|
-
"strand": 1,
|
|
228
|
-
"type": "CDS",
|
|
229
|
-
"uniqueId": "test-ctgA-0-1",
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
"end": 3902,
|
|
233
|
-
"parentId": "test-ctgA-0",
|
|
234
|
-
"start": 2999,
|
|
235
|
-
"strand": 1,
|
|
236
|
-
"type": "CDS",
|
|
237
|
-
"uniqueId": "test-ctgA-0-2",
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
"end": 5500,
|
|
241
|
-
"parentId": "test-ctgA-0",
|
|
242
|
-
"start": 4999,
|
|
243
|
-
"strand": 1,
|
|
244
|
-
"type": "CDS",
|
|
245
|
-
"uniqueId": "test-ctgA-0-3",
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
"end": 7608,
|
|
249
|
-
"parentId": "test-ctgA-0",
|
|
250
|
-
"start": 6999,
|
|
251
|
-
"strand": 1,
|
|
252
|
-
"type": "CDS",
|
|
253
|
-
"uniqueId": "test-ctgA-0-4",
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
"end": 9000,
|
|
257
|
-
"parentId": "test-ctgA-0",
|
|
258
|
-
"start": 7608,
|
|
259
|
-
"strand": 1,
|
|
260
|
-
"type": "three_prime_UTR",
|
|
261
|
-
"uniqueId": "test-ctgA-0-5",
|
|
262
|
-
},
|
|
263
|
-
],
|
|
264
|
-
"type": "mRNA",
|
|
265
|
-
"uniqueId": "test-ctgA-0",
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
"end": 9000,
|
|
269
|
-
"itemRgb": "0,0,0",
|
|
270
|
-
"name": "EDEN.2",
|
|
271
|
-
"refName": "ctgA",
|
|
272
|
-
"score": 1000,
|
|
273
|
-
"start": 1049,
|
|
274
|
-
"strand": 1,
|
|
275
|
-
"subfeatures": [
|
|
276
|
-
{
|
|
277
|
-
"end": 1200,
|
|
278
|
-
"parentId": "test-ctgA-1",
|
|
279
|
-
"start": 1049,
|
|
280
|
-
"strand": 1,
|
|
281
|
-
"type": "five_prime_UTR",
|
|
282
|
-
"uniqueId": "test-ctgA-1-0",
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
"end": 1500,
|
|
286
|
-
"parentId": "test-ctgA-1",
|
|
287
|
-
"start": 1200,
|
|
288
|
-
"strand": 1,
|
|
289
|
-
"type": "CDS",
|
|
290
|
-
"uniqueId": "test-ctgA-1-1",
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
"end": 5500,
|
|
294
|
-
"parentId": "test-ctgA-1",
|
|
295
|
-
"start": 4999,
|
|
296
|
-
"strand": 1,
|
|
297
|
-
"type": "CDS",
|
|
298
|
-
"uniqueId": "test-ctgA-1-2",
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
"end": 7608,
|
|
302
|
-
"parentId": "test-ctgA-1",
|
|
303
|
-
"start": 6999,
|
|
304
|
-
"strand": 1,
|
|
305
|
-
"type": "CDS",
|
|
306
|
-
"uniqueId": "test-ctgA-1-3",
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"end": 9000,
|
|
310
|
-
"parentId": "test-ctgA-1",
|
|
311
|
-
"start": 7608,
|
|
312
|
-
"strand": 1,
|
|
313
|
-
"type": "three_prime_UTR",
|
|
314
|
-
"uniqueId": "test-ctgA-1-4",
|
|
315
|
-
},
|
|
316
|
-
],
|
|
317
|
-
"type": "mRNA",
|
|
318
|
-
"uniqueId": "test-ctgA-1",
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
"end": 9000,
|
|
322
|
-
"itemRgb": "0,0,0",
|
|
323
|
-
"name": "EDEN.3",
|
|
324
|
-
"refName": "ctgA",
|
|
325
|
-
"score": 1000,
|
|
326
|
-
"start": 1299,
|
|
327
|
-
"strand": 1,
|
|
328
|
-
"subfeatures": [
|
|
329
|
-
{
|
|
330
|
-
"end": 1500,
|
|
331
|
-
"parentId": "test-ctgA-2",
|
|
332
|
-
"start": 1299,
|
|
333
|
-
"strand": 1,
|
|
334
|
-
"type": "five_prime_UTR",
|
|
335
|
-
"uniqueId": "test-ctgA-2-0",
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
"end": 3300,
|
|
339
|
-
"parentId": "test-ctgA-2",
|
|
340
|
-
"start": 2999,
|
|
341
|
-
"strand": 1,
|
|
342
|
-
"type": "five_prime_UTR",
|
|
343
|
-
"uniqueId": "test-ctgA-2-1",
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
"end": 3902,
|
|
347
|
-
"parentId": "test-ctgA-2",
|
|
348
|
-
"start": 3300,
|
|
349
|
-
"strand": 1,
|
|
350
|
-
"type": "CDS",
|
|
351
|
-
"uniqueId": "test-ctgA-2-2",
|
|
352
|
-
},
|
|
353
|
-
{
|
|
354
|
-
"end": 5500,
|
|
355
|
-
"parentId": "test-ctgA-2",
|
|
356
|
-
"start": 4999,
|
|
357
|
-
"strand": 1,
|
|
358
|
-
"type": "CDS",
|
|
359
|
-
"uniqueId": "test-ctgA-2-3",
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
"end": 7600,
|
|
363
|
-
"parentId": "test-ctgA-2",
|
|
364
|
-
"start": 6999,
|
|
365
|
-
"strand": 1,
|
|
366
|
-
"type": "CDS",
|
|
367
|
-
"uniqueId": "test-ctgA-2-4",
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
"end": 9000,
|
|
371
|
-
"parentId": "test-ctgA-2",
|
|
372
|
-
"start": 7600,
|
|
373
|
-
"strand": 1,
|
|
374
|
-
"type": "three_prime_UTR",
|
|
375
|
-
"uniqueId": "test-ctgA-2-5",
|
|
376
|
-
},
|
|
377
|
-
],
|
|
378
|
-
"type": "mRNA",
|
|
379
|
-
"uniqueId": "test-ctgA-2",
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
"end": 23000,
|
|
383
|
-
"itemRgb": "0,0,0",
|
|
384
|
-
"name": "rna-Apple3",
|
|
385
|
-
"refName": "ctgA",
|
|
386
|
-
"score": 1000,
|
|
387
|
-
"start": 17399,
|
|
388
|
-
"strand": 1,
|
|
389
|
-
"subfeatures": [
|
|
390
|
-
{
|
|
391
|
-
"end": 17999,
|
|
392
|
-
"parentId": "test-ctgA-3",
|
|
393
|
-
"start": 17399,
|
|
394
|
-
"strand": 1,
|
|
395
|
-
"type": "five_prime_UTR",
|
|
396
|
-
"uniqueId": "test-ctgA-3-0",
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
"end": 18800,
|
|
400
|
-
"parentId": "test-ctgA-3",
|
|
401
|
-
"start": 17999,
|
|
402
|
-
"strand": 1,
|
|
403
|
-
"type": "CDS",
|
|
404
|
-
"uniqueId": "test-ctgA-3-1",
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
"end": 19500,
|
|
408
|
-
"parentId": "test-ctgA-3",
|
|
409
|
-
"start": 18999,
|
|
410
|
-
"strand": 1,
|
|
411
|
-
"type": "CDS",
|
|
412
|
-
"uniqueId": "test-ctgA-3-2",
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
"end": 21200,
|
|
416
|
-
"parentId": "test-ctgA-3",
|
|
417
|
-
"start": 20999,
|
|
418
|
-
"strand": 1,
|
|
419
|
-
"type": "CDS",
|
|
420
|
-
"uniqueId": "test-ctgA-3-3",
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
"end": 23000,
|
|
424
|
-
"parentId": "test-ctgA-3",
|
|
425
|
-
"start": 21200,
|
|
426
|
-
"strand": 1,
|
|
427
|
-
"type": "three_prime_UTR",
|
|
428
|
-
"uniqueId": "test-ctgA-3-4",
|
|
429
|
-
},
|
|
430
|
-
],
|
|
431
|
-
"type": "mRNA",
|
|
432
|
-
"uniqueId": "test-ctgA-3",
|
|
433
|
-
},
|
|
434
|
-
]
|
|
435
|
-
`;
|
|
436
|
-
|
|
437
|
-
exports[`adapter can use gwas header 1`] = `[]`;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* #config BedAdapter
|
|
5
|
-
*/
|
|
6
|
-
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7
|
-
|
|
8
|
-
const BedAdapter = ConfigurationSchema(
|
|
9
|
-
'BedAdapter',
|
|
10
|
-
{
|
|
11
|
-
/**
|
|
12
|
-
* #slot
|
|
13
|
-
*/
|
|
14
|
-
bedLocation: {
|
|
15
|
-
type: 'fileLocation',
|
|
16
|
-
defaultValue: { uri: '/path/to/my.bed.gz', locationType: 'UriLocation' },
|
|
17
|
-
},
|
|
18
|
-
/**
|
|
19
|
-
* #slot
|
|
20
|
-
*/
|
|
21
|
-
columnNames: {
|
|
22
|
-
type: 'stringArray',
|
|
23
|
-
description: 'List of column names',
|
|
24
|
-
defaultValue: [],
|
|
25
|
-
},
|
|
26
|
-
/**
|
|
27
|
-
* #slot
|
|
28
|
-
*/
|
|
29
|
-
scoreColumn: {
|
|
30
|
-
type: 'string',
|
|
31
|
-
description: 'The column to use as a "score" attribute',
|
|
32
|
-
defaultValue: '',
|
|
33
|
-
},
|
|
34
|
-
/**
|
|
35
|
-
* #slot
|
|
36
|
-
*/
|
|
37
|
-
autoSql: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
description: 'The autoSql definition for the data fields in the file',
|
|
40
|
-
defaultValue: '',
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* #slot
|
|
44
|
-
*/
|
|
45
|
-
colRef: {
|
|
46
|
-
type: 'number',
|
|
47
|
-
description: 'The column to use as a "refName" attribute',
|
|
48
|
-
defaultValue: 0,
|
|
49
|
-
},
|
|
50
|
-
/**
|
|
51
|
-
* #slot
|
|
52
|
-
*/
|
|
53
|
-
colStart: {
|
|
54
|
-
type: 'number',
|
|
55
|
-
description: 'The column to use as a "start" attribute',
|
|
56
|
-
defaultValue: 1,
|
|
57
|
-
},
|
|
58
|
-
/**
|
|
59
|
-
* #slot
|
|
60
|
-
*/
|
|
61
|
-
colEnd: {
|
|
62
|
-
type: 'number',
|
|
63
|
-
description: 'The column to use as a "end" attribute',
|
|
64
|
-
defaultValue: 2,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
{ explicitlyTyped: true },
|
|
68
|
-
)
|
|
69
|
-
export default BedAdapter
|
package/src/BedAdapter/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
-
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType'
|
|
3
|
-
|
|
4
|
-
import configSchema from './configSchema'
|
|
5
|
-
|
|
6
|
-
export default (pluginManager: PluginManager) => {
|
|
7
|
-
pluginManager.addAdapterType(
|
|
8
|
-
() =>
|
|
9
|
-
new AdapterType({
|
|
10
|
-
name: 'BedAdapter',
|
|
11
|
-
displayName: 'BED adapter',
|
|
12
|
-
configSchema,
|
|
13
|
-
getAdapterClass: () => import('./BedAdapter').then(r => r.default),
|
|
14
|
-
}),
|
|
15
|
-
)
|
|
16
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#chrom pos rsid ref alt neg_log_pvalue beta stderr_beta alt_allele_freq
|
|
2
|
-
1 721290 rs12565286 G C 0.275233 . . .
|
|
3
|
-
1 752566 rs3094315 G A 0.0315638 . . .
|
|
4
|
-
1 775659 rs2905035 A G 0.183626 . . .
|
|
5
|
-
1 777122 rs2980319 A T 0.207258 . . .
|
|
6
|
-
1 779322 rs4040617 A G 0.0326393 . . .
|
|
7
|
-
1 780785 rs2977612 T A 0.0225965 . . .
|
|
8
|
-
1 785050 rs2905062 G A 0.0346572 . . .
|
|
9
|
-
1 785989 rs2980300 T C 0.00638744 . . .
|
|
10
|
-
1 798959 rs11240777 G A 0.49853 . . .
|
|
11
|
-
1 990380 . C A,G,T 0.136915 . . .
|
|
12
|
-
1 998501 rs3813193 G C 0.450384 . . .
|
|
13
|
-
1 1003629 rs4075116 C T 0.881074 . . .
|
|
14
|
-
1 1005806 rs3934834 C T 0.756218 . . .
|
|
15
|
-
1 1017170 rs3766193 C G 0.336111 . . .
|
|
16
|
-
1 1017197 rs3766192 C T 0.381743 . . .
|
|
17
|
-
1 1017587 rs3766191 C T 0.775467 . . .
|
|
18
|
-
1 1018562 rs9442371 C T 0.233364 . . .
|
|
19
|
-
1 1018704 rs9442372 A G 0.248721 . . .
|
|
20
|
-
1 1021346 rs10907177 A G 0.842846 . . .
|