@jbrowse/plugin-legacy-jbrowse 1.4.4 → 1.5.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.
Files changed (31) hide show
  1. package/dist/JBrowse1Connection/jb1ToJb2.d.ts +1 -0
  2. package/dist/JBrowse1Connection/types.d.ts +2 -0
  3. package/dist/JBrowse1TextSeachAdapter/HttpMap.d.ts +1 -15
  4. package/dist/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.d.ts +12 -8
  5. package/dist/NCListAdapter/NCListAdapter.d.ts +3 -1
  6. package/dist/plugin-legacy-jbrowse.cjs.development.js +334 -398
  7. package/dist/plugin-legacy-jbrowse.cjs.development.js.map +1 -1
  8. package/dist/plugin-legacy-jbrowse.cjs.production.min.js +1 -1
  9. package/dist/plugin-legacy-jbrowse.cjs.production.min.js.map +1 -1
  10. package/dist/plugin-legacy-jbrowse.esm.js +336 -399
  11. package/dist/plugin-legacy-jbrowse.esm.js.map +1 -1
  12. package/package.json +5 -3
  13. package/src/JBrowse1Connection/configSchema.ts +4 -1
  14. package/src/JBrowse1Connection/jb1ConfigLoad.ts +24 -27
  15. package/src/JBrowse1Connection/jb1ConfigParse.ts +10 -12
  16. package/src/JBrowse1Connection/jb1ToJb2.ts +93 -43
  17. package/src/JBrowse1Connection/types.ts +2 -0
  18. package/src/JBrowse1TextSeachAdapter/HttpMap.test.ts +8 -20
  19. package/src/JBrowse1TextSeachAdapter/HttpMap.ts +17 -75
  20. package/src/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.test.ts +2 -4
  21. package/src/JBrowse1TextSeachAdapter/JBrowse1TextSearchAdapter.ts +42 -58
  22. package/src/JBrowse1TextSeachAdapter/configSchema.ts +2 -2
  23. package/src/NCListAdapter/NCListAdapter.test.ts +4 -1
  24. package/src/NCListAdapter/NCListAdapter.ts +15 -8
  25. package/src/NCListAdapter/configSchema.ts +4 -1
  26. package/src/__snapshots__/index.test.js.snap +3 -0
  27. package/src/index.test.js +1 -0
  28. package/src/index.ts +23 -0
  29. package/dist/JBrowse1TextSeachAdapter/Crc32.d.ts +0 -19
  30. package/src/JBrowse1TextSeachAdapter/Crc32.test.ts +0 -21
  31. package/src/JBrowse1TextSeachAdapter/Crc32.ts +0 -77
@@ -40,6 +40,7 @@ interface Jb2Location {
40
40
  uri?: string;
41
41
  localPath?: string;
42
42
  blobId?: string;
43
+ locationType?: string;
43
44
  }
44
45
  export declare function convertTrackConfig(jb1TrackConfig: Track, dataRoot: string, sequenceAdapter: Jb2Adapter): Jb2Track;
45
46
  export declare function createRefSeqsAdapter(refSeqs: string | RefSeqs): Promise<Jb2Adapter>;
@@ -82,8 +82,10 @@ export interface Config {
82
82
  export interface UriLocation {
83
83
  uri: string;
84
84
  baseUri?: string;
85
+ locationType: 'UriLocation';
85
86
  }
86
87
  export interface LocalPathLocation {
87
88
  localPath: string;
89
+ locationType: 'LocalPathLocation';
88
90
  }
89
91
  export declare type JBLocation = UriLocation | LocalPathLocation;
@@ -1,12 +1,7 @@
1
1
  export default class HttpMap {
2
2
  url: string;
3
- isElectron: boolean;
4
- hash_hex_characters?: number;
5
- compress?: number;
6
- tracks?: string[];
7
3
  constructor(args: {
8
4
  url: string;
9
- isElectron: boolean;
10
5
  });
11
6
  /**
12
7
  * loads meta.json file from names directory and reads number of hash_bits used
@@ -15,12 +10,8 @@ export default class HttpMap {
15
10
  hashHexCharacters: number;
16
11
  compress: any;
17
12
  tracks: any;
18
- } | {
19
- hashHexCharacters?: undefined;
20
- compress?: undefined;
21
- tracks?: undefined;
22
13
  }>;
23
- getHashHexCharacters(): Promise<number | undefined>;
14
+ getHashHexCharacters(): Promise<number>;
24
15
  getCompress(): Promise<any>;
25
16
  getTrackNames(): Promise<any>;
26
17
  /**
@@ -44,10 +35,5 @@ export default class HttpMap {
44
35
  * @param hex - hex string
45
36
  */
46
37
  hexToDirPath(hex: string): Promise<string>;
47
- /**
48
- * Returns crc32 hash given a string.
49
- * (Note: this is using JBrowse1 implementation of crc32.)
50
- * @param data - string
51
- */
52
38
  hash(data: string): string;
53
39
  }
@@ -3,27 +3,31 @@ import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
3
3
  import { Instance } from 'mobx-state-tree';
4
4
  import MyConfigSchema from './configSchema';
5
5
  import HttpMap from './HttpMap';
6
+ import PluginManager from '@jbrowse/core/PluginManager';
7
+ import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
6
8
  export interface TooManyHits {
7
9
  name: string;
8
10
  hitLimit: number;
9
11
  }
12
+ interface SearchResults {
13
+ prefix: ({
14
+ name: string;
15
+ } | string)[];
16
+ exact: [string, number, string, string, number, number][];
17
+ }
10
18
  export declare type NamesIndexRecord = string | Array<string | number>;
11
19
  export default class JBrowse1TextSearchAdapter extends BaseAdapter implements BaseTextSearchAdapter {
12
20
  httpMap: HttpMap;
13
21
  tracksNames?: string[];
14
- constructor(config: Instance<typeof MyConfigSchema>);
22
+ constructor(config: Instance<typeof MyConfigSchema>, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
15
23
  /**
16
24
  * Returns the contents of the file containing the query if it exists
17
25
  * else it returns empty
18
26
  * @param query - string query
19
27
  */
20
- loadIndexFile(query: string): Promise<Record<string, Record<string, (string | TooManyHits | (string | number)[])[]>>>;
21
- /**
22
- * Returns list of results
23
- * @param args - search options/arguments include: search query
24
- * limit of results to return, SearchType...prefix | full | exact", etc.
25
- */
28
+ loadIndexFile(query: string): Promise<Record<string, SearchResults>>;
26
29
  searchIndex(args: BaseArgs): Promise<BaseResult[]>;
27
- formatResults(results: Array<NamesIndexRecord | TooManyHits>, tracksNames: string[]): BaseResult[];
30
+ formatResults(results: SearchResults, tracks: string[], searchType?: string): BaseResult[];
28
31
  freeResources(): void;
29
32
  }
33
+ export {};
@@ -4,10 +4,12 @@ import { Feature } from '@jbrowse/core/util/simpleFeature';
4
4
  import { Instance } from 'mobx-state-tree';
5
5
  import NCListFeature from './NCListFeature';
6
6
  import MyConfigSchema from './configSchema';
7
+ import PluginManager from '@jbrowse/core/PluginManager';
8
+ import { getSubAdapterType } from '@jbrowse/core/data_adapters/dataAdapterCache';
7
9
  export default class NCListAdapter extends BaseFeatureDataAdapter {
8
10
  private nclist;
9
11
  private configRefNames?;
10
- constructor(config: Instance<typeof MyConfigSchema>);
12
+ constructor(config: Instance<typeof MyConfigSchema>, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager);
11
13
  /**
12
14
  * Fetch features for a certain region. Use getFeaturesInRegion() if you also
13
15
  * want to verify that the store has features for the given reference sequence