Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Sep 18, 2023
1 parent 857e62f commit c0c5eef
Show file tree
Hide file tree
Showing 14 changed files with 1,519 additions and 1,391 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unused-vars": ["warn"],
"@typescript-eslint/no-floating-promises": "error",
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

A multiple sequence alignment viewer


## Docs

See [user guide](docs/user_guide.md)
Expand All @@ -20,7 +19,6 @@ This page is a deployment of the `app` directory in this repo, which uses the

![](docs/media/image15.png)


## Developers

The lib folder contains the NPM package, and the `app` folder contains an
Expand Down
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
18 changes: 10 additions & 8 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,25 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
"preview": "vite preview",
"predeploy": "npm run build",
"deploy": "gh-pages -d dist"
},
"dependencies": {
"@emotion/react": "^11.10.8",
"@emotion/styled": "^11.10.8",
"@jbrowse/core": "^2.4.2",
"@mui/material": "^5.12.3",
"@mui/x-data-grid": "^5.0.0",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@mui/x-data-grid": "^6.14.0",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
"@types/jest": "^29.5.1",
"@types/node": "^18.16.3",
"@types/node": "^20.6.2",
"buffer": "^6.0.3",
"gh-pages": "^5.0.0",
"gh-pages": "^6.0.0",
"mobx": "^6.9.0",
"mobx-react": "^7.6.0",
"mobx-react": "^9.0.1",
"mobx-state-tree": "5.1.8",
"ngl": "^2.0.0",
"react": "^18.2.0",
Expand Down
10 changes: 7 additions & 3 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"node": ">=10"
},
"scripts": {
"lint": "eslint src",
"clean": "rimraf dist",
"prebuild": "npm run clean",
"prepublishOnly": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
Expand All @@ -33,7 +32,7 @@
"react-dom": ">=16.8.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-replace": "^5.0.2",
Expand All @@ -49,11 +48,16 @@
"typescript": "^5.0.4"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"clustal-js": "^1.0.3",
"color": "^3.1.3",
"color": "^4.2.3",
"copy-to-clipboard": "^3.3.1",
"d3-array": "^3.2.3",
"d3-hierarchy": "^3.1.2",
"eslint": "^8.39.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-react": "^7.32.2",
"normalize-wheel": "^1.0.1",
"rbush": "^3.0.1",
"stockholm-js": "^1.0.10",
Expand Down
10 changes: 9 additions & 1 deletion lib/src/components/MSAView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@ const MouseoverCanvas = observer(function ({ model }: { model: MsaViewModel }) {
ctx.fillStyle = 'rgba(100,100,100,0.5)'
ctx.fillRect(x, 0, colWidth, height)
}
}, [mouseCol, colWidth, scrollX, height, resizeHandleWidth, treeAreaWidth, width])
}, [
mouseCol,
colWidth,
scrollX,
height,
resizeHandleWidth,
treeAreaWidth,
width,
])

return (
<canvas
Expand Down
36 changes: 17 additions & 19 deletions lib/src/components/TreeCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,23 @@ const TreeMenu = observer(function ({
)
})}

{
// @ts-expect-error
nodeDetails?.data.accession?.map((accession: string) => (
<MenuItem
dense
key={accession}
onClick={() => {
model.addUniprotTrack({
// @ts-expect-error
name: nodeDetails?.data.name,
accession,
})
onClose()
}}
>
Open UniProt track ({accession})
</MenuItem>
))
}
{// @ts-expect-error
nodeDetails?.data.accession?.map((accession: string) => (
<MenuItem
dense
key={accession}
onClick={() => {
model.addUniprotTrack({
// @ts-expect-error
name: nodeDetails?.data.name,
accession,
})
onClose()
}}
>
Open UniProt track ({accession})
</MenuItem>
))}
</Menu>
</>
)
Expand Down
1 change: 0 additions & 1 deletion lib/src/components/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export function makeTicks(
}

if (bpPerPx < 0) {
// eslint-disable-next-line @typescript-eslint/no-extra-semi
;[minBase, maxBase] = [maxBase, minBase]

Check failure on line 58 in lib/src/components/util.ts

View workflow job for this annotation

GitHub Actions / Test and typecheck on node 16.x and ubuntu-latest

Unnecessary semicolon
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/parseNewick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function parse(s: string) {
tree = subtree
break
case ',': // another branch
ancestors[ancestors.length - 1].branchset.push(subtree)
ancestors.at(-1)?.branchset.push(subtree)
tree = subtree
break
case ')': // optional name next
Expand Down
2 changes: 1 addition & 1 deletion lib/src/parsers/FastaMSA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function parseSmallFasta(text: string) {
const [id, ...description] = defLine.split(' ')
const descriptionStr = description.join(' ')
const seqLinesStr = seqLines.join('')
const sequence = seqLinesStr.replace(/\s/g, '')
const sequence = seqLinesStr.replaceAll(/\s/g, '')
return { id, description: descriptionStr, sequence }
})
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/parsers/StockholmMSA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class StockholmMSA {
return { id, pdb, chain, startPos, endPos }
})

const ret = {} as Record<string, Omit<typeof args[0], 'id'>[]>
const ret = {} as Record<string, Omit<(typeof args)[0], 'id'>[]>
for (const entry of args) {
const { id, ...rest } = entry
if (!ret[id]) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "2.0.0";
export const version = '2.0.0'
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@
"app"
],
"scripts": {
"predeploy": "cd lib; npm run build",
"deploy": "cd app; npm run deploy",
"lint": "eslint --report-unused-disable-directives --max-warnings 0 --ext .js,.ts,.jsx,.tsx .",
"predopublish": "cd lib; yarn build",
"dopublish": "cd lib; yarn publish"
"lint": "eslint --report-unused-disable-directives --max-warnings 0 --ext .js,.ts,.jsx,.tsx ."
},
"devDependencies": {
"@types/rbush": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"eslint": "^8.39.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unicorn": "^46.0.0"
"eslint-plugin-unicorn": "^48.0.1",
"prettier": "^3.0.3"
}
}
Loading

0 comments on commit c0c5eef

Please sign in to comment.