@jbrowse/plugin-config 2.5.0 → 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/ConfigurationEditorWidget/components/BooleanEditor.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/ColorEditor.d.ts +3 -2
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js +0 -1
- package/dist/ConfigurationEditorWidget/components/JsonEditor.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/NumberEditor.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/NumberEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/SlotEditor.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js +0 -1
- package/dist/ConfigurationEditorWidget/components/TypeSelector.d.ts +1 -1
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js +0 -1
- package/dist/ConfigurationEditorWidget/index.d.ts +2 -1
- package/dist/ConfigurationEditorWidget/index.js +0 -1
- package/dist/ConfigurationEditorWidget/model.js +0 -1
- package/dist/FromConfigAdapter/FromConfigAdapter.js +0 -1
- package/dist/FromConfigAdapter/configSchema.js +0 -1
- package/dist/FromConfigAdapter/index.js +0 -1
- package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +0 -1
- package/dist/FromConfigRegionsAdapter/configSchema.js +0 -1
- package/dist/FromConfigRegionsAdapter/index.js +0 -1
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +0 -1
- package/dist/FromConfigSequenceAdapter/configSchema.js +0 -1
- package/dist/FromConfigSequenceAdapter/index.js +0 -1
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js +0 -1
- package/dist/RefNameAliasAdapter/configSchema.js +0 -1
- package/dist/RefNameAliasAdapter/index.js +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -1
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/ColorEditor.d.ts +3 -2
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.js +0 -1
- package/esm/ConfigurationEditorWidget/components/JsonEditor.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/NumberEditor.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/NumberEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/SlotEditor.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js +0 -1
- package/esm/ConfigurationEditorWidget/components/TypeSelector.d.ts +1 -1
- package/esm/ConfigurationEditorWidget/components/TypeSelector.js +0 -1
- package/esm/ConfigurationEditorWidget/index.d.ts +2 -1
- package/esm/ConfigurationEditorWidget/index.js +0 -1
- package/esm/ConfigurationEditorWidget/model.js +0 -1
- package/esm/FromConfigAdapter/FromConfigAdapter.js +0 -1
- package/esm/FromConfigAdapter/configSchema.js +0 -1
- package/esm/FromConfigAdapter/index.js +0 -1
- package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js +0 -1
- package/esm/FromConfigRegionsAdapter/configSchema.js +0 -1
- package/esm/FromConfigRegionsAdapter/index.js +0 -1
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js +0 -1
- package/esm/FromConfigSequenceAdapter/configSchema.js +0 -1
- package/esm/FromConfigSequenceAdapter/index.js +0 -1
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js +0 -1
- package/esm/RefNameAliasAdapter/configSchema.js +0 -1
- package/esm/RefNameAliasAdapter/index.js +0 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +0 -1
- package/package.json +3 -4
- package/dist/ConfigurationEditorWidget/components/BooleanEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/CallbackEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/ColorEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/ConfigurationTextField.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/JsonEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/NumberEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/NumberMapEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/SlotEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/StringArrayMapEditor.js.map +0 -1
- package/dist/ConfigurationEditorWidget/components/TypeSelector.js.map +0 -1
- package/dist/ConfigurationEditorWidget/index.js.map +0 -1
- package/dist/ConfigurationEditorWidget/model.js.map +0 -1
- package/dist/FromConfigAdapter/FromConfigAdapter.js.map +0 -1
- package/dist/FromConfigAdapter/configSchema.js.map +0 -1
- package/dist/FromConfigAdapter/index.js.map +0 -1
- package/dist/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js.map +0 -1
- package/dist/FromConfigRegionsAdapter/configSchema.js.map +0 -1
- package/dist/FromConfigRegionsAdapter/index.js.map +0 -1
- package/dist/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js.map +0 -1
- package/dist/FromConfigSequenceAdapter/configSchema.js.map +0 -1
- package/dist/FromConfigSequenceAdapter/index.js.map +0 -1
- package/dist/RefNameAliasAdapter/RefNameAliasAdapter.js.map +0 -1
- package/dist/RefNameAliasAdapter/configSchema.js.map +0 -1
- package/dist/RefNameAliasAdapter/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/BooleanEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/CallbackEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/ColorEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/ConfigurationTextField.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/JsonEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/NumberEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/NumberMapEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/SlotEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/StringArrayMapEditor.js.map +0 -1
- package/esm/ConfigurationEditorWidget/components/TypeSelector.js.map +0 -1
- package/esm/ConfigurationEditorWidget/index.js.map +0 -1
- package/esm/ConfigurationEditorWidget/model.js.map +0 -1
- package/esm/FromConfigAdapter/FromConfigAdapter.js.map +0 -1
- package/esm/FromConfigAdapter/configSchema.js.map +0 -1
- package/esm/FromConfigAdapter/index.js.map +0 -1
- package/esm/FromConfigRegionsAdapter/FromConfigRegionsAdapter.js.map +0 -1
- package/esm/FromConfigRegionsAdapter/configSchema.js.map +0 -1
- package/esm/FromConfigRegionsAdapter/index.js.map +0 -1
- package/esm/FromConfigSequenceAdapter/FromConfigSequenceAdapter.js.map +0 -1
- package/esm/FromConfigSequenceAdapter/configSchema.js.map +0 -1
- package/esm/FromConfigSequenceAdapter/index.js.map +0 -1
- package/esm/RefNameAliasAdapter/RefNameAliasAdapter.js.map +0 -1
- package/esm/RefNameAliasAdapter/configSchema.js.map +0 -1
- package/esm/RefNameAliasAdapter/index.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/src/ConfigurationEditorWidget/components/BooleanEditor.tsx +0 -35
- package/src/ConfigurationEditorWidget/components/CallbackEditor.tsx +0 -126
- package/src/ConfigurationEditorWidget/components/ColorEditor.test.tsx +0 -14
- package/src/ConfigurationEditorWidget/components/ColorEditor.tsx +0 -59
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.test.tsx +0 -95
- package/src/ConfigurationEditorWidget/components/ConfigurationEditor.tsx +0 -167
- package/src/ConfigurationEditorWidget/components/ConfigurationTextField.tsx +0 -22
- package/src/ConfigurationEditorWidget/components/JsonEditor.tsx +0 -84
- package/src/ConfigurationEditorWidget/components/NumberEditor.tsx +0 -34
- package/src/ConfigurationEditorWidget/components/NumberMapEditor.tsx +0 -94
- package/src/ConfigurationEditorWidget/components/SlotEditor.tsx +0 -236
- package/src/ConfigurationEditorWidget/components/StringArrayEditor.tsx +0 -112
- package/src/ConfigurationEditorWidget/components/StringArrayMapEditor.tsx +0 -104
- package/src/ConfigurationEditorWidget/components/TypeSelector.tsx +0 -43
- package/src/ConfigurationEditorWidget/components/__snapshots__/ConfigurationEditor.test.tsx.snap +0 -2079
- package/src/ConfigurationEditorWidget/index.tsx +0 -25
- package/src/ConfigurationEditorWidget/model.ts +0 -21
- package/src/FromConfigAdapter/FromConfigAdapter.test.ts +0 -56
- package/src/FromConfigAdapter/FromConfigAdapter.ts +0 -90
- package/src/FromConfigAdapter/configSchema.ts +0 -22
- package/src/FromConfigAdapter/index.ts +0 -18
- package/src/FromConfigAdapter/test_data/volvox.2bit +0 -0
- package/src/FromConfigRegionsAdapter/FromConfigRegionsAdapter.test.ts +0 -58
- package/src/FromConfigRegionsAdapter/FromConfigRegionsAdapter.ts +0 -81
- package/src/FromConfigRegionsAdapter/configSchema.ts +0 -24
- package/src/FromConfigRegionsAdapter/index.ts +0 -18
- package/src/FromConfigSequenceAdapter/FromConfigSequenceAdapter.test.ts +0 -64
- package/src/FromConfigSequenceAdapter/FromConfigSequenceAdapter.ts +0 -86
- package/src/FromConfigSequenceAdapter/configSchema.ts +0 -21
- package/src/FromConfigSequenceAdapter/index.ts +0 -19
- package/src/RefNameAliasAdapter/RefNameAliasAdapter.test.ts +0 -18
- package/src/RefNameAliasAdapter/RefNameAliasAdapter.ts +0 -30
- package/src/RefNameAliasAdapter/configSchema.ts +0 -36
- package/src/RefNameAliasAdapter/index.ts +0 -19
- package/src/RefNameAliasAdapter/test_data/simple_alias.txt +0 -2
- package/src/__snapshots__/index.test.ts.snap +0 -10
- package/src/index.test.ts +0 -38
- package/src/index.ts +0 -42
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { observer } from 'mobx-react'
|
|
3
|
-
import { isStateTreeNode, getType } from 'mobx-state-tree'
|
|
4
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
5
|
-
|
|
6
|
-
export { default as stateModelFactory } from './model'
|
|
7
|
-
export const configSchema = ConfigurationSchema('ConfigurationEditorWidget', {})
|
|
8
|
-
export const HeadingComponent = observer(
|
|
9
|
-
({ model }: { model?: { target: { type: string } } }) => {
|
|
10
|
-
if (model?.target) {
|
|
11
|
-
if (model.target.type) {
|
|
12
|
-
return <>{`${model.target.type} settings`}</>
|
|
13
|
-
}
|
|
14
|
-
if (isStateTreeNode(model.target)) {
|
|
15
|
-
const type = getType(model.target)
|
|
16
|
-
if (type?.name) {
|
|
17
|
-
return (
|
|
18
|
-
<>{`${type.name.replace('ConfigurationSchema', '')} settings`}</>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return <>Settings</>
|
|
24
|
-
},
|
|
25
|
-
)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { types } from 'mobx-state-tree'
|
|
2
|
-
import { ElementId } from '@jbrowse/core/util/types/mst'
|
|
3
|
-
import PluginManager from '@jbrowse/core/PluginManager'
|
|
4
|
-
|
|
5
|
-
export default (pluginManager: PluginManager) =>
|
|
6
|
-
types
|
|
7
|
-
.model('ConfigurationEditorWidget', {
|
|
8
|
-
id: ElementId,
|
|
9
|
-
type: types.literal('ConfigurationEditorWidget'),
|
|
10
|
-
// If you add different types of targets, don't forget to account for that
|
|
11
|
-
// in the key of ./components/ConfigurationEditor.js
|
|
12
|
-
target: types.safeReference(
|
|
13
|
-
pluginManager.pluggableConfigSchemaType('track'),
|
|
14
|
-
),
|
|
15
|
-
})
|
|
16
|
-
.actions(self => ({
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
-
setTarget(newTarget: any) {
|
|
19
|
-
self.target = newTarget
|
|
20
|
-
},
|
|
21
|
-
}))
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { toArray } from 'rxjs/operators'
|
|
2
|
-
import { firstValueFrom } from 'rxjs'
|
|
3
|
-
import Adapter from './FromConfigAdapter'
|
|
4
|
-
import configSchema from './configSchema'
|
|
5
|
-
|
|
6
|
-
test('adapter can fetch features', async () => {
|
|
7
|
-
const features = [
|
|
8
|
-
{ uniqueId: 'one', refName: 'ctgA', start: 20, end: 40 },
|
|
9
|
-
{ uniqueId: 'two', refName: 'ctgB', start: 50, end: 60 },
|
|
10
|
-
]
|
|
11
|
-
const adapter = new Adapter(configSchema.create({ features }))
|
|
12
|
-
const result = adapter.getFeatures({
|
|
13
|
-
refName: 'ctgA',
|
|
14
|
-
start: 0,
|
|
15
|
-
end: 20000,
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
const featuresArray = await firstValueFrom(result.pipe(toArray()))
|
|
19
|
-
expect(featuresArray.length).toBe(1)
|
|
20
|
-
expect(featuresArray[0].toJSON()).toEqual(features[0])
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
test('adapter can fetch features with subfeatures', async () => {
|
|
24
|
-
const features = [
|
|
25
|
-
{
|
|
26
|
-
refName: 'ctgA',
|
|
27
|
-
uniqueId: 'feat1',
|
|
28
|
-
start: 200,
|
|
29
|
-
end: 750,
|
|
30
|
-
name: 'Feature1',
|
|
31
|
-
subfeatures: [
|
|
32
|
-
{
|
|
33
|
-
uniqueId: 'feat2',
|
|
34
|
-
start: 225,
|
|
35
|
-
end: 300,
|
|
36
|
-
name: 'Feature2',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
uniqueId: 'feat3',
|
|
40
|
-
start: 400,
|
|
41
|
-
end: 600,
|
|
42
|
-
name: 'Feature3',
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
]
|
|
47
|
-
const adapter = new Adapter(configSchema.create({ features }))
|
|
48
|
-
const result = adapter.getFeatures({
|
|
49
|
-
refName: 'ctgA',
|
|
50
|
-
start: 0,
|
|
51
|
-
end: 20000,
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
const featuresArray = await firstValueFrom(result.pipe(toArray()))
|
|
55
|
-
expect(featuresArray.length).toBe(1)
|
|
56
|
-
})
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { BaseFeatureDataAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
2
|
-
import SimpleFeature, {
|
|
3
|
-
Feature,
|
|
4
|
-
SimpleFeatureSerialized,
|
|
5
|
-
} from '@jbrowse/core/util/simpleFeature'
|
|
6
|
-
import { ObservableCreate } from '@jbrowse/core/util/rxjs'
|
|
7
|
-
import { NoAssemblyRegion } from '@jbrowse/core/util/types'
|
|
8
|
-
import {
|
|
9
|
-
AnyConfigurationModel,
|
|
10
|
-
readConfObject,
|
|
11
|
-
} from '@jbrowse/core/configuration'
|
|
12
|
-
import PluginManager from '@jbrowse/core/PluginManager'
|
|
13
|
-
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache'
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Adapter that just returns the features defined in its `features` configuration
|
|
17
|
-
* key, like:
|
|
18
|
-
* `"features": [ { "refName": "ctgA", "start":1, "end":20 }, ... ]`
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
export default class FromConfigAdapter extends BaseFeatureDataAdapter {
|
|
22
|
-
protected features: Map<string, Feature[]>
|
|
23
|
-
|
|
24
|
-
constructor(
|
|
25
|
-
conf: AnyConfigurationModel,
|
|
26
|
-
getSubAdapter?: getSubAdapterType,
|
|
27
|
-
pluginManager?: PluginManager,
|
|
28
|
-
) {
|
|
29
|
-
super(conf, getSubAdapter, pluginManager)
|
|
30
|
-
const feats = readConfObject(conf, 'features') as SimpleFeatureSerialized[]
|
|
31
|
-
this.features = FromConfigAdapter.makeFeatures(feats || [])
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static makeFeatures(fdata: SimpleFeatureSerialized[]) {
|
|
35
|
-
const features = new Map<string, Feature[]>()
|
|
36
|
-
for (let i = 0; i < fdata.length; i += 1) {
|
|
37
|
-
if (fdata[i]) {
|
|
38
|
-
const f = this.makeFeature(fdata[i])
|
|
39
|
-
const refName = f.get('refName') as string
|
|
40
|
-
let bucket = features.get(refName)
|
|
41
|
-
if (!bucket) {
|
|
42
|
-
bucket = []
|
|
43
|
-
features.set(refName, bucket)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
bucket.push(f)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// sort the features on each reference sequence by start coordinate
|
|
51
|
-
for (const refFeatures of features.values()) {
|
|
52
|
-
refFeatures.sort((a, b) => a.get('start') - b.get('start'))
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return features
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
static makeFeature(data: SimpleFeatureSerialized) {
|
|
59
|
-
return new SimpleFeature(data)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async getRefNames() {
|
|
63
|
-
return [...this.features.keys()]
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async getRefNameAliases() {
|
|
67
|
-
return [...this.features.values()].map(featureArray => ({
|
|
68
|
-
refName: featureArray[0].get('refName'),
|
|
69
|
-
aliases: featureArray[0].get('aliases'),
|
|
70
|
-
}))
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
getFeatures(region: NoAssemblyRegion) {
|
|
74
|
-
const { refName, start, end } = region
|
|
75
|
-
|
|
76
|
-
return ObservableCreate<Feature>(async observer => {
|
|
77
|
-
const features = this.features.get(refName) || []
|
|
78
|
-
for (let i = 0; i < features.length; i++) {
|
|
79
|
-
const f = features[i]
|
|
80
|
-
|
|
81
|
-
if (f.get('end') > start && f.get('start') < end) {
|
|
82
|
-
observer.next(f)
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
observer.complete()
|
|
86
|
-
})
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
freeResources(/* { region } */): void {}
|
|
90
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* #config FromConfigAdapter
|
|
5
|
-
*/
|
|
6
|
-
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7
|
-
|
|
8
|
-
const configSchema = ConfigurationSchema(
|
|
9
|
-
'FromConfigAdapter',
|
|
10
|
-
{
|
|
11
|
-
/**
|
|
12
|
-
* #slot
|
|
13
|
-
*/
|
|
14
|
-
features: {
|
|
15
|
-
type: 'frozen',
|
|
16
|
-
defaultValue: [],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{ explicitlyTyped: true, implicitIdentifier: 'adapterId' },
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
export default configSchema
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AdapterType } from '@jbrowse/core/pluggableElementTypes'
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager'
|
|
3
|
-
import configSchema from './configSchema'
|
|
4
|
-
|
|
5
|
-
export default (pluginManager: PluginManager) => {
|
|
6
|
-
pluginManager.addAdapterType(
|
|
7
|
-
() =>
|
|
8
|
-
new AdapterType({
|
|
9
|
-
name: 'FromConfigAdapter',
|
|
10
|
-
configSchema,
|
|
11
|
-
getAdapterClass: () =>
|
|
12
|
-
import('./FromConfigAdapter').then(r => r.default),
|
|
13
|
-
adapterMetadata: {
|
|
14
|
-
hiddenFromGUI: true,
|
|
15
|
-
},
|
|
16
|
-
}),
|
|
17
|
-
)
|
|
18
|
-
}
|
|
Binary file
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import Adapter from './FromConfigRegionsAdapter'
|
|
2
|
-
import regionsConfigSchema from './configSchema'
|
|
3
|
-
|
|
4
|
-
test('adapter can fetch regions 1', async () => {
|
|
5
|
-
const features = [
|
|
6
|
-
{ uniqueId: 'one', refName: 'ctgA', start: 250, end: 400 },
|
|
7
|
-
{ uniqueId: 'two', refName: 'ctgA', start: 150, end: 300 },
|
|
8
|
-
{ uniqueId: 'three', refName: 'ctgB', start: 50, end: 60 },
|
|
9
|
-
]
|
|
10
|
-
const adapter = new Adapter(regionsConfigSchema.create({ features }))
|
|
11
|
-
const result = await adapter.getRegions()
|
|
12
|
-
expect(result).toEqual([
|
|
13
|
-
{ refName: 'ctgA', start: 150, end: 400 },
|
|
14
|
-
{ refName: 'ctgB', start: 50, end: 60 },
|
|
15
|
-
])
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
test('adapter can fetch regions 2', async () => {
|
|
19
|
-
const features = [
|
|
20
|
-
{ uniqueId: 'three', refName: 'ctgB', start: 50, end: 60 },
|
|
21
|
-
{ uniqueId: 'two', refName: 'ctgA', start: 150, end: 300 },
|
|
22
|
-
{ uniqueId: 'one', refName: 'ctgA', start: 250, end: 400 },
|
|
23
|
-
]
|
|
24
|
-
const adapter = new Adapter(regionsConfigSchema.create({ features }))
|
|
25
|
-
const result = await adapter.getRegions()
|
|
26
|
-
expect(result).toEqual([
|
|
27
|
-
{ refName: 'ctgA', start: 150, end: 400 },
|
|
28
|
-
{ refName: 'ctgB', start: 50, end: 60 },
|
|
29
|
-
])
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
test('adapter can fetch regions 3', async () => {
|
|
33
|
-
const features = [
|
|
34
|
-
{ uniqueId: 'two', refName: 'ctgA', start: 150, end: 300 },
|
|
35
|
-
{ uniqueId: 'one', refName: 'ctgA', start: 250, end: 400 },
|
|
36
|
-
{ uniqueId: 'three', refName: 'ctgB', start: 50, end: 60 },
|
|
37
|
-
]
|
|
38
|
-
const adapter = new Adapter(regionsConfigSchema.create({ features }))
|
|
39
|
-
const result = await adapter.getRegions()
|
|
40
|
-
expect(result).toEqual([
|
|
41
|
-
{ refName: 'ctgA', start: 150, end: 400 },
|
|
42
|
-
{ refName: 'ctgB', start: 50, end: 60 },
|
|
43
|
-
])
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
test('adapter can fetch regions 4', async () => {
|
|
47
|
-
const features = [
|
|
48
|
-
{ uniqueId: 'two', refName: 'ctgA', start: 150, end: 300 },
|
|
49
|
-
{ uniqueId: 'onePrime', refName: 'ctgA', start: 300, end: 400 },
|
|
50
|
-
{ uniqueId: 'three', refName: 'ctgB', start: 50, end: 60 },
|
|
51
|
-
]
|
|
52
|
-
const adapter = new Adapter(regionsConfigSchema.create({ features }))
|
|
53
|
-
const result = await adapter.getRegions()
|
|
54
|
-
expect(result).toEqual([
|
|
55
|
-
{ refName: 'ctgA', start: 150, end: 400 },
|
|
56
|
-
{ refName: 'ctgB', start: 50, end: 60 },
|
|
57
|
-
])
|
|
58
|
-
})
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BaseAdapter,
|
|
3
|
-
RegionsAdapter,
|
|
4
|
-
} from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
5
|
-
import {
|
|
6
|
-
Feature,
|
|
7
|
-
SimpleFeatureSerialized,
|
|
8
|
-
} from '@jbrowse/core/util/simpleFeature'
|
|
9
|
-
import {
|
|
10
|
-
AnyConfigurationModel,
|
|
11
|
-
readConfObject,
|
|
12
|
-
} from '@jbrowse/core/configuration'
|
|
13
|
-
import PluginManager from '@jbrowse/core/PluginManager'
|
|
14
|
-
import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache'
|
|
15
|
-
|
|
16
|
-
import FromConfigAdapter from '../FromConfigAdapter/FromConfigAdapter'
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Adapter that just returns the features defined in its `features` configuration
|
|
20
|
-
* key, like:
|
|
21
|
-
* `"features": [ { "refName": "ctgA", "start":1, "end":20 }, ... ]`
|
|
22
|
-
*/
|
|
23
|
-
export default class FromConfigRegionsAdapter
|
|
24
|
-
extends BaseAdapter
|
|
25
|
-
implements RegionsAdapter
|
|
26
|
-
{
|
|
27
|
-
private features: Map<string, Feature[]>
|
|
28
|
-
|
|
29
|
-
constructor(
|
|
30
|
-
config: AnyConfigurationModel,
|
|
31
|
-
getSubAdapter?: getSubAdapterType,
|
|
32
|
-
pluginManager?: PluginManager,
|
|
33
|
-
) {
|
|
34
|
-
super(config, getSubAdapter, pluginManager)
|
|
35
|
-
const features = readConfObject(
|
|
36
|
-
config,
|
|
37
|
-
'features',
|
|
38
|
-
) as SimpleFeatureSerialized[]
|
|
39
|
-
this.features = FromConfigAdapter.makeFeatures(features || [])
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Get refName, start, and end for all features after collapsing any overlaps
|
|
44
|
-
*/
|
|
45
|
-
async getRegions() {
|
|
46
|
-
const regions = []
|
|
47
|
-
|
|
48
|
-
// recall: features are stored in this object sorted by start coordinate
|
|
49
|
-
for (const [refName, features] of this.features) {
|
|
50
|
-
let currentRegion
|
|
51
|
-
for (const feature of features) {
|
|
52
|
-
if (
|
|
53
|
-
currentRegion &&
|
|
54
|
-
currentRegion.end >= feature.get('start') &&
|
|
55
|
-
currentRegion.start <= feature.get('end')
|
|
56
|
-
) {
|
|
57
|
-
currentRegion.end = feature.get('end')
|
|
58
|
-
} else {
|
|
59
|
-
if (currentRegion) {
|
|
60
|
-
regions.push(currentRegion)
|
|
61
|
-
}
|
|
62
|
-
currentRegion = {
|
|
63
|
-
refName,
|
|
64
|
-
start: feature.get('start'),
|
|
65
|
-
end: feature.get('end'),
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (currentRegion) {
|
|
70
|
-
regions.push(currentRegion)
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// sort the regions by refName
|
|
75
|
-
regions.sort((a, b) => a.refName.localeCompare(b.refName))
|
|
76
|
-
|
|
77
|
-
return regions
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
freeResources(/* { region } */): void {}
|
|
81
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
2
|
-
/**
|
|
3
|
-
* #config FromConfigRegionsAdapter
|
|
4
|
-
* used for specifying refNames+sizes of an assembly
|
|
5
|
-
*/
|
|
6
|
-
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7
|
-
|
|
8
|
-
const regionsConfigSchema = ConfigurationSchema(
|
|
9
|
-
'FromConfigRegionsAdapter',
|
|
10
|
-
{
|
|
11
|
-
/**
|
|
12
|
-
* #slot
|
|
13
|
-
*/
|
|
14
|
-
features: {
|
|
15
|
-
type: 'frozen',
|
|
16
|
-
defaultValue: [],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
explicitlyTyped: true,
|
|
21
|
-
implicitIdentifier: 'adapterId',
|
|
22
|
-
},
|
|
23
|
-
)
|
|
24
|
-
export default regionsConfigSchema
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AdapterType } from '@jbrowse/core/pluggableElementTypes'
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager'
|
|
3
|
-
import configSchema from './configSchema'
|
|
4
|
-
|
|
5
|
-
export default (pluginManager: PluginManager) => {
|
|
6
|
-
pluginManager.addAdapterType(
|
|
7
|
-
() =>
|
|
8
|
-
new AdapterType({
|
|
9
|
-
name: 'FromConfigRegionsAdapter',
|
|
10
|
-
configSchema,
|
|
11
|
-
getAdapterClass: () =>
|
|
12
|
-
import('./FromConfigRegionsAdapter').then(r => r.default),
|
|
13
|
-
adapterMetadata: {
|
|
14
|
-
hiddenFromGUI: true,
|
|
15
|
-
},
|
|
16
|
-
}),
|
|
17
|
-
)
|
|
18
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { toArray } from 'rxjs/operators'
|
|
2
|
-
import { firstValueFrom } from 'rxjs'
|
|
3
|
-
import Adapter from './FromConfigSequenceAdapter'
|
|
4
|
-
import sequenceConfigSchema from './configSchema'
|
|
5
|
-
|
|
6
|
-
test('adapter can fetch sequences when there is just one feature representing whole refseq', async () => {
|
|
7
|
-
const features = [
|
|
8
|
-
{
|
|
9
|
-
uniqueId: 'one',
|
|
10
|
-
refName: 'ctgA',
|
|
11
|
-
start: 0,
|
|
12
|
-
end: 150,
|
|
13
|
-
seq: 'ccaaaccgtcaattaaccggtatcttctcggaaacggcggttctctcctagatagcgatctgtggtctcaccatgcaatttaaacaggtgagtaaagattgctacaaatacgagactagctgtcaccagatgctgttcatctgttggctc',
|
|
14
|
-
},
|
|
15
|
-
]
|
|
16
|
-
const adapter = new Adapter(sequenceConfigSchema.create({ features }))
|
|
17
|
-
const result = adapter.getFeatures({
|
|
18
|
-
refName: 'ctgA',
|
|
19
|
-
start: 0,
|
|
20
|
-
end: 50,
|
|
21
|
-
})
|
|
22
|
-
const featuresArray = await firstValueFrom(result.pipe(toArray()))
|
|
23
|
-
expect(featuresArray.length).toBe(1)
|
|
24
|
-
expect(featuresArray[0].get('seq')).toBe(features[0].seq.slice(0, 50))
|
|
25
|
-
|
|
26
|
-
const result2 = adapter.getFeatures({
|
|
27
|
-
refName: 'ctgA',
|
|
28
|
-
start: 100,
|
|
29
|
-
end: 150,
|
|
30
|
-
})
|
|
31
|
-
const featuresArray2 = await firstValueFrom(result2.pipe(toArray()))
|
|
32
|
-
expect(featuresArray2.length).toBe(1)
|
|
33
|
-
expect(featuresArray2[0].get('seq')).toBe(features[0].seq.slice(100, 150))
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
test("adapter can fetch sequences when the config's sequence doesn't start at 0", async () => {
|
|
37
|
-
const features = [
|
|
38
|
-
{
|
|
39
|
-
uniqueId: 'one',
|
|
40
|
-
refName: 'ctgA',
|
|
41
|
-
start: 5000,
|
|
42
|
-
end: 5150,
|
|
43
|
-
seq: 'ccaaaccgtcaattaaccggtatcttctcggaaacggcggttctctcctagatagcgatctgtggtctcaccatgcaatttaaacaggtgagtaaagattgctacaaatacgagactagctgtcaccagatgctgttcatctgttggctc',
|
|
44
|
-
},
|
|
45
|
-
]
|
|
46
|
-
const adapter = new Adapter(sequenceConfigSchema.create({ features }))
|
|
47
|
-
const result = adapter.getFeatures({
|
|
48
|
-
refName: 'ctgA',
|
|
49
|
-
start: 4950,
|
|
50
|
-
end: 5050,
|
|
51
|
-
})
|
|
52
|
-
const featuresArray = await firstValueFrom(result.pipe(toArray()))
|
|
53
|
-
expect(featuresArray.length).toBe(1)
|
|
54
|
-
expect(featuresArray[0].get('seq')).toBe(features[0].seq.slice(0, 50))
|
|
55
|
-
|
|
56
|
-
const result2 = adapter.getFeatures({
|
|
57
|
-
refName: 'ctgA',
|
|
58
|
-
start: 5050,
|
|
59
|
-
end: 5150,
|
|
60
|
-
})
|
|
61
|
-
const featuresArray2 = await firstValueFrom(result2.pipe(toArray()))
|
|
62
|
-
expect(featuresArray2.length).toBe(1)
|
|
63
|
-
expect(featuresArray2[0].get('seq')).toBe(features[0].seq.slice(50, 150))
|
|
64
|
-
})
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import SimpleFeature, { Feature } from '@jbrowse/core/util/simpleFeature'
|
|
2
|
-
import { ObservableCreate } from '@jbrowse/core/util/rxjs'
|
|
3
|
-
import { NoAssemblyRegion } from '@jbrowse/core/util/types'
|
|
4
|
-
import { toArray } from 'rxjs/operators'
|
|
5
|
-
import { RegionsAdapter } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
6
|
-
|
|
7
|
-
// locals
|
|
8
|
-
import FromConfigAdapter from '../FromConfigAdapter/FromConfigAdapter'
|
|
9
|
-
import { firstValueFrom } from 'rxjs'
|
|
10
|
-
|
|
11
|
-
export default class FromConfigSequenceAdapter
|
|
12
|
-
extends FromConfigAdapter
|
|
13
|
-
implements RegionsAdapter
|
|
14
|
-
{
|
|
15
|
-
/**
|
|
16
|
-
* Fetch features for a certain region
|
|
17
|
-
* @param region - Region
|
|
18
|
-
* @returns Observable of Feature objects in the region
|
|
19
|
-
*/
|
|
20
|
-
getFeatures(region: NoAssemblyRegion) {
|
|
21
|
-
return ObservableCreate<Feature>(async observer => {
|
|
22
|
-
const feats = await firstValueFrom(
|
|
23
|
-
super.getFeatures(region).pipe(toArray()),
|
|
24
|
-
)
|
|
25
|
-
const feat = feats[0]
|
|
26
|
-
observer.next(
|
|
27
|
-
new SimpleFeature({
|
|
28
|
-
...feat.toJSON(),
|
|
29
|
-
uniqueId: `${feat.id()}:${region.start}-${region.end}`,
|
|
30
|
-
end: region.end,
|
|
31
|
-
start: region.start,
|
|
32
|
-
seq: feat
|
|
33
|
-
.get('seq')
|
|
34
|
-
.slice(
|
|
35
|
-
Math.max(region.start - feat.get('start'), 0),
|
|
36
|
-
Math.max(region.end - feat.get('start'), 0),
|
|
37
|
-
),
|
|
38
|
-
}),
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
observer.complete()
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Get refName, start, and end for all features after collapsing any overlaps
|
|
47
|
-
*/
|
|
48
|
-
async getRegions() {
|
|
49
|
-
const regions = []
|
|
50
|
-
|
|
51
|
-
// recall: features are stored in this object sorted by start coordinate
|
|
52
|
-
for (const [refName, features] of this.features) {
|
|
53
|
-
let currentRegion
|
|
54
|
-
for (const feature of features) {
|
|
55
|
-
if (
|
|
56
|
-
currentRegion &&
|
|
57
|
-
currentRegion.end >= feature.get('start') &&
|
|
58
|
-
currentRegion.start <= feature.get('end')
|
|
59
|
-
) {
|
|
60
|
-
currentRegion.end = feature.get('end')
|
|
61
|
-
} else {
|
|
62
|
-
if (currentRegion) {
|
|
63
|
-
regions.push(currentRegion)
|
|
64
|
-
}
|
|
65
|
-
currentRegion = {
|
|
66
|
-
refName,
|
|
67
|
-
start: feature.get('start'),
|
|
68
|
-
end: feature.get('end'),
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
if (currentRegion) {
|
|
73
|
-
regions.push(currentRegion)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return regions
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* called to provide a hint that data tied to a certain region
|
|
82
|
-
* will not be needed for the foreseeable future and can be purged
|
|
83
|
-
* from caches, etc
|
|
84
|
-
*/
|
|
85
|
-
freeResources(/* { region } */): void {}
|
|
86
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
2
|
-
/**
|
|
3
|
-
* #config FromConfigSequenceAdapter
|
|
4
|
-
*/
|
|
5
|
-
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
6
|
-
|
|
7
|
-
const sequenceConfigSchema = ConfigurationSchema(
|
|
8
|
-
'FromConfigSequenceAdapter',
|
|
9
|
-
{
|
|
10
|
-
/**
|
|
11
|
-
* #slot
|
|
12
|
-
*/
|
|
13
|
-
features: {
|
|
14
|
-
type: 'frozen',
|
|
15
|
-
defaultValue: [],
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
{ explicitlyTyped: true, implicitIdentifier: 'adapterId' },
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
export default sequenceConfigSchema
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AdapterType } from '@jbrowse/core/pluggableElementTypes'
|
|
2
|
-
import PluginManager from '@jbrowse/core/PluginManager'
|
|
3
|
-
|
|
4
|
-
import configSchema from './configSchema'
|
|
5
|
-
|
|
6
|
-
export default (pluginManager: PluginManager) => {
|
|
7
|
-
pluginManager.addAdapterType(
|
|
8
|
-
() =>
|
|
9
|
-
new AdapterType({
|
|
10
|
-
name: 'FromConfigSequenceAdapter',
|
|
11
|
-
configSchema,
|
|
12
|
-
getAdapterClass: () =>
|
|
13
|
-
import('./FromConfigSequenceAdapter').then(r => r.default),
|
|
14
|
-
adapterMetadata: {
|
|
15
|
-
hiddenFromGUI: true,
|
|
16
|
-
},
|
|
17
|
-
}),
|
|
18
|
-
)
|
|
19
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import Adapter from './RefNameAliasAdapter'
|
|
2
|
-
import configSchema from './configSchema'
|
|
3
|
-
|
|
4
|
-
test('adapter can fetch a simple alias file', async () => {
|
|
5
|
-
const adapter = new Adapter(
|
|
6
|
-
configSchema.create({
|
|
7
|
-
location: {
|
|
8
|
-
localPath: require.resolve('./test_data/simple_alias.txt'),
|
|
9
|
-
locationType: 'LocalPathLocation',
|
|
10
|
-
},
|
|
11
|
-
}),
|
|
12
|
-
)
|
|
13
|
-
const result = await adapter.getRefNameAliases()
|
|
14
|
-
expect(result[0].refName).toBe('chr1')
|
|
15
|
-
expect(result[0].aliases).toEqual(['1', 'NC_000001.10'])
|
|
16
|
-
expect(result[1].refName).toBe('chr2')
|
|
17
|
-
expect(result[1].aliases).toEqual(['2', 'NC_000002.11'])
|
|
18
|
-
})
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BaseRefNameAliasAdapter,
|
|
3
|
-
BaseAdapter,
|
|
4
|
-
} from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
5
|
-
import { openLocation } from '@jbrowse/core/util/io'
|
|
6
|
-
|
|
7
|
-
export default class RefNameAliasAdapter
|
|
8
|
-
extends BaseAdapter
|
|
9
|
-
implements BaseRefNameAliasAdapter
|
|
10
|
-
{
|
|
11
|
-
async getRefNameAliases() {
|
|
12
|
-
const loc = this.getConf('location')
|
|
13
|
-
if (loc.uri === '' || loc.uri === '/path/to/my/aliases.txt') {
|
|
14
|
-
return []
|
|
15
|
-
}
|
|
16
|
-
const results = await openLocation(loc, this.pluginManager).readFile('utf8')
|
|
17
|
-
const refColumn = this.getConf('refNameColumn')
|
|
18
|
-
return results
|
|
19
|
-
.trim()
|
|
20
|
-
.split(/\n|\r\n|\r/)
|
|
21
|
-
.filter(f => !!f && !f.startsWith('#'))
|
|
22
|
-
.map(row => {
|
|
23
|
-
const aliases = row.split('\t')
|
|
24
|
-
const [refName] = aliases.splice(refColumn, 1)
|
|
25
|
-
return { refName, aliases: aliases.filter(f => !!f.trim()) }
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async freeResources() {}
|
|
30
|
-
}
|