Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #12 from i-VRESSE/structure-table
Browse files Browse the repository at this point in the history
Structure table
  • Loading branch information
sverhoeven authored Feb 15, 2024
2 parents bfb5b5e + 9c1c0b1 commit 0c389b0
Show file tree
Hide file tree
Showing 17 changed files with 998 additions and 801 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish
- run: |
if [[ $GITHUB_REF_NAME == *next* ]]; then
npm publish --tag next
else
npm publish
fi
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Generated `dist/` folder.
Create [GitHub release](https://github.com/i-VRESSE/haddock3-analysis-components/releases/new),
which will trigger a [GitHub action](.github/workflows/publish.yml) that publishes the package to npmjs.

To publish a pre-release version, create a release with a tag like `1.0.0-next.0` and check the pre-release checkbox.

## Development

```bash
Expand Down
225 changes: 157 additions & 68 deletions example.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,78 +24,167 @@
import { createElement } from "react";
import { ClusterTable } from "@i-vresse/haddock3-analysis-components";

const clusters = {
0: {
rank: "Unclustered",
id: "-",
const clusters = [
{
rank: 1,
id: 1,
size: 5,
stats: {
"HADDOCK score [a.u.]": {
mean: -5.856,
std: 1.544,
},
"interface RMSD [A]": {
mean: 1.808,
std: 0.534,
},
"Fraction of Common Contacts": {
mean: 0.569,
std: 0.242,
},
"ligand RMSD [A]": {
mean: 5.072,
std: 2.254,
},
DOCKQ: {
mean: 0.581,
std: 0.183,
},
"Restraints Energy": {
mean: 847.545,
std: 208.466,
},
"Desolvation Energy": {
mean: 11.665,
std: 3.461,
},
"Electrostatic Energy": {
mean: -9.693,
std: 3.323,
},
"Van der Waals Energy": {
mean: -2.978,
std: 9.166,
},
},
best: {
"Nr 01 best structure": "./src/examples/target.pdb",
"Nr 02 best structure": "./src/examples/target.pdb",
"Nr 03 best structure": "./src/examples/target.pdb",
"Nr 04 best structure": "./src/examples/target.pdb",
"Nr 05 best structure": "./src/examples/target.pdb",
score: {
mean: -5.86,
std: 1.54,
},
irmsd: {
mean: 1.81,
std: 0.53,
},
fnat: {
mean: 0.57,
std: 0.24,
},
lrmsd: {
mean: 5.07,
std: 2.25,
},
dockq: {
mean: 0.58,
std: 0.18,
},
air: {
mean: 847.55,
std: 208.47,
},
desolv: {
mean: 11.67,
std: 3.46,
},
elec: {
mean: -9.69,
std: 3.32,
},
vdw: {
mean: -2.98,
std: 9.17,
},
ilrmsd: {
mean: -2.98,
std: 9.17,
},
bsa: {
mean: -2.98,
std: 9.17,
},
// cluster_1_model_1.pdb.gz is result of haddock3 docking-protein-glycan example
best1: "/src/examples/cluster_1_model_1.pdb.gz",
// cluster_1_model_2.pdb.gz is result of haddock3 docking-antibody-antigen example
best2: "/src/examples/cluster_2_model_1.pdb.gz",
best3: "/src/examples/target.pdb",
best4: "/src/examples/target.pdb",
},
};
{
rank: 2,
id: 2,
size: 10,
score: {
mean: -6.12,
std: 1.23,
},
irmsd: {
mean: 1.23,
std: 0.57,
},
fnat: {
mean: 0.46,
std: 0.79,
},
lrmsd: {
mean: 4.32,
std: 2.35,
},
dockq: {
mean: 0.99,
std: 0.65,
},
air: {
mean: 765.43,
std: 321.1,
},
desolv: {
mean: 9.88,
std: 5.43,
},
elec: {
mean: -8.77,
std: 4.32,
},
vdw: {
mean: -1.23,
std: 8.77,
},
ilrmsd: {
mean: -1.34,
std: 0,
},
bsa: {
mean: -2.978,
std: 0,
},
best1: "/src/examples/target.pdb",
best2: "/src/examples/target.pdb",
best3: "/src/examples/target.pdb",
best4: "/src/examples/target.pdb",
},
];

const headers = {
rank: "Cluster Rank",
id: "Cluster ID",
size: "Cluster size",
"HADDOCK score [a.u.]": "HADDOCK score [a.u.]",
"interface RMSD [A]": "interface RMSD [A]",
"Fraction of Common Contacts": "Fraction of Common Contacts",
"ligand RMSD [A]": "ligand RMSD [A]",
DOCKQ: "DOCKQ",
"Restraints Energy": "Restraints Energy",
"Desolvation Energy": "Desolvation Energy",
"Electrostatic Energy": "Electrostatic Energy",
"Van der Waals Energy": "Van der Waals Energy",
"Nr 01 best structure": "Nr 01 best structure",
"Nr 02 best structure": "Nr 02 best structure",
"Nr 03 best structure": "Nr 03 best structure",
"Nr 04 best structure": "Nr 04 best structure",
"Nr 05 best structure": "Nr 05 best structure",
};
export const headers = [
{
key: "id",
label: "ID",
},
{
key: "rank",
label: "Rank",
sorted: "asc",
},
{
key: "n",
label: "Size",
},
{ key: "score", label: "HADDOCK score [a.u.]", type: "stats" },
{ key: "vdw", label: "Van der Waals Energy", type: "stats" },
{ key: "elec", label: "Electrostatic Energy", type: "stats" },
{ key: "air", label: "Restraints Energy", type: "stats" },
{ key: "desolv", label: "Desolvation Energy", type: "stats" },
{ key: "irmsd", label: "interface RMSD [A]", type: "stats" },
{ key: "lrmsd", label: "ligand RMSD [A]", type: "stats" },
{ key: "ilrmsd", label: "interface-ligand RMSD [A]", type: "stats" },
{ key: "fnat", label: "Fraction of Common Contacts", type: "stats" },
{ key: "dockq", label: "DOCKQ", type: "stats" },
{ key: "bsa", label: "Buried Surface Area [A^2]", type: "stats" },
{
key: "best1",
label: "Nr 01 best structure",
type: "structure",
sortable: false,
},
{
key: "best2",
label: "Nr 02 best structure",
type: "structure",
sortable: false,
},
{
key: "best3",
label: "Nr 03 best structure",
type: "structure",
sortable: false,
},
{
key: "best4",
label: "Nr 04 best structure",
type: "structure",
sortable: false,
},
];

createRoot(document.getElementById("root")).render(
createElement(ClusterTable, { headers, clusters })
Expand Down
Loading

0 comments on commit 0c389b0

Please sign in to comment.