@teselagen/ove 0.8.36 → 0.8.38
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/helperComponents/PropertiesDialog/utils.d.ts +2 -2
- package/index.cjs.js +76 -22
- package/index.es.js +76 -22
- package/index.umd.js +76 -22
- package/package.json +3 -3
- package/src/helperComponents/PropertiesDialog/GenericAnnotationProperties.js +7 -3
- package/src/helperComponents/PropertiesDialog/OrfProperties.js +1 -1
- package/src/helperComponents/PropertiesDialog/utils.js +6 -13
- package/src/helperComponents/RemoveDuplicates/index.js +16 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export function sizeSchema(
|
|
1
|
+
export function sizeSchema(): {
|
|
2
2
|
path: string;
|
|
3
3
|
type: string;
|
|
4
|
-
render: (val: any,
|
|
4
|
+
render: (val: any, record: any) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
};
|
|
6
6
|
export function getMemoOrfs(editorState: any): any;
|
package/index.cjs.js
CHANGED
|
@@ -20258,6 +20258,23 @@ function applyWhereClause(records, where) {
|
|
|
20258
20258
|
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
20259
20259
|
return false;
|
|
20260
20260
|
break;
|
|
20261
|
+
case "_in":
|
|
20262
|
+
if (!some(conditionValue, (item) => isEqual$3(value, item)))
|
|
20263
|
+
return false;
|
|
20264
|
+
break;
|
|
20265
|
+
case "_nin":
|
|
20266
|
+
if (some(conditionValue, (item) => isEqual$3(value, item)))
|
|
20267
|
+
return false;
|
|
20268
|
+
break;
|
|
20269
|
+
case "_regex": {
|
|
20270
|
+
try {
|
|
20271
|
+
if (!isString$1(value) || !new RegExp(conditionValue).test(value))
|
|
20272
|
+
return false;
|
|
20273
|
+
} catch (e) {
|
|
20274
|
+
return false;
|
|
20275
|
+
}
|
|
20276
|
+
break;
|
|
20277
|
+
}
|
|
20261
20278
|
default:
|
|
20262
20279
|
if (operator.startsWith("_")) {
|
|
20263
20280
|
console.warn(`Unsupported operator: ${operator}`);
|
|
@@ -50812,7 +50829,7 @@ const FilterAndSortMenu = /* @__PURE__ */ __name(({
|
|
|
50812
50829
|
filterValToUse = false;
|
|
50813
50830
|
} else if (ccSelectedFilter2 === "inList" || ccSelectedFilter2 === "notInList") {
|
|
50814
50831
|
if (dataType === "number") {
|
|
50815
|
-
filterValToUse = filterValue && filterValue.map((val2) => parseFloat(val2
|
|
50832
|
+
filterValToUse = filterValue && filterValue.map((val2) => parseFloat(`${val2}`.replaceAll(",", "")));
|
|
50816
50833
|
}
|
|
50817
50834
|
}
|
|
50818
50835
|
if (isInvalidFilterValue(filterValToUse)) {
|
|
@@ -50918,7 +50935,7 @@ const FilterInput = /* @__PURE__ */ __name(({
|
|
|
50918
50935
|
multi: true,
|
|
50919
50936
|
creatable: true,
|
|
50920
50937
|
value: (filterValue || []).map((val2) => ({
|
|
50921
|
-
label: val2
|
|
50938
|
+
label: `${val2}`,
|
|
50922
50939
|
value: val2
|
|
50923
50940
|
})),
|
|
50924
50941
|
onChange: /* @__PURE__ */ __name((selectedOptions) => {
|
|
@@ -95178,7 +95195,44 @@ function getCurrentDateString() {
|
|
|
95178
95195
|
return day2 + "-" + month + "-" + year;
|
|
95179
95196
|
}
|
|
95180
95197
|
__name(getCurrentDateString, "getCurrentDateString");
|
|
95198
|
+
const standardLineLength = 79;
|
|
95181
95199
|
function featureNoteInDataToGenbankString(name2, value, options) {
|
|
95200
|
+
const valueString = mangleOrStripUrls(value, options);
|
|
95201
|
+
if (valueString.length > standardLineLength - 25 - name2.length) {
|
|
95202
|
+
const lines = [];
|
|
95203
|
+
let currentIndex = 0;
|
|
95204
|
+
while (currentIndex < valueString.length) {
|
|
95205
|
+
if (currentIndex === 0) {
|
|
95206
|
+
const chunk = valueString.substring(
|
|
95207
|
+
currentIndex,
|
|
95208
|
+
currentIndex + standardLineLength - name2.length - 24
|
|
95209
|
+
);
|
|
95210
|
+
lines.push(
|
|
95211
|
+
StringUtil.lpad("/", " ", 22) + name2 + '="' + chunk + (currentIndex + standardLineLength - 22 - name2.length >= valueString.length ? '"' : "")
|
|
95212
|
+
);
|
|
95213
|
+
currentIndex += standardLineLength - name2.length - 24;
|
|
95214
|
+
} else {
|
|
95215
|
+
const chunk = valueString.substring(
|
|
95216
|
+
currentIndex,
|
|
95217
|
+
currentIndex + standardLineLength - 21
|
|
95218
|
+
);
|
|
95219
|
+
if (currentIndex + standardLineLength - 21 >= valueString.length) {
|
|
95220
|
+
const lineString = " ".repeat(21) + chunk;
|
|
95221
|
+
if (lineString.length === standardLineLength) {
|
|
95222
|
+
lines.push(lineString);
|
|
95223
|
+
lines.push(" ".repeat(21) + '"');
|
|
95224
|
+
} else {
|
|
95225
|
+
lines.push(lineString + '"');
|
|
95226
|
+
}
|
|
95227
|
+
} else {
|
|
95228
|
+
const lineString = " ".repeat(21) + chunk;
|
|
95229
|
+
lines.push(lineString);
|
|
95230
|
+
}
|
|
95231
|
+
currentIndex += standardLineLength - 21;
|
|
95232
|
+
}
|
|
95233
|
+
}
|
|
95234
|
+
return lines.join("\r\n");
|
|
95235
|
+
}
|
|
95182
95236
|
return StringUtil.lpad("/", " ", 22) + name2 + '="' + mangleOrStripUrls(value, options) + '"';
|
|
95183
95237
|
}
|
|
95184
95238
|
__name(featureNoteInDataToGenbankString, "featureNoteInDataToGenbankString");
|
|
@@ -117191,7 +117245,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
117191
117245
|
input.click();
|
|
117192
117246
|
}
|
|
117193
117247
|
__name(showFileDialog, "showFileDialog");
|
|
117194
|
-
const version = "0.8.
|
|
117248
|
+
const version = "0.8.38";
|
|
117195
117249
|
const packageJson = {
|
|
117196
117250
|
version
|
|
117197
117251
|
};
|
|
@@ -127692,14 +127746,13 @@ const _ComponentToPrint = class _ComponentToPrint extends React.Component {
|
|
|
127692
127746
|
};
|
|
127693
127747
|
__name(_ComponentToPrint, "ComponentToPrint");
|
|
127694
127748
|
let ComponentToPrint = _ComponentToPrint;
|
|
127695
|
-
const sizeSchema = /* @__PURE__ */ __name((
|
|
127749
|
+
const sizeSchema = /* @__PURE__ */ __name(() => ({
|
|
127696
127750
|
path: "size",
|
|
127697
127751
|
type: "number",
|
|
127698
|
-
render: /* @__PURE__ */ __name((val2,
|
|
127699
|
-
const record = isProtein2 ? convertDnaCaretPositionOrRangeToAA(_record) : _record;
|
|
127752
|
+
render: /* @__PURE__ */ __name((val2, record) => {
|
|
127700
127753
|
const base1Range = convertRangeTo1Based(record);
|
|
127701
127754
|
const hasJoinedLocations = record.locations && record.locations.length > 1;
|
|
127702
|
-
return /* @__PURE__ */ React.createElement("span", null,
|
|
127755
|
+
return /* @__PURE__ */ React.createElement("span", null, val2, " ", /* @__PURE__ */ React.createElement("span", { style: { fontSize: 10 } }, hasJoinedLocations ? record.locations.map((loc, i) => {
|
|
127703
127756
|
const base1Range2 = convertRangeTo1Based(loc);
|
|
127704
127757
|
return /* @__PURE__ */ React.createElement("span", { key: i }, "(", base1Range2.start, "-", base1Range2.end, ")");
|
|
127705
127758
|
}) : /* @__PURE__ */ React.createElement("span", null, "(", base1Range.start, "-", base1Range.end, ")")));
|
|
@@ -127709,11 +127762,7 @@ const getMemoOrfs = /* @__PURE__ */ (() => {
|
|
|
127709
127762
|
let lastDeps;
|
|
127710
127763
|
let lastResult;
|
|
127711
127764
|
return (editorState) => {
|
|
127712
|
-
const {
|
|
127713
|
-
sequenceData: sequenceData2,
|
|
127714
|
-
minimumOrfSize: minimumOrfSize2,
|
|
127715
|
-
useAdditionalOrfStartCodons: useAdditionalOrfStartCodons2
|
|
127716
|
-
} = editorState;
|
|
127765
|
+
const { sequenceData: sequenceData2, minimumOrfSize: minimumOrfSize2, useAdditionalOrfStartCodons: useAdditionalOrfStartCodons2 } = editorState;
|
|
127717
127766
|
const { sequence: sequence2, circular: circular2 } = sequenceData2;
|
|
127718
127767
|
const deps = {
|
|
127719
127768
|
sequence: sequence2,
|
|
@@ -133730,6 +133779,7 @@ const RemoveDuplicatesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
133730
133779
|
const ignoreName = useFormValue(dialogFormName, "ignoreName");
|
|
133731
133780
|
const ignoreStartAndEnd = useFormValue(dialogFormName, "ignoreStartAndEnd");
|
|
133732
133781
|
const ignoreStrand = useFormValue(dialogFormName, "ignoreStrand");
|
|
133782
|
+
const isProteinSeq = isProtein2 || sequenceData2.isProtein;
|
|
133733
133783
|
const recomputeDups = React.useCallback(
|
|
133734
133784
|
(values3) => {
|
|
133735
133785
|
const ignoreName2 = values3 == null ? void 0 : values3.ignoreName;
|
|
@@ -133738,17 +133788,20 @@ const RemoveDuplicatesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
133738
133788
|
const annotations = sequenceData2[type2];
|
|
133739
133789
|
const newDups = [];
|
|
133740
133790
|
const seqsHashByStartEndStrandName = {};
|
|
133741
|
-
forEach$1(annotations, (
|
|
133742
|
-
const
|
|
133791
|
+
forEach$1(annotations, (_annotation) => {
|
|
133792
|
+
const annotation = isProteinSeq ? convertDnaCaretPositionOrRangeToAA(_annotation) : _annotation;
|
|
133793
|
+
const hash2 = `${ignoreStartAndEnd2 ? "" : annotation.start}&${ignoreStartAndEnd2 ? "" : annotation.end}&${ignoreStrand2 ? "" : annotation.strand}&${ignoreName2 ? "" : annotation.name}`;
|
|
133743
133794
|
if (seqsHashByStartEndStrandName[hash2]) {
|
|
133744
|
-
newDups.push(__spreadProps(__spreadValues({},
|
|
133795
|
+
newDups.push(__spreadProps(__spreadValues({}, annotation), {
|
|
133796
|
+
size: getRangeLength(annotation, sequenceLength)
|
|
133797
|
+
}));
|
|
133745
133798
|
} else {
|
|
133746
133799
|
seqsHashByStartEndStrandName[hash2] = true;
|
|
133747
133800
|
}
|
|
133748
133801
|
});
|
|
133749
133802
|
return newDups;
|
|
133750
133803
|
},
|
|
133751
|
-
[sequenceData2, sequenceLength, type2]
|
|
133804
|
+
[sequenceData2, sequenceLength, type2, isProteinSeq]
|
|
133752
133805
|
);
|
|
133753
133806
|
const [dups, setDups] = React.useState(recomputeDups);
|
|
133754
133807
|
const selectedIds = React.useMemo(() => dups.map((d2) => d2.id), [dups]);
|
|
@@ -133770,11 +133823,11 @@ const RemoveDuplicatesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
133770
133823
|
fields: [
|
|
133771
133824
|
{ path: "name", type: "string" },
|
|
133772
133825
|
// ...(noType ? [] : [{ path: "type", type: "string" }]),
|
|
133773
|
-
sizeSchema(
|
|
133826
|
+
sizeSchema(),
|
|
133774
133827
|
{ path: "strand", type: "string" }
|
|
133775
133828
|
]
|
|
133776
133829
|
}),
|
|
133777
|
-
[
|
|
133830
|
+
[]
|
|
133778
133831
|
);
|
|
133779
133832
|
return /* @__PURE__ */ React.createElement("div", { className: classNames(core.Classes.DIALOG_BODY, "tg-min-width-dialog") }, /* @__PURE__ */ React.createElement(
|
|
133780
133833
|
WrappedDT,
|
|
@@ -144235,14 +144288,15 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
|
|
|
144235
144288
|
const annotationPropertiesSelectedEntities = _annotationPropertiesSelectedEntities.filter((a2) => annotations[a2.id]);
|
|
144236
144289
|
const deleteAnnotation = props[`delete${annotationTypeUpper}`];
|
|
144237
144290
|
const annotationsToUse = React.useMemo(
|
|
144238
|
-
() => map$3(annotations, (
|
|
144291
|
+
() => map$3(annotations, (_annotation) => {
|
|
144292
|
+
const annotation = isProtein2 ? convertDnaCaretPositionOrRangeToAA(_annotation) : _annotation;
|
|
144239
144293
|
return __spreadProps(__spreadValues(__spreadValues({}, annotation), annotation.strand === void 0 && {
|
|
144240
144294
|
strand: annotation.forward ? 1 : -1
|
|
144241
144295
|
}), {
|
|
144242
144296
|
size: getRangeLength(annotation, sequenceLength)
|
|
144243
144297
|
});
|
|
144244
144298
|
}),
|
|
144245
|
-
[annotations, sequenceLength]
|
|
144299
|
+
[annotations, sequenceLength, isProtein2]
|
|
144246
144300
|
);
|
|
144247
144301
|
const keyedPartTags = (_a2 = getKeyedTagsAndTagOptions(allPartTags)) != null ? _a2 : {};
|
|
144248
144302
|
const additionalColumns = ((_c = (_b2 = PropertiesProps == null ? void 0 : PropertiesProps.propertiesList) == null ? void 0 : _b2.find(
|
|
@@ -144312,7 +144366,7 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
|
|
|
144312
144366
|
}, "render")
|
|
144313
144367
|
}
|
|
144314
144368
|
],
|
|
144315
|
-
sizeSchema(
|
|
144369
|
+
sizeSchema(),
|
|
144316
144370
|
...withTags && allPartTags ? [
|
|
144317
144371
|
{
|
|
144318
144372
|
path: "tags",
|
|
@@ -144806,7 +144860,7 @@ const _OrfProperties = class _OrfProperties extends React.Component {
|
|
|
144806
144860
|
displayName: "Size (aa)",
|
|
144807
144861
|
type: "number"
|
|
144808
144862
|
},
|
|
144809
|
-
sizeSchema(
|
|
144863
|
+
sizeSchema(),
|
|
144810
144864
|
{ path: "frame", type: "number" },
|
|
144811
144865
|
{ path: "strand", type: "number" }
|
|
144812
144866
|
]
|
package/index.es.js
CHANGED
|
@@ -20240,6 +20240,23 @@ function applyWhereClause(records, where) {
|
|
|
20240
20240
|
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
20241
20241
|
return false;
|
|
20242
20242
|
break;
|
|
20243
|
+
case "_in":
|
|
20244
|
+
if (!some(conditionValue, (item) => isEqual$3(value, item)))
|
|
20245
|
+
return false;
|
|
20246
|
+
break;
|
|
20247
|
+
case "_nin":
|
|
20248
|
+
if (some(conditionValue, (item) => isEqual$3(value, item)))
|
|
20249
|
+
return false;
|
|
20250
|
+
break;
|
|
20251
|
+
case "_regex": {
|
|
20252
|
+
try {
|
|
20253
|
+
if (!isString$1(value) || !new RegExp(conditionValue).test(value))
|
|
20254
|
+
return false;
|
|
20255
|
+
} catch (e) {
|
|
20256
|
+
return false;
|
|
20257
|
+
}
|
|
20258
|
+
break;
|
|
20259
|
+
}
|
|
20243
20260
|
default:
|
|
20244
20261
|
if (operator.startsWith("_")) {
|
|
20245
20262
|
console.warn(`Unsupported operator: ${operator}`);
|
|
@@ -50794,7 +50811,7 @@ const FilterAndSortMenu = /* @__PURE__ */ __name(({
|
|
|
50794
50811
|
filterValToUse = false;
|
|
50795
50812
|
} else if (ccSelectedFilter2 === "inList" || ccSelectedFilter2 === "notInList") {
|
|
50796
50813
|
if (dataType === "number") {
|
|
50797
|
-
filterValToUse = filterValue && filterValue.map((val2) => parseFloat(val2
|
|
50814
|
+
filterValToUse = filterValue && filterValue.map((val2) => parseFloat(`${val2}`.replaceAll(",", "")));
|
|
50798
50815
|
}
|
|
50799
50816
|
}
|
|
50800
50817
|
if (isInvalidFilterValue(filterValToUse)) {
|
|
@@ -50900,7 +50917,7 @@ const FilterInput = /* @__PURE__ */ __name(({
|
|
|
50900
50917
|
multi: true,
|
|
50901
50918
|
creatable: true,
|
|
50902
50919
|
value: (filterValue || []).map((val2) => ({
|
|
50903
|
-
label: val2
|
|
50920
|
+
label: `${val2}`,
|
|
50904
50921
|
value: val2
|
|
50905
50922
|
})),
|
|
50906
50923
|
onChange: /* @__PURE__ */ __name((selectedOptions) => {
|
|
@@ -95160,7 +95177,44 @@ function getCurrentDateString() {
|
|
|
95160
95177
|
return day2 + "-" + month + "-" + year;
|
|
95161
95178
|
}
|
|
95162
95179
|
__name(getCurrentDateString, "getCurrentDateString");
|
|
95180
|
+
const standardLineLength = 79;
|
|
95163
95181
|
function featureNoteInDataToGenbankString(name2, value, options) {
|
|
95182
|
+
const valueString = mangleOrStripUrls(value, options);
|
|
95183
|
+
if (valueString.length > standardLineLength - 25 - name2.length) {
|
|
95184
|
+
const lines = [];
|
|
95185
|
+
let currentIndex = 0;
|
|
95186
|
+
while (currentIndex < valueString.length) {
|
|
95187
|
+
if (currentIndex === 0) {
|
|
95188
|
+
const chunk = valueString.substring(
|
|
95189
|
+
currentIndex,
|
|
95190
|
+
currentIndex + standardLineLength - name2.length - 24
|
|
95191
|
+
);
|
|
95192
|
+
lines.push(
|
|
95193
|
+
StringUtil.lpad("/", " ", 22) + name2 + '="' + chunk + (currentIndex + standardLineLength - 22 - name2.length >= valueString.length ? '"' : "")
|
|
95194
|
+
);
|
|
95195
|
+
currentIndex += standardLineLength - name2.length - 24;
|
|
95196
|
+
} else {
|
|
95197
|
+
const chunk = valueString.substring(
|
|
95198
|
+
currentIndex,
|
|
95199
|
+
currentIndex + standardLineLength - 21
|
|
95200
|
+
);
|
|
95201
|
+
if (currentIndex + standardLineLength - 21 >= valueString.length) {
|
|
95202
|
+
const lineString = " ".repeat(21) + chunk;
|
|
95203
|
+
if (lineString.length === standardLineLength) {
|
|
95204
|
+
lines.push(lineString);
|
|
95205
|
+
lines.push(" ".repeat(21) + '"');
|
|
95206
|
+
} else {
|
|
95207
|
+
lines.push(lineString + '"');
|
|
95208
|
+
}
|
|
95209
|
+
} else {
|
|
95210
|
+
const lineString = " ".repeat(21) + chunk;
|
|
95211
|
+
lines.push(lineString);
|
|
95212
|
+
}
|
|
95213
|
+
currentIndex += standardLineLength - 21;
|
|
95214
|
+
}
|
|
95215
|
+
}
|
|
95216
|
+
return lines.join("\r\n");
|
|
95217
|
+
}
|
|
95164
95218
|
return StringUtil.lpad("/", " ", 22) + name2 + '="' + mangleOrStripUrls(value, options) + '"';
|
|
95165
95219
|
}
|
|
95166
95220
|
__name(featureNoteInDataToGenbankString, "featureNoteInDataToGenbankString");
|
|
@@ -117173,7 +117227,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
117173
117227
|
input.click();
|
|
117174
117228
|
}
|
|
117175
117229
|
__name(showFileDialog, "showFileDialog");
|
|
117176
|
-
const version = "0.8.
|
|
117230
|
+
const version = "0.8.38";
|
|
117177
117231
|
const packageJson = {
|
|
117178
117232
|
version
|
|
117179
117233
|
};
|
|
@@ -127674,14 +127728,13 @@ const _ComponentToPrint = class _ComponentToPrint extends React__default.Compone
|
|
|
127674
127728
|
};
|
|
127675
127729
|
__name(_ComponentToPrint, "ComponentToPrint");
|
|
127676
127730
|
let ComponentToPrint = _ComponentToPrint;
|
|
127677
|
-
const sizeSchema = /* @__PURE__ */ __name((
|
|
127731
|
+
const sizeSchema = /* @__PURE__ */ __name(() => ({
|
|
127678
127732
|
path: "size",
|
|
127679
127733
|
type: "number",
|
|
127680
|
-
render: /* @__PURE__ */ __name((val2,
|
|
127681
|
-
const record = isProtein2 ? convertDnaCaretPositionOrRangeToAA(_record) : _record;
|
|
127734
|
+
render: /* @__PURE__ */ __name((val2, record) => {
|
|
127682
127735
|
const base1Range = convertRangeTo1Based(record);
|
|
127683
127736
|
const hasJoinedLocations = record.locations && record.locations.length > 1;
|
|
127684
|
-
return /* @__PURE__ */ React__default.createElement("span", null,
|
|
127737
|
+
return /* @__PURE__ */ React__default.createElement("span", null, val2, " ", /* @__PURE__ */ React__default.createElement("span", { style: { fontSize: 10 } }, hasJoinedLocations ? record.locations.map((loc, i) => {
|
|
127685
127738
|
const base1Range2 = convertRangeTo1Based(loc);
|
|
127686
127739
|
return /* @__PURE__ */ React__default.createElement("span", { key: i }, "(", base1Range2.start, "-", base1Range2.end, ")");
|
|
127687
127740
|
}) : /* @__PURE__ */ React__default.createElement("span", null, "(", base1Range.start, "-", base1Range.end, ")")));
|
|
@@ -127691,11 +127744,7 @@ const getMemoOrfs = /* @__PURE__ */ (() => {
|
|
|
127691
127744
|
let lastDeps;
|
|
127692
127745
|
let lastResult;
|
|
127693
127746
|
return (editorState) => {
|
|
127694
|
-
const {
|
|
127695
|
-
sequenceData: sequenceData2,
|
|
127696
|
-
minimumOrfSize: minimumOrfSize2,
|
|
127697
|
-
useAdditionalOrfStartCodons: useAdditionalOrfStartCodons2
|
|
127698
|
-
} = editorState;
|
|
127747
|
+
const { sequenceData: sequenceData2, minimumOrfSize: minimumOrfSize2, useAdditionalOrfStartCodons: useAdditionalOrfStartCodons2 } = editorState;
|
|
127699
127748
|
const { sequence: sequence2, circular: circular2 } = sequenceData2;
|
|
127700
127749
|
const deps = {
|
|
127701
127750
|
sequence: sequence2,
|
|
@@ -133712,6 +133761,7 @@ const RemoveDuplicatesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
133712
133761
|
const ignoreName = useFormValue(dialogFormName, "ignoreName");
|
|
133713
133762
|
const ignoreStartAndEnd = useFormValue(dialogFormName, "ignoreStartAndEnd");
|
|
133714
133763
|
const ignoreStrand = useFormValue(dialogFormName, "ignoreStrand");
|
|
133764
|
+
const isProteinSeq = isProtein2 || sequenceData2.isProtein;
|
|
133715
133765
|
const recomputeDups = useCallback$1(
|
|
133716
133766
|
(values3) => {
|
|
133717
133767
|
const ignoreName2 = values3 == null ? void 0 : values3.ignoreName;
|
|
@@ -133720,17 +133770,20 @@ const RemoveDuplicatesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
133720
133770
|
const annotations = sequenceData2[type2];
|
|
133721
133771
|
const newDups = [];
|
|
133722
133772
|
const seqsHashByStartEndStrandName = {};
|
|
133723
|
-
forEach$1(annotations, (
|
|
133724
|
-
const
|
|
133773
|
+
forEach$1(annotations, (_annotation) => {
|
|
133774
|
+
const annotation = isProteinSeq ? convertDnaCaretPositionOrRangeToAA(_annotation) : _annotation;
|
|
133775
|
+
const hash2 = `${ignoreStartAndEnd2 ? "" : annotation.start}&${ignoreStartAndEnd2 ? "" : annotation.end}&${ignoreStrand2 ? "" : annotation.strand}&${ignoreName2 ? "" : annotation.name}`;
|
|
133725
133776
|
if (seqsHashByStartEndStrandName[hash2]) {
|
|
133726
|
-
newDups.push(__spreadProps(__spreadValues({},
|
|
133777
|
+
newDups.push(__spreadProps(__spreadValues({}, annotation), {
|
|
133778
|
+
size: getRangeLength(annotation, sequenceLength)
|
|
133779
|
+
}));
|
|
133727
133780
|
} else {
|
|
133728
133781
|
seqsHashByStartEndStrandName[hash2] = true;
|
|
133729
133782
|
}
|
|
133730
133783
|
});
|
|
133731
133784
|
return newDups;
|
|
133732
133785
|
},
|
|
133733
|
-
[sequenceData2, sequenceLength, type2]
|
|
133786
|
+
[sequenceData2, sequenceLength, type2, isProteinSeq]
|
|
133734
133787
|
);
|
|
133735
133788
|
const [dups, setDups] = useState(recomputeDups);
|
|
133736
133789
|
const selectedIds = useMemo$1(() => dups.map((d2) => d2.id), [dups]);
|
|
@@ -133752,11 +133805,11 @@ const RemoveDuplicatesDialog = /* @__PURE__ */ __name((props) => {
|
|
|
133752
133805
|
fields: [
|
|
133753
133806
|
{ path: "name", type: "string" },
|
|
133754
133807
|
// ...(noType ? [] : [{ path: "type", type: "string" }]),
|
|
133755
|
-
sizeSchema(
|
|
133808
|
+
sizeSchema(),
|
|
133756
133809
|
{ path: "strand", type: "string" }
|
|
133757
133810
|
]
|
|
133758
133811
|
}),
|
|
133759
|
-
[
|
|
133812
|
+
[]
|
|
133760
133813
|
);
|
|
133761
133814
|
return /* @__PURE__ */ React__default.createElement("div", { className: classNames(Classes.DIALOG_BODY, "tg-min-width-dialog") }, /* @__PURE__ */ React__default.createElement(
|
|
133762
133815
|
WrappedDT,
|
|
@@ -144217,14 +144270,15 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
|
|
|
144217
144270
|
const annotationPropertiesSelectedEntities = _annotationPropertiesSelectedEntities.filter((a2) => annotations[a2.id]);
|
|
144218
144271
|
const deleteAnnotation = props[`delete${annotationTypeUpper}`];
|
|
144219
144272
|
const annotationsToUse = React__default.useMemo(
|
|
144220
|
-
() => map$3(annotations, (
|
|
144273
|
+
() => map$3(annotations, (_annotation) => {
|
|
144274
|
+
const annotation = isProtein2 ? convertDnaCaretPositionOrRangeToAA(_annotation) : _annotation;
|
|
144221
144275
|
return __spreadProps(__spreadValues(__spreadValues({}, annotation), annotation.strand === void 0 && {
|
|
144222
144276
|
strand: annotation.forward ? 1 : -1
|
|
144223
144277
|
}), {
|
|
144224
144278
|
size: getRangeLength(annotation, sequenceLength)
|
|
144225
144279
|
});
|
|
144226
144280
|
}),
|
|
144227
|
-
[annotations, sequenceLength]
|
|
144281
|
+
[annotations, sequenceLength, isProtein2]
|
|
144228
144282
|
);
|
|
144229
144283
|
const keyedPartTags = (_a2 = getKeyedTagsAndTagOptions(allPartTags)) != null ? _a2 : {};
|
|
144230
144284
|
const additionalColumns = ((_c = (_b2 = PropertiesProps == null ? void 0 : PropertiesProps.propertiesList) == null ? void 0 : _b2.find(
|
|
@@ -144294,7 +144348,7 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
|
|
|
144294
144348
|
}, "render")
|
|
144295
144349
|
}
|
|
144296
144350
|
],
|
|
144297
|
-
sizeSchema(
|
|
144351
|
+
sizeSchema(),
|
|
144298
144352
|
...withTags && allPartTags ? [
|
|
144299
144353
|
{
|
|
144300
144354
|
path: "tags",
|
|
@@ -144788,7 +144842,7 @@ const _OrfProperties = class _OrfProperties extends React__default.Component {
|
|
|
144788
144842
|
displayName: "Size (aa)",
|
|
144789
144843
|
type: "number"
|
|
144790
144844
|
},
|
|
144791
|
-
sizeSchema(
|
|
144845
|
+
sizeSchema(),
|
|
144792
144846
|
{ path: "frame", type: "number" },
|
|
144793
144847
|
{ path: "strand", type: "number" }
|
|
144794
144848
|
]
|
package/index.umd.js
CHANGED
|
@@ -46511,6 +46511,23 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
46511
46511
|
if (!isString$1(value) || !new RegExp(conditionValue.replace(/%/g, ".*")).test(value))
|
|
46512
46512
|
return false;
|
|
46513
46513
|
break;
|
|
46514
|
+
case "_in":
|
|
46515
|
+
if (!some(conditionValue, (item) => isEqual$3(value, item)))
|
|
46516
|
+
return false;
|
|
46517
|
+
break;
|
|
46518
|
+
case "_nin":
|
|
46519
|
+
if (some(conditionValue, (item) => isEqual$3(value, item)))
|
|
46520
|
+
return false;
|
|
46521
|
+
break;
|
|
46522
|
+
case "_regex": {
|
|
46523
|
+
try {
|
|
46524
|
+
if (!isString$1(value) || !new RegExp(conditionValue).test(value))
|
|
46525
|
+
return false;
|
|
46526
|
+
} catch (e2) {
|
|
46527
|
+
return false;
|
|
46528
|
+
}
|
|
46529
|
+
break;
|
|
46530
|
+
}
|
|
46514
46531
|
default:
|
|
46515
46532
|
if (operator.startsWith("_")) {
|
|
46516
46533
|
console.warn(`Unsupported operator: ${operator}`);
|
|
@@ -79843,7 +79860,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
79843
79860
|
filterValToUse = false;
|
|
79844
79861
|
} else if (ccSelectedFilter2 === "inList" || ccSelectedFilter2 === "notInList") {
|
|
79845
79862
|
if (dataType === "number") {
|
|
79846
|
-
filterValToUse = filterValue && filterValue.map((val2) => parseFloat(val2
|
|
79863
|
+
filterValToUse = filterValue && filterValue.map((val2) => parseFloat(`${val2}`.replaceAll(",", "")));
|
|
79847
79864
|
}
|
|
79848
79865
|
}
|
|
79849
79866
|
if (isInvalidFilterValue(filterValToUse)) {
|
|
@@ -79949,7 +79966,7 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
79949
79966
|
multi: true,
|
|
79950
79967
|
creatable: true,
|
|
79951
79968
|
value: (filterValue || []).map((val2) => ({
|
|
79952
|
-
label: val2
|
|
79969
|
+
label: `${val2}`,
|
|
79953
79970
|
value: val2
|
|
79954
79971
|
})),
|
|
79955
79972
|
onChange: /* @__PURE__ */ __name((selectedOptions) => {
|
|
@@ -124079,7 +124096,44 @@ ${seq.sequence}
|
|
|
124079
124096
|
return day2 + "-" + month + "-" + year;
|
|
124080
124097
|
}
|
|
124081
124098
|
__name(getCurrentDateString, "getCurrentDateString");
|
|
124099
|
+
const standardLineLength = 79;
|
|
124082
124100
|
function featureNoteInDataToGenbankString(name2, value, options) {
|
|
124101
|
+
const valueString = mangleOrStripUrls(value, options);
|
|
124102
|
+
if (valueString.length > standardLineLength - 25 - name2.length) {
|
|
124103
|
+
const lines = [];
|
|
124104
|
+
let currentIndex = 0;
|
|
124105
|
+
while (currentIndex < valueString.length) {
|
|
124106
|
+
if (currentIndex === 0) {
|
|
124107
|
+
const chunk = valueString.substring(
|
|
124108
|
+
currentIndex,
|
|
124109
|
+
currentIndex + standardLineLength - name2.length - 24
|
|
124110
|
+
);
|
|
124111
|
+
lines.push(
|
|
124112
|
+
StringUtil.lpad("/", " ", 22) + name2 + '="' + chunk + (currentIndex + standardLineLength - 22 - name2.length >= valueString.length ? '"' : "")
|
|
124113
|
+
);
|
|
124114
|
+
currentIndex += standardLineLength - name2.length - 24;
|
|
124115
|
+
} else {
|
|
124116
|
+
const chunk = valueString.substring(
|
|
124117
|
+
currentIndex,
|
|
124118
|
+
currentIndex + standardLineLength - 21
|
|
124119
|
+
);
|
|
124120
|
+
if (currentIndex + standardLineLength - 21 >= valueString.length) {
|
|
124121
|
+
const lineString = " ".repeat(21) + chunk;
|
|
124122
|
+
if (lineString.length === standardLineLength) {
|
|
124123
|
+
lines.push(lineString);
|
|
124124
|
+
lines.push(" ".repeat(21) + '"');
|
|
124125
|
+
} else {
|
|
124126
|
+
lines.push(lineString + '"');
|
|
124127
|
+
}
|
|
124128
|
+
} else {
|
|
124129
|
+
const lineString = " ".repeat(21) + chunk;
|
|
124130
|
+
lines.push(lineString);
|
|
124131
|
+
}
|
|
124132
|
+
currentIndex += standardLineLength - 21;
|
|
124133
|
+
}
|
|
124134
|
+
}
|
|
124135
|
+
return lines.join("\r\n");
|
|
124136
|
+
}
|
|
124083
124137
|
return StringUtil.lpad("/", " ", 22) + name2 + '="' + mangleOrStripUrls(value, options) + '"';
|
|
124084
124138
|
}
|
|
124085
124139
|
__name(featureNoteInDataToGenbankString, "featureNoteInDataToGenbankString");
|
|
@@ -145289,7 +145343,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
145289
145343
|
input.click();
|
|
145290
145344
|
}
|
|
145291
145345
|
__name(showFileDialog, "showFileDialog");
|
|
145292
|
-
const version = "0.8.
|
|
145346
|
+
const version = "0.8.38";
|
|
145293
145347
|
const packageJson = {
|
|
145294
145348
|
version
|
|
145295
145349
|
};
|
|
@@ -154188,14 +154242,13 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
154188
154242
|
};
|
|
154189
154243
|
__name(_ComponentToPrint, "ComponentToPrint");
|
|
154190
154244
|
let ComponentToPrint = _ComponentToPrint;
|
|
154191
|
-
const sizeSchema = /* @__PURE__ */ __name((
|
|
154245
|
+
const sizeSchema = /* @__PURE__ */ __name(() => ({
|
|
154192
154246
|
path: "size",
|
|
154193
154247
|
type: "number",
|
|
154194
|
-
render: /* @__PURE__ */ __name((val2,
|
|
154195
|
-
const record = isProtein2 ? convertDnaCaretPositionOrRangeToAA(_record) : _record;
|
|
154248
|
+
render: /* @__PURE__ */ __name((val2, record) => {
|
|
154196
154249
|
const base1Range = convertRangeTo1Based(record);
|
|
154197
154250
|
const hasJoinedLocations = record.locations && record.locations.length > 1;
|
|
154198
|
-
return /* @__PURE__ */ React.createElement("span", null,
|
|
154251
|
+
return /* @__PURE__ */ React.createElement("span", null, val2, " ", /* @__PURE__ */ React.createElement("span", { style: { fontSize: 10 } }, hasJoinedLocations ? record.locations.map((loc, i2) => {
|
|
154199
154252
|
const base1Range2 = convertRangeTo1Based(loc);
|
|
154200
154253
|
return /* @__PURE__ */ React.createElement("span", { key: i2 }, "(", base1Range2.start, "-", base1Range2.end, ")");
|
|
154201
154254
|
}) : /* @__PURE__ */ React.createElement("span", null, "(", base1Range.start, "-", base1Range.end, ")")));
|
|
@@ -154205,11 +154258,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
154205
154258
|
let lastDeps;
|
|
154206
154259
|
let lastResult;
|
|
154207
154260
|
return (editorState) => {
|
|
154208
|
-
const {
|
|
154209
|
-
sequenceData: sequenceData2,
|
|
154210
|
-
minimumOrfSize: minimumOrfSize2,
|
|
154211
|
-
useAdditionalOrfStartCodons: useAdditionalOrfStartCodons2
|
|
154212
|
-
} = editorState;
|
|
154261
|
+
const { sequenceData: sequenceData2, minimumOrfSize: minimumOrfSize2, useAdditionalOrfStartCodons: useAdditionalOrfStartCodons2 } = editorState;
|
|
154213
154262
|
const { sequence: sequence2, circular: circular2 } = sequenceData2;
|
|
154214
154263
|
const deps = {
|
|
154215
154264
|
sequence: sequence2,
|
|
@@ -160226,6 +160275,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
160226
160275
|
const ignoreName = useFormValue(dialogFormName, "ignoreName");
|
|
160227
160276
|
const ignoreStartAndEnd = useFormValue(dialogFormName, "ignoreStartAndEnd");
|
|
160228
160277
|
const ignoreStrand = useFormValue(dialogFormName, "ignoreStrand");
|
|
160278
|
+
const isProteinSeq = isProtein2 || sequenceData2.isProtein;
|
|
160229
160279
|
const recomputeDups = reactExports.useCallback(
|
|
160230
160280
|
(values2) => {
|
|
160231
160281
|
const ignoreName2 = values2 == null ? void 0 : values2.ignoreName;
|
|
@@ -160234,17 +160284,20 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
160234
160284
|
const annotations = sequenceData2[type2];
|
|
160235
160285
|
const newDups = [];
|
|
160236
160286
|
const seqsHashByStartEndStrandName = {};
|
|
160237
|
-
forEach$1(annotations, (
|
|
160238
|
-
const
|
|
160287
|
+
forEach$1(annotations, (_annotation) => {
|
|
160288
|
+
const annotation = isProteinSeq ? convertDnaCaretPositionOrRangeToAA(_annotation) : _annotation;
|
|
160289
|
+
const hash2 = `${ignoreStartAndEnd2 ? "" : annotation.start}&${ignoreStartAndEnd2 ? "" : annotation.end}&${ignoreStrand2 ? "" : annotation.strand}&${ignoreName2 ? "" : annotation.name}`;
|
|
160239
160290
|
if (seqsHashByStartEndStrandName[hash2]) {
|
|
160240
|
-
newDups.push(__spreadProps(__spreadValues({},
|
|
160291
|
+
newDups.push(__spreadProps(__spreadValues({}, annotation), {
|
|
160292
|
+
size: getRangeLength(annotation, sequenceLength)
|
|
160293
|
+
}));
|
|
160241
160294
|
} else {
|
|
160242
160295
|
seqsHashByStartEndStrandName[hash2] = true;
|
|
160243
160296
|
}
|
|
160244
160297
|
});
|
|
160245
160298
|
return newDups;
|
|
160246
160299
|
},
|
|
160247
|
-
[sequenceData2, sequenceLength, type2]
|
|
160300
|
+
[sequenceData2, sequenceLength, type2, isProteinSeq]
|
|
160248
160301
|
);
|
|
160249
160302
|
const [dups, setDups] = reactExports.useState(recomputeDups);
|
|
160250
160303
|
const selectedIds = reactExports.useMemo(() => dups.map((d2) => d2.id), [dups]);
|
|
@@ -160266,11 +160319,11 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
160266
160319
|
fields: [
|
|
160267
160320
|
{ path: "name", type: "string" },
|
|
160268
160321
|
// ...(noType ? [] : [{ path: "type", type: "string" }]),
|
|
160269
|
-
sizeSchema(
|
|
160322
|
+
sizeSchema(),
|
|
160270
160323
|
{ path: "strand", type: "string" }
|
|
160271
160324
|
]
|
|
160272
160325
|
}),
|
|
160273
|
-
[
|
|
160326
|
+
[]
|
|
160274
160327
|
);
|
|
160275
160328
|
return /* @__PURE__ */ React.createElement("div", { className: classNames$1(DIALOG_BODY, "tg-min-width-dialog") }, /* @__PURE__ */ React.createElement(
|
|
160276
160329
|
WrappedDT,
|
|
@@ -170731,14 +170784,15 @@ ${seqDataToCopy}\r
|
|
|
170731
170784
|
const annotationPropertiesSelectedEntities = _annotationPropertiesSelectedEntities.filter((a2) => annotations[a2.id]);
|
|
170732
170785
|
const deleteAnnotation = props[`delete${annotationTypeUpper}`];
|
|
170733
170786
|
const annotationsToUse = React.useMemo(
|
|
170734
|
-
() => map$3(annotations, (
|
|
170787
|
+
() => map$3(annotations, (_annotation) => {
|
|
170788
|
+
const annotation = isProtein2 ? convertDnaCaretPositionOrRangeToAA(_annotation) : _annotation;
|
|
170735
170789
|
return __spreadProps(__spreadValues(__spreadValues({}, annotation), annotation.strand === void 0 && {
|
|
170736
170790
|
strand: annotation.forward ? 1 : -1
|
|
170737
170791
|
}), {
|
|
170738
170792
|
size: getRangeLength(annotation, sequenceLength)
|
|
170739
170793
|
});
|
|
170740
170794
|
}),
|
|
170741
|
-
[annotations, sequenceLength]
|
|
170795
|
+
[annotations, sequenceLength, isProtein2]
|
|
170742
170796
|
);
|
|
170743
170797
|
const keyedPartTags = (_a2 = getKeyedTagsAndTagOptions(allPartTags)) != null ? _a2 : {};
|
|
170744
170798
|
const additionalColumns = ((_c2 = (_b2 = PropertiesProps == null ? void 0 : PropertiesProps.propertiesList) == null ? void 0 : _b2.find(
|
|
@@ -170808,7 +170862,7 @@ ${seqDataToCopy}\r
|
|
|
170808
170862
|
}, "render")
|
|
170809
170863
|
}
|
|
170810
170864
|
],
|
|
170811
|
-
sizeSchema(
|
|
170865
|
+
sizeSchema(),
|
|
170812
170866
|
...withTags && allPartTags ? [
|
|
170813
170867
|
{
|
|
170814
170868
|
path: "tags",
|
|
@@ -171302,7 +171356,7 @@ ${seqDataToCopy}\r
|
|
|
171302
171356
|
displayName: "Size (aa)",
|
|
171303
171357
|
type: "number"
|
|
171304
171358
|
},
|
|
171305
|
-
sizeSchema(
|
|
171359
|
+
sizeSchema(),
|
|
171306
171360
|
{ path: "frame", type: "number" },
|
|
171307
171361
|
{ path: "strand", type: "number" }
|
|
171308
171362
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ove",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.38",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/TeselaGen/tg-oss",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"@blueprintjs/core": "3.54.0",
|
|
16
16
|
"@hello-pangea/dnd": "16.2.0",
|
|
17
17
|
"@risingstack/react-easy-state": "^6.3.0",
|
|
18
|
-
"@teselagen/bio-parsers": "0.4.
|
|
18
|
+
"@teselagen/bio-parsers": "0.4.36",
|
|
19
19
|
"@teselagen/file-utils": "0.3.23",
|
|
20
20
|
"@teselagen/range-utils": "0.3.20",
|
|
21
21
|
"@teselagen/react-list": "0.8.18",
|
|
22
22
|
"@teselagen/sequence-utils": "0.3.42",
|
|
23
|
-
"@teselagen/ui": "0.10.
|
|
23
|
+
"@teselagen/ui": "0.10.20",
|
|
24
24
|
"@use-gesture/react": "10.3.0",
|
|
25
25
|
"classnames": "^2.3.2",
|
|
26
26
|
"clipboard": "^2.0.11",
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
removeDuplicatesIcon,
|
|
12
12
|
useMemoDeepEqual
|
|
13
13
|
} from "@teselagen/ui";
|
|
14
|
+
import { convertDnaCaretPositionOrRangeToAA } from "@teselagen/sequence-utils";
|
|
14
15
|
import { map, upperFirst, pick, startCase, isFunction } from "lodash-es";
|
|
15
16
|
import {
|
|
16
17
|
AnchorButton,
|
|
@@ -86,7 +87,10 @@ const genericAnnotationProperties = ({
|
|
|
86
87
|
|
|
87
88
|
const annotationsToUse = React.useMemo(
|
|
88
89
|
() =>
|
|
89
|
-
map(annotations,
|
|
90
|
+
map(annotations, _annotation => {
|
|
91
|
+
const annotation = isProtein
|
|
92
|
+
? convertDnaCaretPositionOrRangeToAA(_annotation)
|
|
93
|
+
: _annotation;
|
|
90
94
|
return {
|
|
91
95
|
...annotation,
|
|
92
96
|
...(annotation.strand === undefined && {
|
|
@@ -95,7 +99,7 @@ const genericAnnotationProperties = ({
|
|
|
95
99
|
size: getRangeLength(annotation, sequenceLength)
|
|
96
100
|
};
|
|
97
101
|
}),
|
|
98
|
-
[annotations, sequenceLength]
|
|
102
|
+
[annotations, sequenceLength, isProtein]
|
|
99
103
|
);
|
|
100
104
|
|
|
101
105
|
const keyedPartTags = getKeyedTagsAndTagOptions(allPartTags) ?? {};
|
|
@@ -180,7 +184,7 @@ const genericAnnotationProperties = ({
|
|
|
180
184
|
}
|
|
181
185
|
}
|
|
182
186
|
]),
|
|
183
|
-
sizeSchema(
|
|
187
|
+
sizeSchema(),
|
|
184
188
|
...(withTags && allPartTags
|
|
185
189
|
? [
|
|
186
190
|
{
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { isEqual } from "lodash-es";
|
|
3
|
-
import { convertDnaCaretPositionOrRangeToAA } from "@teselagen/sequence-utils";
|
|
4
3
|
import { convertRangeTo1Based } from "@teselagen/range-utils";
|
|
5
4
|
import selectors from "../../selectors";
|
|
6
5
|
|
|
7
|
-
export const sizeSchema =
|
|
6
|
+
export const sizeSchema = () => ({
|
|
8
7
|
path: "size",
|
|
9
8
|
type: "number",
|
|
10
|
-
render: (val,
|
|
11
|
-
const record = isProtein
|
|
12
|
-
? convertDnaCaretPositionOrRangeToAA(_record)
|
|
13
|
-
: _record;
|
|
9
|
+
render: (val, record) => {
|
|
14
10
|
const base1Range = convertRangeTo1Based(record);
|
|
15
11
|
const hasJoinedLocations = record.locations && record.locations.length > 1;
|
|
16
12
|
|
|
17
13
|
return (
|
|
18
14
|
<span>
|
|
19
|
-
{
|
|
15
|
+
{val}{" "}
|
|
20
16
|
<span style={{ fontSize: 10 }}>
|
|
21
17
|
{hasJoinedLocations ? (
|
|
22
18
|
record.locations.map((loc, i) => {
|
|
@@ -41,12 +37,9 @@ export const sizeSchema = isProtein => ({
|
|
|
41
37
|
export const getMemoOrfs = (() => {
|
|
42
38
|
let lastDeps;
|
|
43
39
|
let lastResult;
|
|
44
|
-
return
|
|
45
|
-
const {
|
|
46
|
-
|
|
47
|
-
minimumOrfSize,
|
|
48
|
-
useAdditionalOrfStartCodons
|
|
49
|
-
} = editorState;
|
|
40
|
+
return editorState => {
|
|
41
|
+
const { sequenceData, minimumOrfSize, useAdditionalOrfStartCodons } =
|
|
42
|
+
editorState;
|
|
50
43
|
|
|
51
44
|
const { sequence, circular } = sequenceData;
|
|
52
45
|
|
|
@@ -14,6 +14,7 @@ import { forEach, camelCase, startCase } from "lodash-es";
|
|
|
14
14
|
import { sizeSchema } from "../PropertiesDialog/utils";
|
|
15
15
|
import { getRangeLength } from "@teselagen/range-utils";
|
|
16
16
|
import { useFormValue } from "../../utils/useFormValue";
|
|
17
|
+
import { convertDnaCaretPositionOrRangeToAA } from "@teselagen/sequence-utils";
|
|
17
18
|
|
|
18
19
|
const dialogFormName = "RemoveDuplicatesDialog";
|
|
19
20
|
const dataTableFormName = "duplicatesToRemove";
|
|
@@ -33,6 +34,7 @@ const RemoveDuplicatesDialog = props => {
|
|
|
33
34
|
const ignoreName = useFormValue(dialogFormName, "ignoreName");
|
|
34
35
|
const ignoreStartAndEnd = useFormValue(dialogFormName, "ignoreStartAndEnd");
|
|
35
36
|
const ignoreStrand = useFormValue(dialogFormName, "ignoreStrand");
|
|
37
|
+
const isProteinSeq = isProtein || sequenceData.isProtein;
|
|
36
38
|
|
|
37
39
|
const recomputeDups = useCallback(
|
|
38
40
|
values => {
|
|
@@ -42,19 +44,25 @@ const RemoveDuplicatesDialog = props => {
|
|
|
42
44
|
const annotations = sequenceData[type];
|
|
43
45
|
const newDups = [];
|
|
44
46
|
const seqsHashByStartEndStrandName = {};
|
|
45
|
-
forEach(annotations,
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
forEach(annotations, _annotation => {
|
|
48
|
+
const annotation = isProteinSeq
|
|
49
|
+
? convertDnaCaretPositionOrRangeToAA(_annotation)
|
|
50
|
+
: _annotation;
|
|
51
|
+
const hash = `${ignoreStartAndEnd ? "" : annotation.start}&${
|
|
52
|
+
ignoreStartAndEnd ? "" : annotation.end
|
|
53
|
+
}&${ignoreStrand ? "" : annotation.strand}&${ignoreName ? "" : annotation.name}`;
|
|
49
54
|
if (seqsHashByStartEndStrandName[hash]) {
|
|
50
|
-
newDups.push({
|
|
55
|
+
newDups.push({
|
|
56
|
+
...annotation,
|
|
57
|
+
size: getRangeLength(annotation, sequenceLength)
|
|
58
|
+
});
|
|
51
59
|
} else {
|
|
52
60
|
seqsHashByStartEndStrandName[hash] = true;
|
|
53
61
|
}
|
|
54
62
|
});
|
|
55
63
|
return newDups;
|
|
56
64
|
},
|
|
57
|
-
[sequenceData, sequenceLength, type]
|
|
65
|
+
[sequenceData, sequenceLength, type, isProteinSeq]
|
|
58
66
|
);
|
|
59
67
|
|
|
60
68
|
const [dups, setDups] = useState(recomputeDups);
|
|
@@ -79,11 +87,11 @@ const RemoveDuplicatesDialog = props => {
|
|
|
79
87
|
fields: [
|
|
80
88
|
{ path: "name", type: "string" },
|
|
81
89
|
// ...(noType ? [] : [{ path: "type", type: "string" }]),
|
|
82
|
-
sizeSchema(
|
|
90
|
+
sizeSchema(),
|
|
83
91
|
{ path: "strand", type: "string" }
|
|
84
92
|
]
|
|
85
93
|
}),
|
|
86
|
-
[
|
|
94
|
+
[]
|
|
87
95
|
);
|
|
88
96
|
|
|
89
97
|
return (
|