Skip to content

Commit c6b1ef4

Browse files
committed
Core
1 parent aed62af commit c6b1ef4

File tree

10 files changed

+137
-135
lines changed

10 files changed

+137
-135
lines changed

packages/text-indexing-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"prepack": "pnpm build"
3333
},
3434
"dependencies": {
35-
"node-fetch": "^2"
35+
"node-fetch": "^2.7.0"
3636
},
3737
"publishConfig": {
3838
"access": "public",

packages/text-indexing-core/src/util.ts

Lines changed: 9 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,14 @@ export interface UriLocation {
22
uri: string
33
locationType: 'UriLocation'
44
}
5+
56
export interface LocalPathLocation {
67
localPath: string
78
locationType: 'LocalPathLocation'
89
}
9-
export interface IndexedFastaAdapter {
10-
type: 'IndexedFastaAdapter'
11-
fastaLocation: UriLocation
12-
faiLocation: UriLocation
13-
}
14-
15-
export interface BgzipFastaAdapter {
16-
type: 'BgzipFastaAdapter'
17-
fastaLocation: UriLocation
18-
faiLocation: UriLocation
19-
gziLocation: UriLocation
20-
}
21-
22-
export interface TwoBitAdapter {
23-
type: 'TwoBitAdapter'
24-
twoBitLocation: UriLocation
25-
}
26-
27-
export interface ChromeSizesAdapter {
28-
type: 'ChromSizesAdapter'
29-
chromSizesLocation: UriLocation
30-
}
3110

32-
export interface CustomSequenceAdapter {
33-
type: string
34-
}
35-
36-
export interface RefNameAliasAdapter {
37-
type: 'RefNameAliasAdapter'
38-
location: UriLocation
39-
}
40-
41-
export interface CustomRefNameAliasAdapter {
42-
type: string
43-
}
44-
export interface Assembly {
45-
displayName?: string
46-
name: string
47-
aliases?: string[]
48-
sequence: Sequence
49-
refNameAliases?: {
50-
adapter: RefNameAliasAdapter | CustomRefNameAliasAdapter
51-
}
52-
refNameColors?: string[]
53-
}
54-
55-
export interface Sequence {
56-
type: 'ReferenceSequenceTrack'
57-
trackId: string
58-
adapter:
59-
| IndexedFastaAdapter
60-
| BgzipFastaAdapter
61-
| TwoBitAdapter
62-
| ChromeSizesAdapter
63-
| CustomSequenceAdapter
64-
}
6511
type Loc = UriLocation | LocalPathLocation
12+
6613
export interface Gff3TabixAdapter {
6714
type: 'Gff3TabixAdapter'
6815
gffGzLocation: Loc
@@ -72,6 +19,7 @@ export interface Gff3Adapter {
7219
type: 'Gff3Adapter'
7320
gffLocation: Loc
7421
}
22+
7523
export interface GtfAdapter {
7624
type: 'GtfAdapter'
7725
gtfLocation: Loc
@@ -81,46 +29,24 @@ export interface VcfTabixAdapter {
8129
type: 'VcfTabixAdapter'
8230
vcfGzLocation: Loc
8331
}
32+
8433
export interface VcfAdapter {
8534
type: 'VcfAdapter'
8635
vcfLocation: Loc
8736
}
8837

8938
export interface Track {
9039
adapter?: { type: string; [key: string]: unknown }
91-
textSearching?: TextSearching
40+
textSearching?: {
41+
indexingFeatureTypesToExclude?: string[]
42+
indexingAttributes?: string[]
43+
[key: string]: unknown
44+
}
9245
name: string
9346
assemblyNames: string[]
9447
trackId: string
9548
}
9649

97-
export interface TextSearching {
98-
indexingFeatureTypesToExclude?: string[]
99-
indexingAttributes?: string[]
100-
textSearchAdapter: TrixTextSearchAdapter
101-
}
102-
103-
export interface TrixTextSearchAdapter {
104-
type: string
105-
textSearchAdapterId: string
106-
ixFilePath: UriLocation | LocalPathLocation
107-
ixxFilePath: UriLocation | LocalPathLocation
108-
metaFilePath: UriLocation | LocalPathLocation
109-
assemblyNames: string[]
110-
}
111-
112-
export interface Config {
113-
assemblies?: Assembly[]
114-
assembly?: Assembly
115-
configuration?: Record<string, unknown>
116-
aggregateTextSearchAdapters?: TrixTextSearchAdapter[]
117-
connections?: unknown[]
118-
defaultSession?: Record<string, unknown>
119-
tracks?: Track[]
120-
}
121-
122-
export type indexType = 'aggregate' | 'perTrack'
123-
12450
export function decodeURIComponentNoThrow(uri: string) {
12551
try {
12652
return decodeURIComponent(uri)

packages/text-indexing/src/TextIndexing.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import {
1212
} from '@jbrowse/text-indexing-core'
1313
import { ixIxxStream } from 'ixixx'
1414

15-
import type { Track, indexType } from '@jbrowse/text-indexing-core'
15+
import type { indexType } from './util.ts'
16+
import type { Track } from '@jbrowse/text-indexing-core'
1617

1718
export async function indexTracks(args: {
1819
tracks: Track[]

packages/text-indexing/src/util.ts

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,97 @@ import path from 'path'
33
import { isSupportedIndexingAdapter } from '@jbrowse/core/util'
44
import sanitize from 'sanitize-filename'
55

6-
import type { Track } from '@jbrowse/text-indexing-core'
6+
import type {
7+
LocalPathLocation,
8+
Track,
9+
UriLocation,
10+
} from '@jbrowse/text-indexing-core'
11+
12+
export interface IndexedFastaAdapter {
13+
type: 'IndexedFastaAdapter'
14+
fastaLocation: UriLocation
15+
faiLocation: UriLocation
16+
}
17+
18+
export interface BgzipFastaAdapter {
19+
type: 'BgzipFastaAdapter'
20+
fastaLocation: UriLocation
21+
faiLocation: UriLocation
22+
gziLocation: UriLocation
23+
}
24+
25+
export interface TwoBitAdapter {
26+
type: 'TwoBitAdapter'
27+
twoBitLocation: UriLocation
28+
}
29+
30+
export interface ChromeSizesAdapter {
31+
type: 'ChromSizesAdapter'
32+
chromSizesLocation: UriLocation
33+
}
34+
35+
export interface CustomSequenceAdapter {
36+
type: string
37+
}
38+
39+
export interface RefNameAliasAdapter {
40+
type: 'RefNameAliasAdapter'
41+
location: UriLocation
42+
}
43+
44+
export interface CustomRefNameAliasAdapter {
45+
type: string
46+
}
47+
48+
export interface Assembly {
49+
displayName?: string
50+
name: string
51+
aliases?: string[]
52+
sequence: Sequence
53+
refNameAliases?: {
54+
adapter: RefNameAliasAdapter | CustomRefNameAliasAdapter
55+
}
56+
refNameColors?: string[]
57+
}
58+
59+
export interface Sequence {
60+
type: 'ReferenceSequenceTrack'
61+
trackId: string
62+
adapter:
63+
| IndexedFastaAdapter
64+
| BgzipFastaAdapter
65+
| TwoBitAdapter
66+
| ChromeSizesAdapter
67+
| CustomSequenceAdapter
68+
}
69+
70+
export interface TrixTextSearchAdapter {
71+
type: string
72+
textSearchAdapterId: string
73+
ixFilePath: UriLocation | LocalPathLocation
74+
ixxFilePath: UriLocation | LocalPathLocation
75+
metaFilePath: UriLocation | LocalPathLocation
76+
assemblyNames: string[]
77+
}
78+
79+
export interface TextSearching {
80+
indexingFeatureTypesToExclude?: string[]
81+
indexingAttributes?: string[]
82+
textSearchAdapter?: TrixTextSearchAdapter
83+
[key: string]: unknown
84+
}
85+
86+
export interface Config {
87+
assemblies?: Assembly[]
88+
assembly?: Assembly
89+
configuration?: Record<string, unknown>
90+
aggregateTextSearchAdapters?: TrixTextSearchAdapter[]
91+
connections?: unknown[]
92+
defaultSession?: Record<string, unknown>
93+
tracks?: Track[]
94+
}
95+
96+
export type indexType = 'aggregate' | 'perTrack'
797

898
export function createTextSearchConf(
999
name: string,

pnpm-lock.yaml

Lines changed: 13 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

products/jbrowse-cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"generate-readme": "./generate_readme.sh > README.md"
3737
},
3838
"dependencies": {
39-
"@jbrowse/text-indexing": "workspace:^",
4039
"@jbrowse/text-indexing-core": "workspace:^",
4140
"cli-progress": "^3.12.0",
4241
"command-exists": "^1.2.9",

products/jbrowse-cli/src/base.ts

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,22 @@
22
* By convention, exit codes in this base class are below 100
33
*/
44

5-
export interface UriLocation {
6-
uri: string
7-
locationType: 'UriLocation'
8-
}
9-
export interface LocalPathLocation {
10-
localPath: string
11-
locationType: 'LocalPathLocation'
12-
}
13-
14-
export interface Gff3TabixAdapter {
15-
type: 'Gff3TabixAdapter'
16-
gffGzLocation: UriLocation | LocalPathLocation
17-
}
18-
19-
export interface Gff3Adapter {
20-
type: 'Gff3Adapter'
21-
gffLocation: UriLocation | LocalPathLocation
22-
}
23-
export interface GtfAdapter {
24-
type: 'GtfAdapter'
25-
gtfLocation: UriLocation
26-
}
5+
export type {
6+
Gff3Adapter,
7+
Gff3TabixAdapter,
8+
GtfAdapter,
9+
LocalPathLocation,
10+
Track,
11+
UriLocation,
12+
VcfAdapter,
13+
VcfTabixAdapter,
14+
} from '@jbrowse/text-indexing-core'
2715

28-
export interface VcfTabixAdapter {
29-
type: 'VcfTabixAdapter'
30-
vcfGzLocation: UriLocation | LocalPathLocation
31-
}
32-
export interface VcfAdapter {
33-
type: 'VcfAdapter'
34-
vcfLocation: UriLocation | LocalPathLocation
35-
}
16+
import type {
17+
LocalPathLocation,
18+
Track,
19+
UriLocation,
20+
} from '@jbrowse/text-indexing-core'
3621

3722
export interface IndexedFastaAdapter {
3823
type: 'IndexedFastaAdapter'
@@ -100,17 +85,12 @@ export interface TrixTextSearchAdapter {
10085
metaFilePath: UriLocation | LocalPathLocation
10186
assemblyNames: string[]
10287
}
88+
10389
export interface TextSearching {
10490
indexingFeatureTypesToExclude?: string[]
10591
indexingAttributes?: string[]
106-
textSearchAdapter: TrixTextSearchAdapter
107-
}
108-
export interface Track {
109-
trackId: string
110-
name: string
111-
assemblyNames: string[]
112-
adapter?: { type: string; [key: string]: unknown }
113-
textSearching?: TextSearching
92+
textSearchAdapter?: TrixTextSearchAdapter
93+
[key: string]: unknown
11494
}
11595

11696
export interface Config {

products/jbrowse-cli/src/commands/text-index/indexing-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ixIxxStream } from 'ixixx'
1313
import { getAdapterLocation, getLoc } from './adapter-utils.ts'
1414
import { supported } from '../../types/common.ts'
1515

16-
import type { Track } from '../../base.ts'
16+
import type { Track } from '@jbrowse/text-indexing-core'
1717

1818
export async function runIxIxx({
1919
readStream,

0 commit comments

Comments
 (0)