Skip to content

Commit

Permalink
merging in master
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Jan 3, 2024
2 parents 5308bba + 9df9f71 commit 04c5445
Show file tree
Hide file tree
Showing 19 changed files with 214 additions and 95 deletions.
48 changes: 24 additions & 24 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### 0.2.0

- Fixed condition for removing * [`#52`](https://github.com/NicolasCARPi/tg-oss/pull/52)
- Removed * aa from dna translation at the end of sequence [`#50`](https://github.com/NicolasCARPi/tg-oss/pull/50)
- export feat locs [`#45`](https://github.com/NicolasCARPi/tg-oss/pull/45)
- unifying sequence filtering so filterSequenceString is always hit and… [`#31`](https://github.com/NicolasCARPi/tg-oss/pull/31)
- fixed genbank file embedded in another genbank comment [`#36`](https://github.com/NicolasCARPi/tg-oss/pull/36)
- fix the ORF start codons label for RNA sequence [`#27`](https://github.com/NicolasCARPi/tg-oss/pull/27)
- adding more null pointer checks for tgSelect, making annotation start… [`#30`](https://github.com/NicolasCARPi/tg-oss/pull/30)
- Fix ove and ui imports for vitest [`#25`](https://github.com/NicolasCARPi/tg-oss/pull/25)
- Reorder tgSelect results [`#20`](https://github.com/NicolasCARPi/tg-oss/pull/20)
- fixing annotation range issue and adding test [`#23`](https://github.com/NicolasCARPi/tg-oss/pull/23)
- add beforeReadOnlyChange handler [`#21`](https://github.com/NicolasCARPi/tg-oss/pull/21)
- disable edit lock while loading [`#15`](https://github.com/NicolasCARPi/tg-oss/pull/15)
- Add tests [`#11`](https://github.com/NicolasCARPi/tg-oss/pull/11)
- editLock Tooltip & onChangeEditLock [`#9`](https://github.com/NicolasCARPi/tg-oss/pull/9)
- use user defined annotationVisibility props at the first place [`#6`](https://github.com/NicolasCARPi/tg-oss/pull/6)
- fix detection of reverse features [`#7`](https://github.com/NicolasCARPi/tg-oss/pull/7)
- support RNA sequence in gb file [`#5`](https://github.com/NicolasCARPi/tg-oss/pull/5)
- CLN-54033: support RNA sequence [`#1`](https://github.com/NicolasCARPi/tg-oss/pull/1)
- Export validateSequenceArray [`#2`](https://github.com/NicolasCARPi/tg-oss/pull/2)
- genbank ss-DNA should not be overwirte to DNA [`#1`](https://github.com/NicolasCARPi/tg-oss/pull/1)
- closes #35 [`#35`](https://github.com/NicolasCARPi/tg-oss/issues/35)
- Make CONTRIBUTING.md a real document [`2539850`](https://github.com/NicolasCARPi/tg-oss/commit/2539850faec88acff5d5109682361e7c8643e25f)
- make links in readme all relative [`b5b775d`](https://github.com/NicolasCARPi/tg-oss/commit/b5b775d1078c6d91ed3f03828ab31c2fab59edd6)
- try with relative link [`e04af75`](https://github.com/NicolasCARPi/tg-oss/commit/e04af75702cb8d0988e3ef147ac5a05328d938e4)
- Fixed condition for removing * [`#52`](https://github.com/TeselaGen/tg-oss/pull/52)
- Removed * aa from dna translation at the end of sequence [`#50`](https://github.com/TeselaGen/tg-oss/pull/50)
- export feat locs [`#45`](https://github.com/TeselaGen/tg-oss/pull/45)
- unifying sequence filtering so filterSequenceString is always hit and… [`#31`](https://github.com/TeselaGen/tg-oss/pull/31)
- fixed genbank file embedded in another genbank comment [`#36`](https://github.com/TeselaGen/tg-oss/pull/36)
- fix the ORF start codons label for RNA sequence [`#27`](https://github.com/TeselaGen/tg-oss/pull/27)
- adding more null pointer checks for tgSelect, making annotation start… [`#30`](https://github.com/TeselaGen/tg-oss/pull/30)
- Fix ove and ui imports for vitest [`#25`](https://github.com/TeselaGen/tg-oss/pull/25)
- Reorder tgSelect results [`#20`](https://github.com/TeselaGen/tg-oss/pull/20)
- fixing annotation range issue and adding test [`#23`](https://github.com/TeselaGen/tg-oss/pull/23)
- add beforeReadOnlyChange handler [`#21`](https://github.com/TeselaGen/tg-oss/pull/21)
- disable edit lock while loading [`#15`](https://github.com/TeselaGen/tg-oss/pull/15)
- Add tests [`#11`](https://github.com/TeselaGen/tg-oss/pull/11)
- editLock Tooltip & onChangeEditLock [`#9`](https://github.com/TeselaGen/tg-oss/pull/9)
- use user defined annotationVisibility props at the first place [`#6`](https://github.com/TeselaGen/tg-oss/pull/6)
- fix detection of reverse features [`#7`](https://github.com/TeselaGen/tg-oss/pull/7)
- support RNA sequence in gb file [`#5`](https://github.com/TeselaGen/tg-oss/pull/5)
- CLN-54033: support RNA sequence [`#1`](https://github.com/TeselaGen/tg-oss/pull/1)
- Export validateSequenceArray [`#2`](https://github.com/TeselaGen/tg-oss/pull/2)
- genbank ss-DNA should not be overwirte to DNA [`#1`](https://github.com/TeselaGen/tg-oss/pull/1)
- closes #35 [`#35`](https://github.com/TeselaGen/tg-oss/issues/35)
- updating table styling to remove table last row bottom margin, removing unused S3Download, removing axios dep, updating deps [`8a6fb1f`](https://github.com/TeselaGen/tg-oss/commit/8a6fb1f047550f617c3e56b8c3ebf145967076ef)
- tiny [`d9a5ad3`](https://github.com/TeselaGen/tg-oss/commit/d9a5ad328d87389199ba39118985f79f6a90b6e0)
- updating linting [`8150150`](https://github.com/TeselaGen/tg-oss/commit/815015023979b1780768e88d061525bc92d135a6)
3 changes: 3 additions & 0 deletions docs/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- please include this @tnrich tag so I get an email :) -->

@tnrich
2 changes: 1 addition & 1 deletion packages/ove/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/ove",
"version": "0.3.63",
"version": "0.4.1",
"main": "./src/index.js",
"exports": {
".": {
Expand Down
4 changes: 3 additions & 1 deletion packages/ove/src/LinearView/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ class _LinearView extends React.Component {
updateLabelsForInViewFeatures();
},
rowContainerStyle: {
height: isNaN(height - 36) ? "auto" : height - 36,
height: isNaN(height - 36)
? "auto"
: height - 36 - (hideName ? 0 : 20),
width: innerWidth + 26,
paddingRight: marginWidth / 2,
...(isLinViewZoomed &&
Expand Down
7 changes: 5 additions & 2 deletions packages/ove/src/LinearView/style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
.veLinearView .veRowItemWrapper {
display: flex;
justify-content: center;
}
.veLinearView.isLinViewZoomed .veRowItemWrapper {
overflow: auto;
}

/* tnw: we had added overflow: auto; only when isLinViewZoomed to prevent the scrollbar from showing up in cases where we didn't want it. We'll need to figure how to prevent the scrollbar from appearing in a different way since we DO need to the scrollbar in certain cases even when isLinViewZoomed=false */
/* .veLinearView.isLinViewZoomed .veRowItemWrapper {
overflow: auto;
} */
.sequenceNameText {
text-align: center;
padding-top: 20px;
Expand Down
Binary file added packages/ove/src/Menlo.ttf
Binary file not shown.
Binary file added packages/ove/src/Monaco.ttf
Binary file not shown.
7 changes: 5 additions & 2 deletions packages/ove/src/RowItem/Axis.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ const Axis = function (props) {
i === 0 //if first label in row, or last label in row, we add checks to make sure the axis number labels don't go outside of the width of the row
? Math.max(positionLength, xCenter)
: i === tickMarkPositions.length - 1
? Math.min(bpsPerRow * charWidth - positionLength, xCenter)
: xCenter;
? Math.min(bpsPerRow * charWidth - positionLength, xCenter)
: xCenter;
}
if (i === tickMarkPositions.length - 1) {
x = Math.min(x, xEnd - positionLength / 2);
}
tickMarkSVG.push(
<text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function PointedAnnotation(props) {
annotation.labelClassName
)}
style={{
fontSize: ".9em",
// fontSize: ".8em",
fill: _textColor
}}
transform={`translate(${textOffset},${height - 2})`}
Expand Down
24 changes: 20 additions & 4 deletions packages/ove/src/style.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
@font-face {
font-family: "Menlo";
src: url("./Menlo.ttf");
font-weight: normal;
font-style: normal;
font-display: block;
}
@font-face {
font-family: "Monaco";
src: url("./Monaco.ttf");
font-weight: normal;
font-style: normal;
font-display: block;
}
.ve-monospace-font {
font-family: Monaco, monospace;
font-size: 11px;
font-family: Menlo, Monaco, monospace;
font-size: 10px;
}
.rowViewTextContainer text {
user-select: none;
}
.translationLayer text {
.translationLayer text,
.tg-prime-direction,
.sequenceNameText,
.veAxis text {
user-select: none;
}
.ve-sequence-reverse {
fill: #b0b0b0;
}

.veCircularView .ve-monospace-font {
font-family: "Lucida Console", Monaco, monospace;
font-size: 14px;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/sequence-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/sequence-utils",
"version": "0.3.15",
"version": "0.3.17",
"type": "commonjs",
"dependencies": {
"bson-objectid": "^2.0.4",
Expand Down
58 changes: 37 additions & 21 deletions packages/sequence-utils/src/filterSequenceString.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
import { debounce, uniq } from "lodash";
import {
ambiguous_dna_letters,
ambiguous_rna_letters,
extended_protein_letters
} from "./bioData";

let allWarnings = [];

let makeToast = () => {
if (typeof window !== "undefined" && window.toastr && allWarnings.length) {
window.toastr.warning(allWarnings.join("\n"));
}
allWarnings = [];
};

makeToast = debounce(makeToast, 200);

function showWarnings(warnings) {
allWarnings = allWarnings.concat(warnings);
makeToast.cancel();
makeToast();
}

export default function filterSequenceString(
sequenceString = "",
{
Expand Down Expand Up @@ -62,16 +80,12 @@ export default function filterSequenceString(
warnings.push(
`${
name ? `Sequence ${name}: ` : ""
}Invalid character(s) detected and removed: ${invalidChars
}Invalid character(s) detected and removed: ${uniq(invalidChars)
.slice(0, 100)
.join(", ")} `
);
}
if (typeof window !== "undefined" && window.toastr && warnings.length) {
warnings.forEach(warning => {
window.toastr.warning(warning);
});
}
showWarnings(warnings);

return [sanitizedVal, warnings];
}
Expand All @@ -85,13 +99,15 @@ export function getAcceptedChars({
return isProtein
? `${extended_protein_letters.toLowerCase()}}`
: isOligo
? ambiguous_rna_letters.toLowerCase() + "t"
: isRna
? ambiguous_rna_letters.toLowerCase() + "t"
: isMixedRnaAndDna
? ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase()
: //just plain old dna
ambiguous_rna_letters.toLowerCase() + ambiguous_dna_letters.toLowerCase();
? ambiguous_rna_letters.toLowerCase() + "t"
: isRna
? ambiguous_rna_letters.toLowerCase() + "t"
: isMixedRnaAndDna
? ambiguous_rna_letters.toLowerCase() +
ambiguous_dna_letters.toLowerCase()
: //just plain old dna
ambiguous_rna_letters.toLowerCase() +
ambiguous_dna_letters.toLowerCase();
}
export function getReplaceChars({
isOligo,
Expand All @@ -102,14 +118,14 @@ export function getReplaceChars({
return isProtein
? {}
: // {".": "*"}
isOligo
? {}
: isRna
? { t: "u" }
: isMixedRnaAndDna
? {}
: //just plain old dna
{};
isOligo
? {}
: isRna
? { t: "u" }
: isMixedRnaAndDna
? {}
: //just plain old dna
{};
}

export const filterRnaString = (s, o) =>
Expand Down
14 changes: 4 additions & 10 deletions packages/sequence-utils/src/filterSequenceString.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,17 @@ describe("filterSequenceString", () => {
});
expect(str).toBe("tatuuaga");
// expect(warnings[0]).toBe('Replaced "t" with "u" 2 times');
expect(warnings[0]).toBe(
"Invalid character(s) detected and removed: -, - "
);
expect(warnings[0]).toBe("Invalid character(s) detected and removed: - ");
});
it("should not convert u's to t's for isDna (default isDna=true) seqs", () => {
const [str, warnings] = filterSequenceString("tatuuag--a", {});
// expect(warnings[0]).toBe('Replaced "u" with "t" 2 times');
expect(warnings[0]).toBe(
"Invalid character(s) detected and removed: -, - "
);
expect(warnings[0]).toBe("Invalid character(s) detected and removed: - ");
expect(str).toBe("tatuuaga");
});
it("should filter out unwanted chars", () => {
const [str, warnings] = filterSequenceString("tatag--a");
expect(warnings[0]).toBe(
"Invalid character(s) detected and removed: -, - "
);
expect(warnings[0]).toBe("Invalid character(s) detected and removed: - ");
expect(str).toBe("tataga");
});
it("should handle additional chars option", () => {
Expand All @@ -51,7 +45,7 @@ describe("filterSequenceString", () => {
);
// expect(warnings[0]).toBe(`Replaced "." with "*" 2 times`);
expect(warnings[0]).toBe(
'Invalid character(s) detected and removed: 3, 4, 2, ", ", ", ,, ,, ., ., / '
'Invalid character(s) detected and removed: 3, 4, 2, ", ,, ., / '
);
expect(str).toBe("bbbxtgalmfwkqespvicyhrnd");
});
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/ui",
"version": "0.3.55",
"version": "0.3.62",
"main": "./src/index.js",
"exports": {
".": {
Expand Down
46 changes: 27 additions & 19 deletions packages/ui/src/DataTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class DataTable extends React.Component {
constructor(props) {
super(props);
if (this.props.helperProp) {
this.props.helperProp.updateValidationHelper =
this.updateValidationHelper;
this.props.helperProp.addEditableTableEntities =
this.addEditableTableEntities;
this.props.helperProp.getEditableTableInfoAndThrowFormError =
Expand Down Expand Up @@ -797,18 +799,21 @@ class DataTable extends React.Component {
});
}
};
updateValidationHelper = () => {
const { entities, reduxFormCellValidation } = computePresets(this.props);
this.updateValidation(entities, reduxFormCellValidation);
};

updateValidation = (entities, newCellValidate) => {
const { change, schema } = computePresets(this.props);
change(
"reduxFormCellValidation",
validateTableWideErrors({
entities,
schema,
newCellValidate,
props: this.props
})
);
const tableWideErr = validateTableWideErrors({
entities,
schema,
newCellValidate,
props: this.props
});
change("reduxFormCellValidation", tableWideErr);
this.forceUpdate();
};
handleDeleteCell = () => {
const {
Expand Down Expand Up @@ -943,7 +948,9 @@ class DataTable extends React.Component {
// keep this so that pasting into spreadsheets works.
format: "text/plain"
});
window.toastr.success(message);
if (message) {
window.toastr.success(message);
}
};

handleCopyTable = e => {
Expand Down Expand Up @@ -1244,8 +1251,8 @@ class DataTable extends React.Component {
compactClassName += extraCompact
? " tg-extra-compact-table"
: compact
? " tg-compact-table"
: "";
? " tg-compact-table"
: "";

const hasFilters =
filters.length ||
Expand Down Expand Up @@ -1534,10 +1541,10 @@ class DataTable extends React.Component {
const nextCellId = up
? cellIdAbove
: down
? cellIdBelow
: left
? cellIdToLeft
: cellIdToRight;
? cellIdBelow
: left
? cellIdToLeft
: cellIdToRight;

e.stopPropagation();
e.preventDefault();
Expand Down Expand Up @@ -1745,8 +1752,8 @@ class DataTable extends React.Component {
extraCompact
? itemSizeEstimators.compact
: compact
? itemSizeEstimators.normal
: itemSizeEstimators.comfortable
? itemSizeEstimators.normal
: itemSizeEstimators.comfortable
}
TfootComponent={() => {
return <button>hasdfasdf</button>;
Expand Down Expand Up @@ -2027,7 +2034,8 @@ class DataTable extends React.Component {
this.startCellEdit(cellId);
},
...(err && {
"data-tip": err?.message || err
"data-tip": err?.message || err,
"data-no-child-data-tip": true
}),
onContextMenu: e => {
if (!isPrimarySelected) {
Expand Down
Loading

0 comments on commit 04c5445

Please sign in to comment.