open-index/open-npm huggingface dataset:
npm package: @i-vresse/haddock3-analysis-components
Description: React components for Haddock3 analysis
Latest version: 0.4.5

# React components for Haddock3 analysis

[![Research Software Directory Badge](https://img.shields.io/badge/rsd-00a3e3.svg)](https://research-software-directory.org/software/haddock3-analysis-components)
[![npmjs.com](https://img.shields.io/npm/v/@i-vresse/haddock3-analysis-components.svg?style=flat)](https://www.npmjs.com/package/@i-vresse/haddock3-analysis-components)
[![Node.js CI](https://github.com/i-VRESSE/haddock3-analysis-components/actions/workflows/ci.yml/badge.svg)](https://github.com/i-VRESSE/haddock3-analysis-components/actions/workflows/ci.yml)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10522421.svg)](https://doi.org/10.5281/zenodo.10522421)

Components used in the report.html generated by the [haddock3-analyse](https://github.com/haddocking/haddock3/blob/main/src/haddock/clis/cli_analyse.py) command.

## Installation

```bash
npm install @i-vresse/haddock3-analysis-components
```

## Usage

See [example.html](example.html) for a simple example which uses the latest library from npm using https://esm.sh/ for libray hosting.

See [example.local.html](example.local.html) for a simple example which uses the library from local `dist/` folder.
Should be hosted on a static web server like `python3 -m http.server`.

## Build

```bash
npm run build
```

Generated `dist/` folder.

## Publish

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, update version in package.json to something like `1.0.0-next.0`, create a release with a tag equal to the version in package.json and check the pre-release checkbox.

## Development

```bash
npm run dev
```

This will render the stories (stories/\*_/_.stories.tsx) of the components in the browser using [ladle](https://ladle.dev/).

## Code style

We are using [`prettier`](https://prettier.io). To format the code, run:

```bash
npm run format
```
npm package: @i-vresse/pdbtbx-ts
Description: Wrapper around [pdbtbx rust library](https://crates.io/crates/pdbtbx) for reading (crystallographic) Protein Data Bank (PDB) and mmCIF files in JavaScript.
Author: Stefan Verhoeven
Latest version: 0.1.7

# NPM Package for pdbtbx

Wrapper around [pdbtbx rust library](https://crates.io/crates/pdbtbx) for reading (crystallographic) Protein Data Bank (PDB) and mmCIF files in JavaScript.

[![npmjs.com](https://img.shields.io/npm/v/@i-vresse/pdbtbx-ts.svg?style=flat)](https://www.npmjs.com/package/@i-vresse/pdbtbx-ts)
[![Build](https://github.com/i-VRESSE/pdbtbx-ts/actions/workflows/build.yml/badge.svg)](https://github.com/i-VRESSE/pdbtbx-ts/actions/workflows/build.yml)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6532349.svg)](https://doi.org/10.5281/zenodo.6532349)
[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8B-yellow)](https://fair-software.eu)

This NPM package only includes a subset of what the rust library can do.
For now it is meanly focused on getting chain names and residue sequence numbers from PDB files.

This package uses [wasm-pack](https://rustwasm.github.io/) and [tsup](https://tsup.egoist.sh) to compile the pdbtbx rust library and its bindings to a NPM package using WebAssembly.

## 🚴 Usage

Add to your app with

```shell
npm install @i-vresse/pdbtbx-ts
```

In NodeJS use

```js
const pdbtbx = await import('@i-vresse/pdbtbx-ts')
await pdbtbx.init()
const { readFile } = await import('fs/promises')
// A PDB file downloaded from https://github.com/haddocking/haddock3/tree/main/examples/docking-protein-protein/data
const content = await readFile('./e2aP_1F3G.pdb', encoding='ascii')
const info = pdbtbx.open_pdb(content)
{
  identifier: undefined,
  chains: [ 'A' ],
  residue_sequence_numbers: [
     19,  20,  21,  22,  23,  24,  25,  26,  27,  28,  29,  30,
    ...
  ],
  residues_per_chain: Map(1) {
    'A' => [
      { number: 19, insertion_code: '-' },
      { number: 20, insertion_code: '-' },
      ...
    ]
  },
  warnings: []
}
```

In an application using Vite, vitest and TypeScript use

```js
import { init, open_pdb } from 'pdbtbx-ts'

async function parse(content: string) {
  await init()
  const info = open_pdb(content)
  return info
}
```

## Development

Below are instructions how to develop this repository.

Requirements:

* Rust
* [wasm-pack](https://rustwasm.github.io/wasm-pack/)
* NodeJS version 18 or greater

### 🛠️ Build

To build a NPM package in `dist/` directory use

```shell
npm install
npm run build
```

### 🔬 Test

Tests can be found in `tests/` directory.

Run JS tests that consume wasm.

```shell
npm run test
```

### 🎁 Publish to npmjs.com

```shell
npm publish --access public .
```