@jbrowse/plugin-linear-comparative-view 2.15.1 → 2.15.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.
@@ -2,10 +2,10 @@ import React from 'react';
2
2
  import { SnapshotIn } from 'mobx-state-tree';
3
3
  import { AnyConfigurationModel } from '@jbrowse/core/configuration';
4
4
  type Conf = SnapshotIn<AnyConfigurationModel>;
5
- declare const OpenTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
5
+ declare const ImportCustomTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
6
6
  sessionTrackData: Conf;
7
7
  assembly1: string;
8
8
  assembly2: string;
9
9
  setSessionTrackData: (arg: Conf) => void;
10
10
  }) => React.JSX.Element;
11
- export default OpenTrack;
11
+ export default ImportCustomTrack;
@@ -28,7 +28,7 @@ const material_1 = require("@mui/material");
28
28
  const ui_1 = require("@jbrowse/core/ui");
29
29
  const mobx_react_1 = require("mobx-react");
30
30
  const util_1 = require("./util");
31
- function getAdapter({ radioOption, assembly1, assembly2, fileLocation, bed1Location, bed2Location, }) {
31
+ function getAdapter({ radioOption, assembly1, assembly2, fileLocation, indexFileLocation, bed1Location, bed2Location, }) {
32
32
  if (radioOption === '.paf') {
33
33
  return {
34
34
  type: 'PAFAdapter',
@@ -79,14 +79,23 @@ function getAdapter({ radioOption, assembly1, assembly2, fileLocation, bed1Locat
79
79
  assemblyNames: [assembly1, assembly2],
80
80
  };
81
81
  }
82
+ else if (radioOption === '.pif.gz') {
83
+ return {
84
+ type: 'PairwiseIndexedPAFAdapter',
85
+ pifGzLocation: fileLocation,
86
+ index: { location: indexFileLocation },
87
+ assemblyNames: [assembly1, assembly2],
88
+ };
89
+ }
82
90
  else {
83
91
  throw new Error(`Unknown to detect type ${radioOption} from filename (select radio button to clarify)`);
84
92
  }
85
93
  }
86
- const OpenTrack = (0, mobx_react_1.observer)(({ assembly1, assembly2, setSessionTrackData, }) => {
94
+ const ImportCustomTrack = (0, mobx_react_1.observer)(function ({ assembly1, assembly2, setSessionTrackData, }) {
87
95
  const [bed2Location, setBed2Location] = (0, react_1.useState)();
88
96
  const [bed1Location, setBed1Location] = (0, react_1.useState)();
89
97
  const [fileLocation, setFileLocation] = (0, react_1.useState)();
98
+ const [indexFileLocation, setIndexFileLocation] = (0, react_1.useState)();
90
99
  const [value, setValue] = (0, react_1.useState)('');
91
100
  const [error, setError] = (0, react_1.useState)();
92
101
  const fileName = (0, util_1.getName)(fileLocation);
@@ -107,6 +116,7 @@ const OpenTrack = (0, mobx_react_1.observer)(({ assembly1, assembly2, setSession
107
116
  assembly1,
108
117
  assembly2,
109
118
  fileLocation,
119
+ indexFileLocation,
110
120
  bed1Location,
111
121
  bed2Location,
112
122
  }),
@@ -124,12 +134,13 @@ const OpenTrack = (0, mobx_react_1.observer)(({ assembly1, assembly2, setSession
124
134
  bed1Location,
125
135
  bed2Location,
126
136
  fileLocation,
137
+ indexFileLocation,
127
138
  radioOption,
128
139
  setSessionTrackData,
129
140
  ]);
130
141
  return (react_1.default.createElement(material_1.Paper, { style: { padding: 12 } },
131
142
  error ? react_1.default.createElement(ui_1.ErrorMessage, { error: error }) : null,
132
- react_1.default.createElement(material_1.Typography, { style: { textAlign: 'center' } }, "Add a .paf, .out (MashMap), .delta (Mummer), .chain, .anchors or .anchors.simple (MCScan) file to view in the dotplot. These file types can also be gzipped. The first assembly should be the query sequence (e.g. left column of the PAF) and the second assembly should be the target sequence (e.g. right column of the PAF)"),
143
+ react_1.default.createElement(material_1.Typography, { style: { textAlign: 'center' } }, "Add a .paf, .out (MashMap), .delta (Mummer), .chain, .anchors or .anchors.simple (MCScan) file to view. These file types can also be gzipped. The first assembly should be the query sequence (e.g. left column of the PAF) and the second assembly should be the target sequence (e.g. right column of the PAF)"),
133
144
  react_1.default.createElement(material_1.RadioGroup, { value: radioOption, onChange: event => {
134
145
  setValue(event.target.value);
135
146
  } },
@@ -145,7 +156,9 @@ const OpenTrack = (0, mobx_react_1.observer)(({ assembly1, assembly2, setSession
145
156
  react_1.default.createElement(material_1.Grid, { item: true },
146
157
  react_1.default.createElement(material_1.FormControlLabel, { value: ".anchors", control: react_1.default.createElement(material_1.Radio, null), label: ".anchors" })),
147
158
  react_1.default.createElement(material_1.Grid, { item: true },
148
- react_1.default.createElement(material_1.FormControlLabel, { value: ".anchors.simple", control: react_1.default.createElement(material_1.Radio, null), label: ".anchors.simple" })))),
159
+ react_1.default.createElement(material_1.FormControlLabel, { value: ".anchors.simple", control: react_1.default.createElement(material_1.Radio, null), label: ".anchors.simple" })),
160
+ react_1.default.createElement(material_1.Grid, { item: true },
161
+ react_1.default.createElement(material_1.FormControlLabel, { value: ".pif.gz", control: react_1.default.createElement(material_1.Radio, null), label: ".pif.gz" })))),
149
162
  react_1.default.createElement(material_1.Grid, { container: true, justifyContent: "center" },
150
163
  react_1.default.createElement(material_1.Grid, { item: true }, value === '.anchors' || value === '.anchors.simple' ? (react_1.default.createElement("div", null,
151
164
  react_1.default.createElement("div", { style: { margin: 20 } },
@@ -166,8 +179,16 @@ const OpenTrack = (0, mobx_react_1.observer)(({ assembly1, assembly2, setSession
166
179
  react_1.default.createElement("div", null,
167
180
  react_1.default.createElement(ui_1.FileSelector, { name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: loc => {
168
181
  setBed2Location(loc);
169
- } }))))) : (react_1.default.createElement(ui_1.FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
182
+ } }))))) : value === '.pif.gz' ? (react_1.default.createElement("div", { style: { display: 'flex' } },
183
+ react_1.default.createElement("div", null,
184
+ react_1.default.createElement(ui_1.FileSelector, { name: `${value} location`, description: "", location: fileLocation, setLocation: loc => {
185
+ setFileLocation(loc);
186
+ } })),
187
+ react_1.default.createElement("div", null,
188
+ react_1.default.createElement(ui_1.FileSelector, { name: `${value} index location`, description: "", location: indexFileLocation, setLocation: loc => {
189
+ setIndexFileLocation(loc);
190
+ } })))) : (react_1.default.createElement(ui_1.FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
170
191
  setFileLocation(loc);
171
192
  } }))))));
172
193
  });
173
- exports.default = OpenTrack;
194
+ exports.default = ImportCustomTrack;
@@ -2,10 +2,10 @@ import React from 'react';
2
2
  import { SnapshotIn } from 'mobx-state-tree';
3
3
  import { AnyConfigurationModel } from '@jbrowse/core/configuration';
4
4
  type Conf = SnapshotIn<AnyConfigurationModel>;
5
- declare const OpenTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
5
+ declare const ImportCustomTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
6
6
  sessionTrackData: Conf;
7
7
  assembly1: string;
8
8
  assembly2: string;
9
9
  setSessionTrackData: (arg: Conf) => void;
10
10
  }) => React.JSX.Element;
11
- export default OpenTrack;
11
+ export default ImportCustomTrack;
@@ -2,8 +2,8 @@ import React, { useState, useEffect } from 'react';
2
2
  import { FormControlLabel, Grid, Paper, Radio, RadioGroup, Typography, } from '@mui/material';
3
3
  import { ErrorMessage, FileSelector } from '@jbrowse/core/ui';
4
4
  import { observer } from 'mobx-react';
5
- import { extName, getName, stripGz, basename } from './util';
6
- function getAdapter({ radioOption, assembly1, assembly2, fileLocation, bed1Location, bed2Location, }) {
5
+ import { basename, extName, getName, stripGz } from './util';
6
+ function getAdapter({ radioOption, assembly1, assembly2, fileLocation, indexFileLocation, bed1Location, bed2Location, }) {
7
7
  if (radioOption === '.paf') {
8
8
  return {
9
9
  type: 'PAFAdapter',
@@ -54,14 +54,23 @@ function getAdapter({ radioOption, assembly1, assembly2, fileLocation, bed1Locat
54
54
  assemblyNames: [assembly1, assembly2],
55
55
  };
56
56
  }
57
+ else if (radioOption === '.pif.gz') {
58
+ return {
59
+ type: 'PairwiseIndexedPAFAdapter',
60
+ pifGzLocation: fileLocation,
61
+ index: { location: indexFileLocation },
62
+ assemblyNames: [assembly1, assembly2],
63
+ };
64
+ }
57
65
  else {
58
66
  throw new Error(`Unknown to detect type ${radioOption} from filename (select radio button to clarify)`);
59
67
  }
60
68
  }
61
- const OpenTrack = observer(({ assembly1, assembly2, setSessionTrackData, }) => {
69
+ const ImportCustomTrack = observer(function ({ assembly1, assembly2, setSessionTrackData, }) {
62
70
  const [bed2Location, setBed2Location] = useState();
63
71
  const [bed1Location, setBed1Location] = useState();
64
72
  const [fileLocation, setFileLocation] = useState();
73
+ const [indexFileLocation, setIndexFileLocation] = useState();
65
74
  const [value, setValue] = useState('');
66
75
  const [error, setError] = useState();
67
76
  const fileName = getName(fileLocation);
@@ -82,6 +91,7 @@ const OpenTrack = observer(({ assembly1, assembly2, setSessionTrackData, }) => {
82
91
  assembly1,
83
92
  assembly2,
84
93
  fileLocation,
94
+ indexFileLocation,
85
95
  bed1Location,
86
96
  bed2Location,
87
97
  }),
@@ -99,12 +109,13 @@ const OpenTrack = observer(({ assembly1, assembly2, setSessionTrackData, }) => {
99
109
  bed1Location,
100
110
  bed2Location,
101
111
  fileLocation,
112
+ indexFileLocation,
102
113
  radioOption,
103
114
  setSessionTrackData,
104
115
  ]);
105
116
  return (React.createElement(Paper, { style: { padding: 12 } },
106
117
  error ? React.createElement(ErrorMessage, { error: error }) : null,
107
- React.createElement(Typography, { style: { textAlign: 'center' } }, "Add a .paf, .out (MashMap), .delta (Mummer), .chain, .anchors or .anchors.simple (MCScan) file to view in the dotplot. These file types can also be gzipped. The first assembly should be the query sequence (e.g. left column of the PAF) and the second assembly should be the target sequence (e.g. right column of the PAF)"),
118
+ React.createElement(Typography, { style: { textAlign: 'center' } }, "Add a .paf, .out (MashMap), .delta (Mummer), .chain, .anchors or .anchors.simple (MCScan) file to view. These file types can also be gzipped. The first assembly should be the query sequence (e.g. left column of the PAF) and the second assembly should be the target sequence (e.g. right column of the PAF)"),
108
119
  React.createElement(RadioGroup, { value: radioOption, onChange: event => {
109
120
  setValue(event.target.value);
110
121
  } },
@@ -120,7 +131,9 @@ const OpenTrack = observer(({ assembly1, assembly2, setSessionTrackData, }) => {
120
131
  React.createElement(Grid, { item: true },
121
132
  React.createElement(FormControlLabel, { value: ".anchors", control: React.createElement(Radio, null), label: ".anchors" })),
122
133
  React.createElement(Grid, { item: true },
123
- React.createElement(FormControlLabel, { value: ".anchors.simple", control: React.createElement(Radio, null), label: ".anchors.simple" })))),
134
+ React.createElement(FormControlLabel, { value: ".anchors.simple", control: React.createElement(Radio, null), label: ".anchors.simple" })),
135
+ React.createElement(Grid, { item: true },
136
+ React.createElement(FormControlLabel, { value: ".pif.gz", control: React.createElement(Radio, null), label: ".pif.gz" })))),
124
137
  React.createElement(Grid, { container: true, justifyContent: "center" },
125
138
  React.createElement(Grid, { item: true }, value === '.anchors' || value === '.anchors.simple' ? (React.createElement("div", null,
126
139
  React.createElement("div", { style: { margin: 20 } },
@@ -141,8 +154,16 @@ const OpenTrack = observer(({ assembly1, assembly2, setSessionTrackData, }) => {
141
154
  React.createElement("div", null,
142
155
  React.createElement(FileSelector, { name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: loc => {
143
156
  setBed2Location(loc);
144
- } }))))) : (React.createElement(FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
157
+ } }))))) : value === '.pif.gz' ? (React.createElement("div", { style: { display: 'flex' } },
158
+ React.createElement("div", null,
159
+ React.createElement(FileSelector, { name: `${value} location`, description: "", location: fileLocation, setLocation: loc => {
160
+ setFileLocation(loc);
161
+ } })),
162
+ React.createElement("div", null,
163
+ React.createElement(FileSelector, { name: `${value} index location`, description: "", location: indexFileLocation, setLocation: loc => {
164
+ setIndexFileLocation(loc);
165
+ } })))) : (React.createElement(FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
145
166
  setFileLocation(loc);
146
167
  } }))))));
147
168
  });
148
- export default OpenTrack;
169
+ export default ImportCustomTrack;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-comparative-view",
3
- "version": "2.15.1",
3
+ "version": "2.15.3",
4
4
  "description": "JBrowse 2 linear comparative view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "86ed70124fc5a0b1161266659d1ca9f8796bf3fe"
64
+ "gitHead": "c0f82fe7b210622dd462e702641cc6da01109c6e"
65
65
  }