@jbrowse/plugin-gtf 2.6.2 → 2.7.0

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.
@@ -4,13 +4,9 @@ import IntervalTree from '@flatten-js/interval-tree';
4
4
  import { Feature } from '@jbrowse/core/util';
5
5
  export default class extends BaseFeatureDataAdapter {
6
6
  protected gtfFeatures?: Promise<{
7
- feats: {
8
- [key: string]: string[];
9
- };
7
+ feats: Record<string, string[]>;
10
8
  }>;
11
- protected intervalTrees: {
12
- [key: string]: Promise<IntervalTree | undefined> | undefined;
13
- };
9
+ protected intervalTrees: Record<string, Promise<IntervalTree | undefined> | undefined>;
14
10
  private loadDataP;
15
11
  private loadData;
16
12
  getRefNames(opts?: BaseOptions): Promise<string[]>;
@@ -33,8 +33,7 @@ class default_1 extends BaseAdapter_1.BaseFeatureDataAdapter {
33
33
  .split(/\n|\r\n|\r/)
34
34
  .filter(f => !!f && !f.startsWith('#'));
35
35
  const feats = {};
36
- for (let i = 0; i < lines.length; i++) {
37
- const line = lines[i];
36
+ for (const line of lines) {
38
37
  if (line.startsWith('#')) {
39
38
  continue;
40
39
  }
@@ -43,7 +42,7 @@ class default_1 extends BaseAdapter_1.BaseFeatureDataAdapter {
43
42
  if (!feats[refName]) {
44
43
  feats[refName] = [];
45
44
  }
46
- feats[refName].push(lines[i]);
45
+ feats[refName].push(line);
47
46
  }
48
47
  return { feats };
49
48
  }
@@ -77,8 +76,7 @@ class default_1 extends BaseAdapter_1.BaseFeatureDataAdapter {
77
76
  data: (0, util_2.featureData)(f),
78
77
  id: `${this.id}-${refName}-${i}`,
79
78
  }));
80
- for (let i = 0; i < ret.length; i++) {
81
- const obj = ret[i];
79
+ for (const obj of ret) {
82
80
  intervalTree.insert([obj.get('start'), obj.get('end')], obj);
83
81
  }
84
82
  return intervalTree;
package/dist/util.d.ts CHANGED
@@ -8,8 +8,6 @@ export interface FeatureLoc {
8
8
  child_features: FeatureLoc[][];
9
9
  data: unknown;
10
10
  derived_features: unknown;
11
- attributes: {
12
- [key: string]: unknown[];
13
- };
11
+ attributes: Record<string, unknown[]>;
14
12
  }
15
13
  export declare function featureData(data: FeatureLoc): Record<string, unknown>;
@@ -4,13 +4,9 @@ import IntervalTree from '@flatten-js/interval-tree';
4
4
  import { Feature } from '@jbrowse/core/util';
5
5
  export default class extends BaseFeatureDataAdapter {
6
6
  protected gtfFeatures?: Promise<{
7
- feats: {
8
- [key: string]: string[];
9
- };
7
+ feats: Record<string, string[]>;
10
8
  }>;
11
- protected intervalTrees: {
12
- [key: string]: Promise<IntervalTree | undefined> | undefined;
13
- };
9
+ protected intervalTrees: Record<string, Promise<IntervalTree | undefined> | undefined>;
14
10
  private loadDataP;
15
11
  private loadData;
16
12
  getRefNames(opts?: BaseOptions): Promise<string[]>;
@@ -28,8 +28,7 @@ export default class extends BaseFeatureDataAdapter {
28
28
  .split(/\n|\r\n|\r/)
29
29
  .filter(f => !!f && !f.startsWith('#'));
30
30
  const feats = {};
31
- for (let i = 0; i < lines.length; i++) {
32
- const line = lines[i];
31
+ for (const line of lines) {
33
32
  if (line.startsWith('#')) {
34
33
  continue;
35
34
  }
@@ -38,7 +37,7 @@ export default class extends BaseFeatureDataAdapter {
38
37
  if (!feats[refName]) {
39
38
  feats[refName] = [];
40
39
  }
41
- feats[refName].push(lines[i]);
40
+ feats[refName].push(line);
42
41
  }
43
42
  return { feats };
44
43
  }
@@ -72,8 +71,7 @@ export default class extends BaseFeatureDataAdapter {
72
71
  data: featureData(f),
73
72
  id: `${this.id}-${refName}-${i}`,
74
73
  }));
75
- for (let i = 0; i < ret.length; i++) {
76
- const obj = ret[i];
74
+ for (const obj of ret) {
77
75
  intervalTree.insert([obj.get('start'), obj.get('end')], obj);
78
76
  }
79
77
  return intervalTree;
package/esm/util.d.ts CHANGED
@@ -8,8 +8,6 @@ export interface FeatureLoc {
8
8
  child_features: FeatureLoc[][];
9
9
  data: unknown;
10
10
  derived_features: unknown;
11
- attributes: {
12
- [key: string]: unknown[];
13
- };
11
+ attributes: Record<string, unknown[]>;
14
12
  }
15
13
  export declare function featureData(data: FeatureLoc): Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-gtf",
3
- "version": "2.6.2",
3
+ "version": "2.7.0",
4
4
  "description": "JBrowse 2 gtf feature adapter",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -45,7 +45,7 @@
45
45
  "@jbrowse/plugin-linear-genome-view": "^2.0.0",
46
46
  "@mui/material": "^5.0.0",
47
47
  "mobx": "^6.0.0",
48
- "mobx-react": "^7.0.0",
48
+ "mobx-react": "^9.0.0",
49
49
  "mobx-state-tree": "^5.0.0",
50
50
  "react": ">=16.8.0",
51
51
  "rxjs": "^7.0.0"
@@ -56,5 +56,5 @@
56
56
  "distModule": "esm/index.js",
57
57
  "srcModule": "src/index.ts",
58
58
  "module": "esm/index.js",
59
- "gitHead": "bbea587a402d9974acdd804a33f4b77f31a2fd5f"
59
+ "gitHead": "dbe7fb1af01fc89f833d2744635eb44a17365b41"
60
60
  }