Skip to content

Commit

Permalink
chore: merging in master
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed May 6, 2024
2 parents d5d24bf + df37053 commit 8b83f4f
Show file tree
Hide file tree
Showing 21 changed files with 135 additions and 239 deletions.
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "nx",
"project": "",
"command": "run-many",
"flags": [
"--target=publish",
"--projects=bio-parsers,ove,sequence-utils,ui"
],
"problemMatcher": [],
"label": "nx: nx run-many --target=publish --projects=bio-parsers,ove,sequence-utils,ui"
}
]
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Added fix for clipboard commands when there are multiple editors on a page to resolve https://github.com/TeselaGen/tg-oss/issues/24 [`#24`](https://github.com/TeselaGen/tg-oss/issues/24)
- closes #35 [`#35`](https://github.com/TeselaGen/tg-oss/issues/35)
- updating yarn lock [`ff41df0`](https://github.com/TeselaGen/tg-oss/commit/ff41df0b49b8051fcba084f7eaa44cf23284926d)
- 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)
- unifying the ui and ove demos [`f23237d`](https://github.com/TeselaGen/tg-oss/commit/f23237d4185830d94f362cbd1dae527ab59ad623)
- Add example file [`79f356f`](https://github.com/TeselaGen/tg-oss/commit/79f356faac0dc5fa0afc882eccdbf9ed5f41d047)
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"react-measure": "^2.5.2",
"react-redux": "^8.0.5",
"react-rnd": "^10.2.4",
"react-router-dom": "^4.3.1",
"react-router-dom": "^5.3.4",
"react-sizeme": "^2.6.12",
"react-sortable-hoc": "^0.6.8",
"react-transition-group": "^2.4.0",
Expand Down Expand Up @@ -155,15 +155,14 @@
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-libcss": "^1.1.1",
"vite-plugin-static-copy": "^0.17.0",
"vite-plugin-virtual-html": "^1.1.10",
"vite-tsconfig-paths": "^4.2.1",
"vitest": "^0.34.6"
},
"workspaces": [
"packages/*"
],
"volta": {
"node": "16.20.2",
"node": "18.17.0",
"yarn": "1.22.21"
}
}
2 changes: 1 addition & 1 deletion packages/bio-parsers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teselagen/bio-parsers",
"version": "0.4.10",
"version": "0.4.15",
"type": "commonjs",
"dependencies": {
"@gmod/gff": "^1.2.1",
Expand Down
11 changes: 11 additions & 0 deletions packages/bounce-loader/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>bounce-loader demo</title>
<script src="./demo/index.js" type="module"></script>
</head>
<body>
<div id="demo"></div>
</body>
</html>
6 changes: 3 additions & 3 deletions packages/ove/cypress/e2e/proteinEditor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ describe("proteinEditor", function () {
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(0);
cy.get(".sequenceInputBubble input").type("{enter}");
cy.contains("Selecting 6 AAs from 1 to 6");
cy.contains("Length: 1391 AAs");
cy.contains("Selecting 7 AAs from 1 to 7");
cy.contains("Length: 1392 AAs");
cy.get(`[data-test="ve-find-tool-toggle"]`).click().focused().type("ma");

cy.get(`[title="Selecting 2 AAs from 1 to 2"]`).should("exist");
cy.get(`[title="Selecting 2 AAs from 2 to 3"]`).should("exist");
});
it(`should be able to delete correctly when backspace/del pressed`, () => {
cy.contains(".veRowViewPrimaryProteinSequenceContainer svg g", "M").click({
Expand Down
14 changes: 10 additions & 4 deletions packages/ove/demo/src/SimpleCircularOrLinearViewDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default class SimpleCircularOrLinearViewDemo extends React.Component {
})}
{renderToggle({ that: this, type: "togglePartColor" })}
{renderToggle({ that: this, type: "isOligo" })}
{renderToggle({ that: this, type: "isProtein" })}
{renderToggle({
that: this,
type: "toggleNoRedux",
Expand Down Expand Up @@ -126,21 +127,26 @@ export default class SimpleCircularOrLinearViewDemo extends React.Component {
size: this.state.superLongSequence
? 1640
: this.state.limitLengthTo50Bps
? 50
: 164
? 50
: 164
}
: {
sequence: this.state.superLongSequence
? "GGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacacccccc"
: this.state.limitLengthTo50Bps
? "GGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAaga"
: "GGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacacccccc"
? "GGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAaga"
: "GGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacaccccccGGGAAAagagagtgagagagtagagagagaccacacccccc"
}),
...(this.state.isOligo
? {
isOligo: true
}
: {}),
...(this.state.isProtein
? {
isProtein: true
}
: {}),
name: "Test Seq",
circular: this.state.circular, //toggle to true to change this!
features: [
Expand Down
5 changes: 1 addition & 4 deletions packages/ove/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{
"name": "@teselagen/ove",
"version": "0.4.6",
"version": "0.4.10",
"main": "./src/index.js",
"exports": {
".": {
"import": "./index.es.js",
"require": "./index.cjs.js"
},
"./style.css": "./style.css"
},
"volta": {
"node": "16.20.2"
}
}
7 changes: 5 additions & 2 deletions packages/ove/src/withEditorInteractions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ function VectorInteractionHOC(Component /* options */) {
}
}
),
{ doNotRemoveInvalidChars: true, annotationsAsObjects: true }
{
doNotRemoveInvalidChars: true,
annotationsAsObjects: true,
includeProteinSequence: true
}
);

if (
Expand All @@ -308,7 +312,6 @@ function VectorInteractionHOC(Component /* options */) {
: seqData.sequence;

seqData.textToCopy = textToCopy;

clipboardData.setData("text/plain", textToCopy);
clipboardData.setData("application/json", JSON.stringify(seqData));
e.preventDefault();
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.19",
"version": "0.3.24",
"type": "commonjs",
"dependencies": {
"bson-objectid": "^2.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/sequence-utils/src/bioData.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export const protein_letters = "ACDEFGHIKLMNPQRSTVWY";
export const protein_letters_withUandX = "ACDEFGHIKLMNPQRSTVWYUX";
export const extended_protein_letters = "ACDEFGHIKLMNPQRSTVWYBXZJUO";
export const extended_protein_letters = "ACDEFGHIKLMNPQRSTVWYBXZJUO*";
export const ambiguous_dna_letters = "GATCRYWSMKHBVDN";
export const unambiguous_dna_letters = "GATC";
export const ambiguous_rna_letters = "GAUCRYWSMKHBVDN";
Expand Down
2 changes: 1 addition & 1 deletion packages/sequence-utils/src/filterSequenceString.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ describe("filterSequenceString", () => {
}
);

expect(str).toBe("BXZJUObbbxtgalbmfwkqespvicyhrnd");
expect(str).toBe("BXZJUO*bbbxtgalbmfwkqespvicyhrnd");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ describe("insertSequenceData", () => {
postInsertSeq.sequence.should.equal("atgatagatagggagaaa");
postInsertSeq.proteinSequence.should.equal("MIDREK");
});
it("inserts protein seq into a dna seq correctly", () => {
const sequenceToInsert = {
isProtein: true,
sequence: "atagatagg",
proteinSequence: "IDR"
};
const sequenceToInsertInto = {
// 012345
isProtein: false,
sequence: "atgagagagaaa",
proteinSequence: "MREK"
};
const range = { start: 3, end: 5 };
const postInsertSeq = insertSequenceDataAtPositionOrRange(
sequenceToInsert,
sequenceToInsertInto,
range
);
postInsertSeq.sequence.should.equal("atgatagatagggagaaa");
postInsertSeq.isProtein.should.equal(false);
postInsertSeq.proteinSequence.should.equal("MIDREK");
});
it("inserts characters at correct range and computes the new size correctly", () => {
const sequenceToInsert = {
sequence: "rrrrrrr"
Expand Down
9 changes: 8 additions & 1 deletion packages/sequence-utils/src/tidyUpSequenceData.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import filterSequenceString from "./filterSequenceString";
import tidyUpAnnotation from "./tidyUpAnnotation";
import getDegenerateDnaStringFromAaString from "./getDegenerateDnaStringFromAAString";
import { getFeatureTypes } from "./featureTypesAndColors";
import getAminoAcidStringFromSequenceString from "./getAminoAcidStringFromSequenceString";

export default function tidyUpSequenceData(pSeqData, options = {}) {
const {
Expand All @@ -16,6 +17,7 @@ export default function tidyUpSequenceData(pSeqData, options = {}) {
doNotRemoveInvalidChars,
additionalValidChars,
noTranslationData,
includeProteinSequence,
doNotProvideIdsForAnnotations,
noCdsTranslations,
convertAnnotationsFromAAIndices,
Expand Down Expand Up @@ -55,7 +57,8 @@ export default function tidyUpSequenceData(pSeqData, options = {}) {
if (!doNotRemoveInvalidChars) {
if (seqData.isProtein) {
const [newSeq] = filterSequenceString(seqData.proteinSequence, {
...(topLevelSeqData || seqData)
...(topLevelSeqData || seqData),
isProtein: true
});
seqData.proteinSequence = newSeq;
} else {
Expand All @@ -79,6 +82,10 @@ export default function tidyUpSequenceData(pSeqData, options = {}) {
null,
true
);
} else if (includeProteinSequence) {
seqData.proteinSequence = getAminoAcidStringFromSequenceString(
seqData.sequence
);
}

seqData.size = seqData.noSequence ? seqData.size : seqData.sequence.length;
Expand Down
14 changes: 7 additions & 7 deletions packages/sequence-utils/src/tidyUpSequenceData.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ describe("tidyUpSequenceData", () => {
res.should.containSubset({
aminoAcidDataForEachBaseOfDNA: [],
isProtein: true,
size: 54, //size should refer to the DNA length
proteinSize: 18, //proteinSize should refer to the amino acid length
sequence: "ggngcnggnathtgacaytggggngcnggngcnytngcnwsnhtnggnytnhtn", //degenerate sequence
proteinSequence: "gagiuhwgagalasjglj",
size: 57, //size should refer to the DNA length
proteinSize: 19, //proteinSize should refer to the amino acid length
sequence: "ggngcnggnathtgacaytggggngcnggngcnytngcnwsnhtnggnytnhtntrr", //degenerate sequence
proteinSequence: "gagiuhwgagalasjglj*",
circular: false,
features: [
{ start: 9, end: 32, forward: true },
{ start: 30, end: 53, forward: true },
{ start: 30, end: 56, forward: true },
{
name: "iDon'tFit",
start: 51,
end: 53,
start: 54,
end: 56,
forward: true
}
]
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.79",
"version": "0.3.83",
"main": "./src/index.js",
"exports": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/DataTable/utils/queryParams.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ export function getQueryParams({
console.error(
"No schema for field found!",
ccDisplayName,
schema.fields
JSON.stringify(schema.fields, null, 2)
);
}
});
Expand Down
5 changes: 4 additions & 1 deletion packages/ui/src/toastr.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ const generateToast = intent => (message, options) => {
timeout:
options.timeout ||
updatedTimeout ||
(!window.Cypress && intent === Intent.DANGER ? 60000 : undefined),
(!window.Cypress &&
(intent === Intent.DANGER || intent === Intent.WARNING)
? 60000
: undefined),
action: options.action,
icon: options.icon,
className: classNames("preserve-newline", options.className)
Expand Down
4 changes: 2 additions & 2 deletions tools/scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,5 @@ execSync(
`npm publish --access public --registry https://registry.npmjs.org/ --tag ${tag}`
);

execSync(`git commit -am "chore: publish ${name}@${version}"`);
execSync(`git push`);
// execSync(`git commit -am "chore: publish ${name}@${version}"`);
// execSync(`git push`);
15 changes: 1 addition & 14 deletions vite.react.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import fs from "node:fs";
import react from "@vitejs/plugin-react";
import viteTsConfigPaths from "vite-tsconfig-paths";
import * as esbuild from "esbuild";
// import vitePluginVirtualHtml from "vite-plugin-virtual-html";
import libCss from "vite-plugin-libcss";
import { camelCase } from "lodash";
import { getPort } from "./getPort";
Expand Down Expand Up @@ -87,19 +86,7 @@ export default ({ name }: { name: string; dir: string }) =>
]
})
]
: [
// vitePluginVirtualHtml({
// pages: {
// index: {
// entry: "./demo/index.js", // MUST
// title: `${name} demo`, // optional, default: ''
// body: `
// <div id="demo"></div>
// ` // optional, default: '<div id="app"></div>'
// }
// }
// })
])
: [])
],
esbuild: {
loader: "jsx",
Expand Down
Loading

0 comments on commit 8b83f4f

Please sign in to comment.