@molcrafts/molrs 0.1.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/molrs.d.ts +186 -15
- package/molrs.js +1 -1
- package/molrs_bg.js +500 -105
- package/molrs_bg.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
WebAssembly bindings for the [molrs](https://github.com/MolCrafts/molrs) molecular modeling toolkit.
|
|
6
6
|
|
|
7
|
-
Full documentation lives at <https://molcrafts.
|
|
8
|
-
reference is published at <https://molcrafts.
|
|
7
|
+
Full documentation lives at <https://molrs.molcrafts.org/>. The WASM
|
|
8
|
+
reference is published at <https://molrs.molcrafts.org/reference/wasm/>.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
package/molrs.d.ts
CHANGED
|
@@ -1726,6 +1726,39 @@ export class FrameIndexEntry {
|
|
|
1726
1726
|
readonly byteOffset: number;
|
|
1727
1727
|
}
|
|
1728
1728
|
|
|
1729
|
+
/**
|
|
1730
|
+
* GROMACS GRO structure / trajectory reader.
|
|
1731
|
+
*
|
|
1732
|
+
* GRO is a fixed-column text format for GROMACS structures and
|
|
1733
|
+
* single-precision trajectories. Multi-frame files expose each frame via
|
|
1734
|
+
* `read(step)`. Coordinates and box are GROMACS-native nm in the file and
|
|
1735
|
+
* are converted to angstrom on read (x10), matching every other molvis
|
|
1736
|
+
* reader. Each frame produces an `"atoms"` block (`resid`, `resname`,
|
|
1737
|
+
* `atom_name`, `atom_id`, `x`/`y`/`z`, optional `vx`/`vy`/`vz`) and a
|
|
1738
|
+
* `simbox` from the box-vector line.
|
|
1739
|
+
*/
|
|
1740
|
+
export class GROReader {
|
|
1741
|
+
free(): void;
|
|
1742
|
+
[Symbol.dispose](): void;
|
|
1743
|
+
/**
|
|
1744
|
+
* Check whether the file contains no frames.
|
|
1745
|
+
*/
|
|
1746
|
+
isEmpty(): boolean;
|
|
1747
|
+
/**
|
|
1748
|
+
* Return the number of frames in the GRO file.
|
|
1749
|
+
*/
|
|
1750
|
+
len(): number;
|
|
1751
|
+
/**
|
|
1752
|
+
* Create a new GRO reader from a string containing the file content.
|
|
1753
|
+
*/
|
|
1754
|
+
constructor(content: string);
|
|
1755
|
+
/**
|
|
1756
|
+
* Read the frame at the given step index (0-based). Coordinates are
|
|
1757
|
+
* converted nm -> angstrom before the frame is returned.
|
|
1758
|
+
*/
|
|
1759
|
+
read(step: number): Frame | undefined;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1729
1762
|
/**
|
|
1730
1763
|
* Gyration tensor per cluster.
|
|
1731
1764
|
*
|
|
@@ -1980,6 +2013,37 @@ export class LinkedCell {
|
|
|
1980
2013
|
query(ref_frame: Frame, query_frame: Frame): NeighborList;
|
|
1981
2014
|
}
|
|
1982
2015
|
|
|
2016
|
+
/**
|
|
2017
|
+
* Tripos MOL2 reader.
|
|
2018
|
+
*
|
|
2019
|
+
* MOL2 is a section-delimited (`@<TRIPOS>...`) text format. Multi-molecule
|
|
2020
|
+
* files expose each `MOLECULE` record as a frame via `read(step)`.
|
|
2021
|
+
* Coordinates are already in angstrom. Produces an `"atoms"` block (`id`,
|
|
2022
|
+
* `name`, `x`/`y`/`z`, `atom_type`, optional `subst_id`/`subst_name`/
|
|
2023
|
+
* `charge`) and, when present, a `"bonds"` block (`atomi`/`atomj` 0-based,
|
|
2024
|
+
* `bond_type`).
|
|
2025
|
+
*/
|
|
2026
|
+
export class MOL2Reader {
|
|
2027
|
+
free(): void;
|
|
2028
|
+
[Symbol.dispose](): void;
|
|
2029
|
+
/**
|
|
2030
|
+
* Check whether the file contains no records.
|
|
2031
|
+
*/
|
|
2032
|
+
isEmpty(): boolean;
|
|
2033
|
+
/**
|
|
2034
|
+
* Return the number of molecule records in the MOL2 file.
|
|
2035
|
+
*/
|
|
2036
|
+
len(): number;
|
|
2037
|
+
/**
|
|
2038
|
+
* Create a new MOL2 reader from a string containing the file content.
|
|
2039
|
+
*/
|
|
2040
|
+
constructor(content: string);
|
|
2041
|
+
/**
|
|
2042
|
+
* Read the molecule record at the given step index (0-based).
|
|
2043
|
+
*/
|
|
2044
|
+
read(step: number): Frame | undefined;
|
|
2045
|
+
}
|
|
2046
|
+
|
|
1983
2047
|
/**
|
|
1984
2048
|
* Mean squared displacement (MSD) analysis.
|
|
1985
2049
|
*
|
|
@@ -2097,19 +2161,6 @@ export class MSDResult {
|
|
|
2097
2161
|
readonly mean: number;
|
|
2098
2162
|
}
|
|
2099
2163
|
|
|
2100
|
-
/**
|
|
2101
|
-
* Reader for MolRec Zarr v3 archives.
|
|
2102
|
-
*/
|
|
2103
|
-
export class MolRecReader {
|
|
2104
|
-
free(): void;
|
|
2105
|
-
[Symbol.dispose](): void;
|
|
2106
|
-
countAtoms(): number;
|
|
2107
|
-
countFrames(): number;
|
|
2108
|
-
free(): void;
|
|
2109
|
-
constructor(files: Map<any, any>);
|
|
2110
|
-
readFrame(t: number): Frame | undefined;
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
2164
|
/**
|
|
2114
2165
|
* Result of a neighbor search: all atom pairs within a distance cutoff.
|
|
2115
2166
|
*
|
|
@@ -2264,6 +2315,37 @@ export class PDBReader {
|
|
|
2264
2315
|
read(step: number): Frame | undefined;
|
|
2265
2316
|
}
|
|
2266
2317
|
|
|
2318
|
+
/**
|
|
2319
|
+
* VASP POSCAR / CONTCAR structure reader.
|
|
2320
|
+
*
|
|
2321
|
+
* POSCAR describes a single crystalline cell. Coordinates are returned as
|
|
2322
|
+
* Cartesian angstrom (`Direct` files are converted on read by molrs).
|
|
2323
|
+
* Produces an `"atoms"` block (`x`/`y`/`z`, optional `symbol`,
|
|
2324
|
+
* selective-dynamics flags, velocities) and a periodic `simbox`.
|
|
2325
|
+
* Single-frame: any `step != 0` returns `undefined`.
|
|
2326
|
+
*/
|
|
2327
|
+
export class POSCARReader {
|
|
2328
|
+
free(): void;
|
|
2329
|
+
[Symbol.dispose](): void;
|
|
2330
|
+
/**
|
|
2331
|
+
* Check whether the file contains no valid frame.
|
|
2332
|
+
*/
|
|
2333
|
+
isEmpty(): boolean;
|
|
2334
|
+
/**
|
|
2335
|
+
* Return the number of frames (always 0 or 1 for POSCAR files).
|
|
2336
|
+
*/
|
|
2337
|
+
len(): number;
|
|
2338
|
+
/**
|
|
2339
|
+
* Create a new POSCAR reader from a string containing the file content.
|
|
2340
|
+
*/
|
|
2341
|
+
constructor(content: string);
|
|
2342
|
+
/**
|
|
2343
|
+
* Read the frame at `step`. POSCAR is single-frame, so any `step != 0`
|
|
2344
|
+
* returns `undefined`.
|
|
2345
|
+
*/
|
|
2346
|
+
read(step: number): Frame | undefined;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2267
2349
|
/**
|
|
2268
2350
|
* Radial distribution function g(r) analysis.
|
|
2269
2351
|
*
|
|
@@ -2427,6 +2509,19 @@ export class RadiusOfGyration {
|
|
|
2427
2509
|
constructor(masses?: Float64Array | null);
|
|
2428
2510
|
}
|
|
2429
2511
|
|
|
2512
|
+
/**
|
|
2513
|
+
* Reader for frame-sequence Zarr v3 archives.
|
|
2514
|
+
*/
|
|
2515
|
+
export class RecordReader {
|
|
2516
|
+
free(): void;
|
|
2517
|
+
[Symbol.dispose](): void;
|
|
2518
|
+
countAtoms(): number;
|
|
2519
|
+
countFrames(): number;
|
|
2520
|
+
free(): void;
|
|
2521
|
+
constructor(files: Map<any, any>);
|
|
2522
|
+
readFrame(t: number): Frame | undefined;
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2430
2525
|
/**
|
|
2431
2526
|
* MDL molfile / SDF (V2000 CTAB) reader.
|
|
2432
2527
|
*
|
|
@@ -2545,6 +2640,37 @@ export class SmilesIR {
|
|
|
2545
2640
|
readonly nComponents: number;
|
|
2546
2641
|
}
|
|
2547
2642
|
|
|
2643
|
+
/**
|
|
2644
|
+
* GROMACS TRR binary trajectory reader.
|
|
2645
|
+
*
|
|
2646
|
+
* TRR is the full-precision GROMACS trajectory (XDR, big-endian). Accepts the
|
|
2647
|
+
* file as raw bytes (`Uint8Array`). Each frame produces an `"atoms"` block
|
|
2648
|
+
* (`id`, `x`/`y`/`z`, optional `vx`/`vy`/`vz` and `fx`/`fy`/`fz`);
|
|
2649
|
+
* coordinates and box are converted nm -> angstrom on read. Box is attached
|
|
2650
|
+
* as `simbox` when the frame carries one.
|
|
2651
|
+
*/
|
|
2652
|
+
export class TRRReader {
|
|
2653
|
+
free(): void;
|
|
2654
|
+
[Symbol.dispose](): void;
|
|
2655
|
+
/**
|
|
2656
|
+
* Check whether the file contains no frames.
|
|
2657
|
+
*/
|
|
2658
|
+
isEmpty(): boolean;
|
|
2659
|
+
/**
|
|
2660
|
+
* Return the number of frames in the TRR file.
|
|
2661
|
+
*/
|
|
2662
|
+
len(): number;
|
|
2663
|
+
/**
|
|
2664
|
+
* Create a new TRR reader from the file's raw bytes.
|
|
2665
|
+
*/
|
|
2666
|
+
constructor(bytes: Uint8Array);
|
|
2667
|
+
/**
|
|
2668
|
+
* Read a frame at the given step index (0-based). Coordinates are
|
|
2669
|
+
* converted nm -> angstrom before the frame is returned.
|
|
2670
|
+
*/
|
|
2671
|
+
read(step: number): Frame | undefined;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2548
2674
|
/**
|
|
2549
2675
|
* Graph-based molecular topology with automated detection of angles,
|
|
2550
2676
|
* dihedrals, impropers, connected components, and rings (SSSR).
|
|
@@ -2884,7 +3010,7 @@ export class WasmArray {
|
|
|
2884
3010
|
}
|
|
2885
3011
|
|
|
2886
3012
|
/**
|
|
2887
|
-
* Wrapper for [`molrs::compute::kmeans::KMeans`].
|
|
3013
|
+
* Wrapper for [`molrs::compute::ml::kmeans::KMeans`].
|
|
2888
3014
|
*
|
|
2889
3015
|
* # Example (JavaScript)
|
|
2890
3016
|
*
|
|
@@ -3210,7 +3336,7 @@ export class WasmLammpsDumpStream {
|
|
|
3210
3336
|
}
|
|
3211
3337
|
|
|
3212
3338
|
/**
|
|
3213
|
-
* Stateless wrapper for [`molrs::compute::pca::Pca2`].
|
|
3339
|
+
* Stateless wrapper for [`molrs::compute::ml::pca::Pca2`].
|
|
3214
3340
|
*
|
|
3215
3341
|
* All configuration lives on [`fitTransform`](Self::fit_transform).
|
|
3216
3342
|
*
|
|
@@ -3696,6 +3822,36 @@ export class WasmXyzStream {
|
|
|
3696
3822
|
simboxPbc(): Uint8Array | undefined;
|
|
3697
3823
|
}
|
|
3698
3824
|
|
|
3825
|
+
/**
|
|
3826
|
+
* GROMACS XTC binary trajectory reader.
|
|
3827
|
+
*
|
|
3828
|
+
* XTC is the compressed GROMACS trajectory (XDR, big-endian, lossy
|
|
3829
|
+
* coordinate compression). Accepts the file as raw bytes (`Uint8Array`).
|
|
3830
|
+
* Each frame produces an `"atoms"` block (`id`, `x`/`y`/`z`); coordinates
|
|
3831
|
+
* and box are converted nm -> angstrom on read. Box is attached as `simbox`.
|
|
3832
|
+
*/
|
|
3833
|
+
export class XTCReader {
|
|
3834
|
+
free(): void;
|
|
3835
|
+
[Symbol.dispose](): void;
|
|
3836
|
+
/**
|
|
3837
|
+
* Check whether the file contains no frames.
|
|
3838
|
+
*/
|
|
3839
|
+
isEmpty(): boolean;
|
|
3840
|
+
/**
|
|
3841
|
+
* Return the number of frames in the XTC file.
|
|
3842
|
+
*/
|
|
3843
|
+
len(): number;
|
|
3844
|
+
/**
|
|
3845
|
+
* Create a new XTC reader from the file's raw bytes.
|
|
3846
|
+
*/
|
|
3847
|
+
constructor(bytes: Uint8Array);
|
|
3848
|
+
/**
|
|
3849
|
+
* Read a frame at the given step index (0-based). Coordinates are
|
|
3850
|
+
* converted nm -> angstrom before the frame is returned.
|
|
3851
|
+
*/
|
|
3852
|
+
read(step: number): Frame | undefined;
|
|
3853
|
+
}
|
|
3854
|
+
|
|
3699
3855
|
/**
|
|
3700
3856
|
* XYZ / Extended XYZ file reader.
|
|
3701
3857
|
*
|
|
@@ -3944,3 +4100,18 @@ export function wasmMemory(): WebAssembly.Memory;
|
|
|
3944
4100
|
* ```
|
|
3945
4101
|
*/
|
|
3946
4102
|
export function writeFrame(frame: Frame, format: string): string;
|
|
4103
|
+
|
|
4104
|
+
/**
|
|
4105
|
+
* Serialize a [`Frame`] to bytes in a binary trajectory format.
|
|
4106
|
+
*
|
|
4107
|
+
* Mirrors [`write_frame_export`] for the formats whose output is not valid
|
|
4108
|
+
* UTF-8: `"dcd"`, `"trr"`, `"xtc"` (case-insensitive). Returns a
|
|
4109
|
+
* `Uint8Array` to JavaScript. The GROMACS formats (`trr`/`xtc`) are written
|
|
4110
|
+
* in nm — coordinates and box are scaled Å → nm on a throwaway clone first.
|
|
4111
|
+
*
|
|
4112
|
+
* # Errors
|
|
4113
|
+
*
|
|
4114
|
+
* Throws a `JsValue` string if the format is not a known binary format, the
|
|
4115
|
+
* frame is missing required columns, or the writer encounters an error.
|
|
4116
|
+
*/
|
|
4117
|
+
export function writeFrameBytes(frame: Frame, format: string): Uint8Array;
|
package/molrs.js
CHANGED
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./molrs_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
wasm.__wbindgen_start();
|
|
7
7
|
export {
|
|
8
|
-
Block, Box, CHGCARReader, CIFReader, CenterOfMass, CenterOfMassResult, Cluster, ClusterCenters, ClusterResult, CubeReader, DCDReader, Frame, FrameIndexEntry, GyrationTensor, InertiaTensor, LAMMPSReader, LAMMPSTrajReader, LinkedCell, MSD, MSDResult,
|
|
8
|
+
Block, Box, CHGCARReader, CIFReader, CenterOfMass, CenterOfMassResult, Cluster, ClusterCenters, ClusterResult, CubeReader, DCDReader, Frame, FrameIndexEntry, GROReader, GyrationTensor, InertiaTensor, LAMMPSReader, LAMMPSTrajReader, LinkedCell, MOL2Reader, MSD, MSDResult, NeighborList, PDBReader, POSCARReader, RDF, RDFResult, RadiusOfGyration, RecordReader, SDFReader, SmilesIR, TRRReader, Topology, TopologyRingInfo, WasmArray, WasmKMeans, WasmLammpsDataStream, WasmLammpsDumpStream, WasmPca2, WasmPcaResult, WasmPdbStream, WasmSdfStream, WasmXyzStream, XTCReader, XYZReader, covalentRadius, generate3D, parseSMILES, start, wasmMemory, writeFrame, writeFrameBytes
|
|
9
9
|
} from "./molrs_bg.js";
|
package/molrs_bg.js
CHANGED
|
@@ -2587,6 +2587,78 @@ export class FrameIndexEntry {
|
|
|
2587
2587
|
}
|
|
2588
2588
|
if (Symbol.dispose) FrameIndexEntry.prototype[Symbol.dispose] = FrameIndexEntry.prototype.free;
|
|
2589
2589
|
|
|
2590
|
+
/**
|
|
2591
|
+
* GROMACS GRO structure / trajectory reader.
|
|
2592
|
+
*
|
|
2593
|
+
* GRO is a fixed-column text format for GROMACS structures and
|
|
2594
|
+
* single-precision trajectories. Multi-frame files expose each frame via
|
|
2595
|
+
* `read(step)`. Coordinates and box are GROMACS-native nm in the file and
|
|
2596
|
+
* are converted to angstrom on read (x10), matching every other molvis
|
|
2597
|
+
* reader. Each frame produces an `"atoms"` block (`resid`, `resname`,
|
|
2598
|
+
* `atom_name`, `atom_id`, `x`/`y`/`z`, optional `vx`/`vy`/`vz`) and a
|
|
2599
|
+
* `simbox` from the box-vector line.
|
|
2600
|
+
*/
|
|
2601
|
+
export class GROReader {
|
|
2602
|
+
__destroy_into_raw() {
|
|
2603
|
+
const ptr = this.__wbg_ptr;
|
|
2604
|
+
this.__wbg_ptr = 0;
|
|
2605
|
+
GROReaderFinalization.unregister(this);
|
|
2606
|
+
return ptr;
|
|
2607
|
+
}
|
|
2608
|
+
free() {
|
|
2609
|
+
const ptr = this.__destroy_into_raw();
|
|
2610
|
+
wasm.__wbg_groreader_free(ptr, 0);
|
|
2611
|
+
}
|
|
2612
|
+
/**
|
|
2613
|
+
* Check whether the file contains no frames.
|
|
2614
|
+
* @returns {boolean}
|
|
2615
|
+
*/
|
|
2616
|
+
isEmpty() {
|
|
2617
|
+
const ret = wasm.groreader_isEmpty(this.__wbg_ptr);
|
|
2618
|
+
if (ret[2]) {
|
|
2619
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2620
|
+
}
|
|
2621
|
+
return ret[0] !== 0;
|
|
2622
|
+
}
|
|
2623
|
+
/**
|
|
2624
|
+
* Return the number of frames in the GRO file.
|
|
2625
|
+
* @returns {number}
|
|
2626
|
+
*/
|
|
2627
|
+
len() {
|
|
2628
|
+
const ret = wasm.groreader_len(this.__wbg_ptr);
|
|
2629
|
+
if (ret[2]) {
|
|
2630
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2631
|
+
}
|
|
2632
|
+
return ret[0] >>> 0;
|
|
2633
|
+
}
|
|
2634
|
+
/**
|
|
2635
|
+
* Create a new GRO reader from a string containing the file content.
|
|
2636
|
+
* @param {string} content
|
|
2637
|
+
*/
|
|
2638
|
+
constructor(content) {
|
|
2639
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
2640
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2641
|
+
const ret = wasm.groreader_new(ptr0, len0);
|
|
2642
|
+
this.__wbg_ptr = ret;
|
|
2643
|
+
GROReaderFinalization.register(this, this.__wbg_ptr, this);
|
|
2644
|
+
return this;
|
|
2645
|
+
}
|
|
2646
|
+
/**
|
|
2647
|
+
* Read the frame at the given step index (0-based). Coordinates are
|
|
2648
|
+
* converted nm -> angstrom before the frame is returned.
|
|
2649
|
+
* @param {number} step
|
|
2650
|
+
* @returns {Frame | undefined}
|
|
2651
|
+
*/
|
|
2652
|
+
read(step) {
|
|
2653
|
+
const ret = wasm.groreader_read(this.__wbg_ptr, step);
|
|
2654
|
+
if (ret[2]) {
|
|
2655
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2656
|
+
}
|
|
2657
|
+
return ret[0] === 0 ? undefined : Frame.__wrap(ret[0]);
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
if (Symbol.dispose) GROReader.prototype[Symbol.dispose] = GROReader.prototype.free;
|
|
2661
|
+
|
|
2590
2662
|
/**
|
|
2591
2663
|
* Gyration tensor per cluster.
|
|
2592
2664
|
*
|
|
@@ -3013,6 +3085,76 @@ export class LinkedCell {
|
|
|
3013
3085
|
}
|
|
3014
3086
|
if (Symbol.dispose) LinkedCell.prototype[Symbol.dispose] = LinkedCell.prototype.free;
|
|
3015
3087
|
|
|
3088
|
+
/**
|
|
3089
|
+
* Tripos MOL2 reader.
|
|
3090
|
+
*
|
|
3091
|
+
* MOL2 is a section-delimited (`@<TRIPOS>...`) text format. Multi-molecule
|
|
3092
|
+
* files expose each `MOLECULE` record as a frame via `read(step)`.
|
|
3093
|
+
* Coordinates are already in angstrom. Produces an `"atoms"` block (`id`,
|
|
3094
|
+
* `name`, `x`/`y`/`z`, `atom_type`, optional `subst_id`/`subst_name`/
|
|
3095
|
+
* `charge`) and, when present, a `"bonds"` block (`atomi`/`atomj` 0-based,
|
|
3096
|
+
* `bond_type`).
|
|
3097
|
+
*/
|
|
3098
|
+
export class MOL2Reader {
|
|
3099
|
+
__destroy_into_raw() {
|
|
3100
|
+
const ptr = this.__wbg_ptr;
|
|
3101
|
+
this.__wbg_ptr = 0;
|
|
3102
|
+
MOL2ReaderFinalization.unregister(this);
|
|
3103
|
+
return ptr;
|
|
3104
|
+
}
|
|
3105
|
+
free() {
|
|
3106
|
+
const ptr = this.__destroy_into_raw();
|
|
3107
|
+
wasm.__wbg_mol2reader_free(ptr, 0);
|
|
3108
|
+
}
|
|
3109
|
+
/**
|
|
3110
|
+
* Check whether the file contains no records.
|
|
3111
|
+
* @returns {boolean}
|
|
3112
|
+
*/
|
|
3113
|
+
isEmpty() {
|
|
3114
|
+
const ret = wasm.mol2reader_isEmpty(this.__wbg_ptr);
|
|
3115
|
+
if (ret[2]) {
|
|
3116
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3117
|
+
}
|
|
3118
|
+
return ret[0] !== 0;
|
|
3119
|
+
}
|
|
3120
|
+
/**
|
|
3121
|
+
* Return the number of molecule records in the MOL2 file.
|
|
3122
|
+
* @returns {number}
|
|
3123
|
+
*/
|
|
3124
|
+
len() {
|
|
3125
|
+
const ret = wasm.mol2reader_len(this.__wbg_ptr);
|
|
3126
|
+
if (ret[2]) {
|
|
3127
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3128
|
+
}
|
|
3129
|
+
return ret[0] >>> 0;
|
|
3130
|
+
}
|
|
3131
|
+
/**
|
|
3132
|
+
* Create a new MOL2 reader from a string containing the file content.
|
|
3133
|
+
* @param {string} content
|
|
3134
|
+
*/
|
|
3135
|
+
constructor(content) {
|
|
3136
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
3137
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3138
|
+
const ret = wasm.mol2reader_new(ptr0, len0);
|
|
3139
|
+
this.__wbg_ptr = ret;
|
|
3140
|
+
MOL2ReaderFinalization.register(this, this.__wbg_ptr, this);
|
|
3141
|
+
return this;
|
|
3142
|
+
}
|
|
3143
|
+
/**
|
|
3144
|
+
* Read the molecule record at the given step index (0-based).
|
|
3145
|
+
* @param {number} step
|
|
3146
|
+
* @returns {Frame | undefined}
|
|
3147
|
+
*/
|
|
3148
|
+
read(step) {
|
|
3149
|
+
const ret = wasm.mol2reader_read(this.__wbg_ptr, step);
|
|
3150
|
+
if (ret[2]) {
|
|
3151
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3152
|
+
}
|
|
3153
|
+
return ret[0] === 0 ? undefined : Frame.__wrap(ret[0]);
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
if (Symbol.dispose) MOL2Reader.prototype[Symbol.dispose] = MOL2Reader.prototype.free;
|
|
3157
|
+
|
|
3016
3158
|
/**
|
|
3017
3159
|
* Mean squared displacement (MSD) analysis.
|
|
3018
3160
|
*
|
|
@@ -3188,66 +3330,6 @@ export class MSDResult {
|
|
|
3188
3330
|
}
|
|
3189
3331
|
if (Symbol.dispose) MSDResult.prototype[Symbol.dispose] = MSDResult.prototype.free;
|
|
3190
3332
|
|
|
3191
|
-
/**
|
|
3192
|
-
* Reader for MolRec Zarr v3 archives.
|
|
3193
|
-
*/
|
|
3194
|
-
export class MolRecReader {
|
|
3195
|
-
__destroy_into_raw() {
|
|
3196
|
-
const ptr = this.__wbg_ptr;
|
|
3197
|
-
this.__wbg_ptr = 0;
|
|
3198
|
-
MolRecReaderFinalization.unregister(this);
|
|
3199
|
-
return ptr;
|
|
3200
|
-
}
|
|
3201
|
-
free() {
|
|
3202
|
-
const ptr = this.__destroy_into_raw();
|
|
3203
|
-
wasm.__wbg_molrecreader_free(ptr, 0);
|
|
3204
|
-
}
|
|
3205
|
-
/**
|
|
3206
|
-
* @returns {number}
|
|
3207
|
-
*/
|
|
3208
|
-
countAtoms() {
|
|
3209
|
-
const ret = wasm.molrecreader_countAtoms(this.__wbg_ptr);
|
|
3210
|
-
return ret >>> 0;
|
|
3211
|
-
}
|
|
3212
|
-
/**
|
|
3213
|
-
* @returns {number}
|
|
3214
|
-
*/
|
|
3215
|
-
countFrames() {
|
|
3216
|
-
const ret = wasm.molrecreader_countFrames(this.__wbg_ptr);
|
|
3217
|
-
if (ret[2]) {
|
|
3218
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
3219
|
-
}
|
|
3220
|
-
return ret[0] >>> 0;
|
|
3221
|
-
}
|
|
3222
|
-
free() {
|
|
3223
|
-
wasm.molrecreader_free(this.__wbg_ptr);
|
|
3224
|
-
}
|
|
3225
|
-
/**
|
|
3226
|
-
* @param {Map<any, any>} files
|
|
3227
|
-
*/
|
|
3228
|
-
constructor(files) {
|
|
3229
|
-
const ret = wasm.molrecreader_new(files);
|
|
3230
|
-
if (ret[2]) {
|
|
3231
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
3232
|
-
}
|
|
3233
|
-
this.__wbg_ptr = ret[0];
|
|
3234
|
-
MolRecReaderFinalization.register(this, this.__wbg_ptr, this);
|
|
3235
|
-
return this;
|
|
3236
|
-
}
|
|
3237
|
-
/**
|
|
3238
|
-
* @param {number} t
|
|
3239
|
-
* @returns {Frame | undefined}
|
|
3240
|
-
*/
|
|
3241
|
-
readFrame(t) {
|
|
3242
|
-
const ret = wasm.molrecreader_readFrame(this.__wbg_ptr, t);
|
|
3243
|
-
if (ret[2]) {
|
|
3244
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
3245
|
-
}
|
|
3246
|
-
return ret[0] === 0 ? undefined : Frame.__wrap(ret[0]);
|
|
3247
|
-
}
|
|
3248
|
-
}
|
|
3249
|
-
if (Symbol.dispose) MolRecReader.prototype[Symbol.dispose] = MolRecReader.prototype.free;
|
|
3250
|
-
|
|
3251
3333
|
/**
|
|
3252
3334
|
* Result of a neighbor search: all atom pairs within a distance cutoff.
|
|
3253
3335
|
*
|
|
@@ -3489,6 +3571,76 @@ export class PDBReader {
|
|
|
3489
3571
|
}
|
|
3490
3572
|
if (Symbol.dispose) PDBReader.prototype[Symbol.dispose] = PDBReader.prototype.free;
|
|
3491
3573
|
|
|
3574
|
+
/**
|
|
3575
|
+
* VASP POSCAR / CONTCAR structure reader.
|
|
3576
|
+
*
|
|
3577
|
+
* POSCAR describes a single crystalline cell. Coordinates are returned as
|
|
3578
|
+
* Cartesian angstrom (`Direct` files are converted on read by molrs).
|
|
3579
|
+
* Produces an `"atoms"` block (`x`/`y`/`z`, optional `symbol`,
|
|
3580
|
+
* selective-dynamics flags, velocities) and a periodic `simbox`.
|
|
3581
|
+
* Single-frame: any `step != 0` returns `undefined`.
|
|
3582
|
+
*/
|
|
3583
|
+
export class POSCARReader {
|
|
3584
|
+
__destroy_into_raw() {
|
|
3585
|
+
const ptr = this.__wbg_ptr;
|
|
3586
|
+
this.__wbg_ptr = 0;
|
|
3587
|
+
POSCARReaderFinalization.unregister(this);
|
|
3588
|
+
return ptr;
|
|
3589
|
+
}
|
|
3590
|
+
free() {
|
|
3591
|
+
const ptr = this.__destroy_into_raw();
|
|
3592
|
+
wasm.__wbg_poscarreader_free(ptr, 0);
|
|
3593
|
+
}
|
|
3594
|
+
/**
|
|
3595
|
+
* Check whether the file contains no valid frame.
|
|
3596
|
+
* @returns {boolean}
|
|
3597
|
+
*/
|
|
3598
|
+
isEmpty() {
|
|
3599
|
+
const ret = wasm.poscarreader_isEmpty(this.__wbg_ptr);
|
|
3600
|
+
if (ret[2]) {
|
|
3601
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3602
|
+
}
|
|
3603
|
+
return ret[0] !== 0;
|
|
3604
|
+
}
|
|
3605
|
+
/**
|
|
3606
|
+
* Return the number of frames (always 0 or 1 for POSCAR files).
|
|
3607
|
+
* @returns {number}
|
|
3608
|
+
*/
|
|
3609
|
+
len() {
|
|
3610
|
+
const ret = wasm.poscarreader_len(this.__wbg_ptr);
|
|
3611
|
+
if (ret[2]) {
|
|
3612
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3613
|
+
}
|
|
3614
|
+
return ret[0] >>> 0;
|
|
3615
|
+
}
|
|
3616
|
+
/**
|
|
3617
|
+
* Create a new POSCAR reader from a string containing the file content.
|
|
3618
|
+
* @param {string} content
|
|
3619
|
+
*/
|
|
3620
|
+
constructor(content) {
|
|
3621
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
3622
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3623
|
+
const ret = wasm.poscarreader_new(ptr0, len0);
|
|
3624
|
+
this.__wbg_ptr = ret;
|
|
3625
|
+
POSCARReaderFinalization.register(this, this.__wbg_ptr, this);
|
|
3626
|
+
return this;
|
|
3627
|
+
}
|
|
3628
|
+
/**
|
|
3629
|
+
* Read the frame at `step`. POSCAR is single-frame, so any `step != 0`
|
|
3630
|
+
* returns `undefined`.
|
|
3631
|
+
* @param {number} step
|
|
3632
|
+
* @returns {Frame | undefined}
|
|
3633
|
+
*/
|
|
3634
|
+
read(step) {
|
|
3635
|
+
const ret = wasm.poscarreader_read(this.__wbg_ptr, step);
|
|
3636
|
+
if (ret[2]) {
|
|
3637
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3638
|
+
}
|
|
3639
|
+
return ret[0] === 0 ? undefined : Frame.__wrap(ret[0]);
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
if (Symbol.dispose) POSCARReader.prototype[Symbol.dispose] = POSCARReader.prototype.free;
|
|
3643
|
+
|
|
3492
3644
|
/**
|
|
3493
3645
|
* Radial distribution function g(r) analysis.
|
|
3494
3646
|
*
|
|
@@ -3767,6 +3919,66 @@ export class RadiusOfGyration {
|
|
|
3767
3919
|
}
|
|
3768
3920
|
if (Symbol.dispose) RadiusOfGyration.prototype[Symbol.dispose] = RadiusOfGyration.prototype.free;
|
|
3769
3921
|
|
|
3922
|
+
/**
|
|
3923
|
+
* Reader for frame-sequence Zarr v3 archives.
|
|
3924
|
+
*/
|
|
3925
|
+
export class RecordReader {
|
|
3926
|
+
__destroy_into_raw() {
|
|
3927
|
+
const ptr = this.__wbg_ptr;
|
|
3928
|
+
this.__wbg_ptr = 0;
|
|
3929
|
+
RecordReaderFinalization.unregister(this);
|
|
3930
|
+
return ptr;
|
|
3931
|
+
}
|
|
3932
|
+
free() {
|
|
3933
|
+
const ptr = this.__destroy_into_raw();
|
|
3934
|
+
wasm.__wbg_recordreader_free(ptr, 0);
|
|
3935
|
+
}
|
|
3936
|
+
/**
|
|
3937
|
+
* @returns {number}
|
|
3938
|
+
*/
|
|
3939
|
+
countAtoms() {
|
|
3940
|
+
const ret = wasm.recordreader_countAtoms(this.__wbg_ptr);
|
|
3941
|
+
return ret >>> 0;
|
|
3942
|
+
}
|
|
3943
|
+
/**
|
|
3944
|
+
* @returns {number}
|
|
3945
|
+
*/
|
|
3946
|
+
countFrames() {
|
|
3947
|
+
const ret = wasm.recordreader_countFrames(this.__wbg_ptr);
|
|
3948
|
+
if (ret[2]) {
|
|
3949
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3950
|
+
}
|
|
3951
|
+
return ret[0] >>> 0;
|
|
3952
|
+
}
|
|
3953
|
+
free() {
|
|
3954
|
+
wasm.recordreader_free(this.__wbg_ptr);
|
|
3955
|
+
}
|
|
3956
|
+
/**
|
|
3957
|
+
* @param {Map<any, any>} files
|
|
3958
|
+
*/
|
|
3959
|
+
constructor(files) {
|
|
3960
|
+
const ret = wasm.recordreader_new(files);
|
|
3961
|
+
if (ret[2]) {
|
|
3962
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3963
|
+
}
|
|
3964
|
+
this.__wbg_ptr = ret[0];
|
|
3965
|
+
RecordReaderFinalization.register(this, this.__wbg_ptr, this);
|
|
3966
|
+
return this;
|
|
3967
|
+
}
|
|
3968
|
+
/**
|
|
3969
|
+
* @param {number} t
|
|
3970
|
+
* @returns {Frame | undefined}
|
|
3971
|
+
*/
|
|
3972
|
+
readFrame(t) {
|
|
3973
|
+
const ret = wasm.recordreader_readFrame(this.__wbg_ptr, t);
|
|
3974
|
+
if (ret[2]) {
|
|
3975
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3976
|
+
}
|
|
3977
|
+
return ret[0] === 0 ? undefined : Frame.__wrap(ret[0]);
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
if (Symbol.dispose) RecordReader.prototype[Symbol.dispose] = RecordReader.prototype.free;
|
|
3981
|
+
|
|
3770
3982
|
/**
|
|
3771
3983
|
* MDL molfile / SDF (V2000 CTAB) reader.
|
|
3772
3984
|
*
|
|
@@ -3949,6 +4161,76 @@ export class SmilesIR {
|
|
|
3949
4161
|
}
|
|
3950
4162
|
if (Symbol.dispose) SmilesIR.prototype[Symbol.dispose] = SmilesIR.prototype.free;
|
|
3951
4163
|
|
|
4164
|
+
/**
|
|
4165
|
+
* GROMACS TRR binary trajectory reader.
|
|
4166
|
+
*
|
|
4167
|
+
* TRR is the full-precision GROMACS trajectory (XDR, big-endian). Accepts the
|
|
4168
|
+
* file as raw bytes (`Uint8Array`). Each frame produces an `"atoms"` block
|
|
4169
|
+
* (`id`, `x`/`y`/`z`, optional `vx`/`vy`/`vz` and `fx`/`fy`/`fz`);
|
|
4170
|
+
* coordinates and box are converted nm -> angstrom on read. Box is attached
|
|
4171
|
+
* as `simbox` when the frame carries one.
|
|
4172
|
+
*/
|
|
4173
|
+
export class TRRReader {
|
|
4174
|
+
__destroy_into_raw() {
|
|
4175
|
+
const ptr = this.__wbg_ptr;
|
|
4176
|
+
this.__wbg_ptr = 0;
|
|
4177
|
+
TRRReaderFinalization.unregister(this);
|
|
4178
|
+
return ptr;
|
|
4179
|
+
}
|
|
4180
|
+
free() {
|
|
4181
|
+
const ptr = this.__destroy_into_raw();
|
|
4182
|
+
wasm.__wbg_trrreader_free(ptr, 0);
|
|
4183
|
+
}
|
|
4184
|
+
/**
|
|
4185
|
+
* Check whether the file contains no frames.
|
|
4186
|
+
* @returns {boolean}
|
|
4187
|
+
*/
|
|
4188
|
+
isEmpty() {
|
|
4189
|
+
const ret = wasm.trrreader_isEmpty(this.__wbg_ptr);
|
|
4190
|
+
if (ret[2]) {
|
|
4191
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4192
|
+
}
|
|
4193
|
+
return ret[0] !== 0;
|
|
4194
|
+
}
|
|
4195
|
+
/**
|
|
4196
|
+
* Return the number of frames in the TRR file.
|
|
4197
|
+
* @returns {number}
|
|
4198
|
+
*/
|
|
4199
|
+
len() {
|
|
4200
|
+
const ret = wasm.trrreader_len(this.__wbg_ptr);
|
|
4201
|
+
if (ret[2]) {
|
|
4202
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4203
|
+
}
|
|
4204
|
+
return ret[0] >>> 0;
|
|
4205
|
+
}
|
|
4206
|
+
/**
|
|
4207
|
+
* Create a new TRR reader from the file's raw bytes.
|
|
4208
|
+
* @param {Uint8Array} bytes
|
|
4209
|
+
*/
|
|
4210
|
+
constructor(bytes) {
|
|
4211
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc_command_export);
|
|
4212
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4213
|
+
const ret = wasm.trrreader_new(ptr0, len0);
|
|
4214
|
+
this.__wbg_ptr = ret;
|
|
4215
|
+
TRRReaderFinalization.register(this, this.__wbg_ptr, this);
|
|
4216
|
+
return this;
|
|
4217
|
+
}
|
|
4218
|
+
/**
|
|
4219
|
+
* Read a frame at the given step index (0-based). Coordinates are
|
|
4220
|
+
* converted nm -> angstrom before the frame is returned.
|
|
4221
|
+
* @param {number} step
|
|
4222
|
+
* @returns {Frame | undefined}
|
|
4223
|
+
*/
|
|
4224
|
+
read(step) {
|
|
4225
|
+
const ret = wasm.trrreader_read(this.__wbg_ptr, step);
|
|
4226
|
+
if (ret[2]) {
|
|
4227
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4228
|
+
}
|
|
4229
|
+
return ret[0] === 0 ? undefined : Frame.__wrap(ret[0]);
|
|
4230
|
+
}
|
|
4231
|
+
}
|
|
4232
|
+
if (Symbol.dispose) TRRReader.prototype[Symbol.dispose] = TRRReader.prototype.free;
|
|
4233
|
+
|
|
3952
4234
|
/**
|
|
3953
4235
|
* Graph-based molecular topology with automated detection of angles,
|
|
3954
4236
|
* dihedrals, impropers, connected components, and rings (SSSR).
|
|
@@ -4531,7 +4813,7 @@ export class WasmArray {
|
|
|
4531
4813
|
if (Symbol.dispose) WasmArray.prototype[Symbol.dispose] = WasmArray.prototype.free;
|
|
4532
4814
|
|
|
4533
4815
|
/**
|
|
4534
|
-
* Wrapper for [`molrs::compute::kmeans::KMeans`].
|
|
4816
|
+
* Wrapper for [`molrs::compute::ml::kmeans::KMeans`].
|
|
4535
4817
|
*
|
|
4536
4818
|
* # Example (JavaScript)
|
|
4537
4819
|
*
|
|
@@ -5211,7 +5493,7 @@ export class WasmLammpsDumpStream {
|
|
|
5211
5493
|
if (Symbol.dispose) WasmLammpsDumpStream.prototype[Symbol.dispose] = WasmLammpsDumpStream.prototype.free;
|
|
5212
5494
|
|
|
5213
5495
|
/**
|
|
5214
|
-
* Stateless wrapper for [`molrs::compute::pca::Pca2`].
|
|
5496
|
+
* Stateless wrapper for [`molrs::compute::ml::pca::Pca2`].
|
|
5215
5497
|
*
|
|
5216
5498
|
* All configuration lives on [`fitTransform`](Self::fit_transform).
|
|
5217
5499
|
*
|
|
@@ -6228,6 +6510,75 @@ export class WasmXyzStream {
|
|
|
6228
6510
|
}
|
|
6229
6511
|
if (Symbol.dispose) WasmXyzStream.prototype[Symbol.dispose] = WasmXyzStream.prototype.free;
|
|
6230
6512
|
|
|
6513
|
+
/**
|
|
6514
|
+
* GROMACS XTC binary trajectory reader.
|
|
6515
|
+
*
|
|
6516
|
+
* XTC is the compressed GROMACS trajectory (XDR, big-endian, lossy
|
|
6517
|
+
* coordinate compression). Accepts the file as raw bytes (`Uint8Array`).
|
|
6518
|
+
* Each frame produces an `"atoms"` block (`id`, `x`/`y`/`z`); coordinates
|
|
6519
|
+
* and box are converted nm -> angstrom on read. Box is attached as `simbox`.
|
|
6520
|
+
*/
|
|
6521
|
+
export class XTCReader {
|
|
6522
|
+
__destroy_into_raw() {
|
|
6523
|
+
const ptr = this.__wbg_ptr;
|
|
6524
|
+
this.__wbg_ptr = 0;
|
|
6525
|
+
XTCReaderFinalization.unregister(this);
|
|
6526
|
+
return ptr;
|
|
6527
|
+
}
|
|
6528
|
+
free() {
|
|
6529
|
+
const ptr = this.__destroy_into_raw();
|
|
6530
|
+
wasm.__wbg_xtcreader_free(ptr, 0);
|
|
6531
|
+
}
|
|
6532
|
+
/**
|
|
6533
|
+
* Check whether the file contains no frames.
|
|
6534
|
+
* @returns {boolean}
|
|
6535
|
+
*/
|
|
6536
|
+
isEmpty() {
|
|
6537
|
+
const ret = wasm.xtcreader_isEmpty(this.__wbg_ptr);
|
|
6538
|
+
if (ret[2]) {
|
|
6539
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
6540
|
+
}
|
|
6541
|
+
return ret[0] !== 0;
|
|
6542
|
+
}
|
|
6543
|
+
/**
|
|
6544
|
+
* Return the number of frames in the XTC file.
|
|
6545
|
+
* @returns {number}
|
|
6546
|
+
*/
|
|
6547
|
+
len() {
|
|
6548
|
+
const ret = wasm.xtcreader_len(this.__wbg_ptr);
|
|
6549
|
+
if (ret[2]) {
|
|
6550
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
6551
|
+
}
|
|
6552
|
+
return ret[0] >>> 0;
|
|
6553
|
+
}
|
|
6554
|
+
/**
|
|
6555
|
+
* Create a new XTC reader from the file's raw bytes.
|
|
6556
|
+
* @param {Uint8Array} bytes
|
|
6557
|
+
*/
|
|
6558
|
+
constructor(bytes) {
|
|
6559
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc_command_export);
|
|
6560
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6561
|
+
const ret = wasm.xtcreader_new(ptr0, len0);
|
|
6562
|
+
this.__wbg_ptr = ret;
|
|
6563
|
+
XTCReaderFinalization.register(this, this.__wbg_ptr, this);
|
|
6564
|
+
return this;
|
|
6565
|
+
}
|
|
6566
|
+
/**
|
|
6567
|
+
* Read a frame at the given step index (0-based). Coordinates are
|
|
6568
|
+
* converted nm -> angstrom before the frame is returned.
|
|
6569
|
+
* @param {number} step
|
|
6570
|
+
* @returns {Frame | undefined}
|
|
6571
|
+
*/
|
|
6572
|
+
read(step) {
|
|
6573
|
+
const ret = wasm.xtcreader_read(this.__wbg_ptr, step);
|
|
6574
|
+
if (ret[2]) {
|
|
6575
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
6576
|
+
}
|
|
6577
|
+
return ret[0] === 0 ? undefined : Frame.__wrap(ret[0]);
|
|
6578
|
+
}
|
|
6579
|
+
}
|
|
6580
|
+
if (Symbol.dispose) XTCReader.prototype[Symbol.dispose] = XTCReader.prototype.free;
|
|
6581
|
+
|
|
6231
6582
|
/**
|
|
6232
6583
|
* XYZ / Extended XYZ file reader.
|
|
6233
6584
|
*
|
|
@@ -6574,18 +6925,47 @@ export function writeFrame(frame, format) {
|
|
|
6574
6925
|
wasm.__wbindgen_free_command_export(deferred3_0, deferred3_1, 1);
|
|
6575
6926
|
}
|
|
6576
6927
|
}
|
|
6577
|
-
|
|
6928
|
+
|
|
6929
|
+
/**
|
|
6930
|
+
* Serialize a [`Frame`] to bytes in a binary trajectory format.
|
|
6931
|
+
*
|
|
6932
|
+
* Mirrors [`write_frame_export`] for the formats whose output is not valid
|
|
6933
|
+
* UTF-8: `"dcd"`, `"trr"`, `"xtc"` (case-insensitive). Returns a
|
|
6934
|
+
* `Uint8Array` to JavaScript. The GROMACS formats (`trr`/`xtc`) are written
|
|
6935
|
+
* in nm — coordinates and box are scaled Å → nm on a throwaway clone first.
|
|
6936
|
+
*
|
|
6937
|
+
* # Errors
|
|
6938
|
+
*
|
|
6939
|
+
* Throws a `JsValue` string if the format is not a known binary format, the
|
|
6940
|
+
* frame is missing required columns, or the writer encounters an error.
|
|
6941
|
+
* @param {Frame} frame
|
|
6942
|
+
* @param {string} format
|
|
6943
|
+
* @returns {Uint8Array}
|
|
6944
|
+
*/
|
|
6945
|
+
export function writeFrameBytes(frame, format) {
|
|
6946
|
+
_assertClass(frame, Frame);
|
|
6947
|
+
const ptr0 = passStringToWasm0(format, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
6948
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6949
|
+
const ret = wasm.writeFrameBytes(frame.__wbg_ptr, ptr0, len0);
|
|
6950
|
+
if (ret[3]) {
|
|
6951
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
6952
|
+
}
|
|
6953
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
6954
|
+
wasm.__wbindgen_free_command_export(ret[0], ret[1] * 1, 1);
|
|
6955
|
+
return v2;
|
|
6956
|
+
}
|
|
6957
|
+
export function __wbg___wbindgen_debug_string_c25d447a39f5578f(arg0, arg1) {
|
|
6578
6958
|
const ret = debugString(arg1);
|
|
6579
6959
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
6580
6960
|
const len1 = WASM_VECTOR_LEN;
|
|
6581
6961
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
6582
6962
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
6583
6963
|
}
|
|
6584
|
-
export function
|
|
6964
|
+
export function __wbg___wbindgen_memory_de265df8aadd6273() {
|
|
6585
6965
|
const ret = wasm.memory;
|
|
6586
6966
|
return ret;
|
|
6587
6967
|
}
|
|
6588
|
-
export function
|
|
6968
|
+
export function __wbg___wbindgen_string_get_b0ca35b86a603356(arg0, arg1) {
|
|
6589
6969
|
const obj = arg1;
|
|
6590
6970
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
6591
6971
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
@@ -6593,10 +6973,10 @@ export function __wbg___wbindgen_string_get_71bb4348194e31f0(arg0, arg1) {
|
|
|
6593
6973
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
6594
6974
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
6595
6975
|
}
|
|
6596
|
-
export function
|
|
6976
|
+
export function __wbg___wbindgen_throw_344f42d3211c4765(arg0, arg1) {
|
|
6597
6977
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
6598
6978
|
}
|
|
6599
|
-
export function
|
|
6979
|
+
export function __wbg_done_89b2b13e91a60321(arg0) {
|
|
6600
6980
|
const ret = arg0.done;
|
|
6601
6981
|
return ret;
|
|
6602
6982
|
}
|
|
@@ -6615,38 +6995,38 @@ export function __wbg_frameindexentry_new(arg0) {
|
|
|
6615
6995
|
const ret = FrameIndexEntry.__wrap(arg0);
|
|
6616
6996
|
return ret;
|
|
6617
6997
|
}
|
|
6618
|
-
export function
|
|
6998
|
+
export function __wbg_getRandomValues_cc7f052a444bb2ce() { return handleError(function (arg0, arg1) {
|
|
6619
6999
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
6620
7000
|
}, arguments); }
|
|
6621
|
-
export function
|
|
7001
|
+
export function __wbg_get_53202602c459bfb1(arg0, arg1) {
|
|
6622
7002
|
const ret = arg0.get(arg1);
|
|
6623
7003
|
return ret;
|
|
6624
7004
|
}
|
|
6625
|
-
export function
|
|
7005
|
+
export function __wbg_get_unchecked_6e0ad6d2a41b06f6(arg0, arg1) {
|
|
6626
7006
|
const ret = arg0[arg1 >>> 0];
|
|
6627
7007
|
return ret;
|
|
6628
7008
|
}
|
|
6629
|
-
export function
|
|
7009
|
+
export function __wbg_keys_8e08ab7a3c20df35(arg0) {
|
|
6630
7010
|
const ret = arg0.keys();
|
|
6631
7011
|
return ret;
|
|
6632
7012
|
}
|
|
6633
|
-
export function
|
|
7013
|
+
export function __wbg_length_0133fa10e3234c57(arg0) {
|
|
6634
7014
|
const ret = arg0.length;
|
|
6635
7015
|
return ret;
|
|
6636
7016
|
}
|
|
6637
|
-
export function
|
|
7017
|
+
export function __wbg_length_1f0964f4a5e2c6d8(arg0) {
|
|
6638
7018
|
const ret = arg0.length;
|
|
6639
7019
|
return ret;
|
|
6640
7020
|
}
|
|
6641
|
-
export function
|
|
7021
|
+
export function __wbg_length_370319915dc99107(arg0) {
|
|
6642
7022
|
const ret = arg0.length;
|
|
6643
7023
|
return ret;
|
|
6644
7024
|
}
|
|
6645
|
-
export function
|
|
7025
|
+
export function __wbg_length_381d540857ec99e8(arg0) {
|
|
6646
7026
|
const ret = arg0.length;
|
|
6647
7027
|
return ret;
|
|
6648
7028
|
}
|
|
6649
|
-
export function
|
|
7029
|
+
export function __wbg_length_a6f0e2586a65d524(arg0) {
|
|
6650
7030
|
const ret = arg0.length;
|
|
6651
7031
|
return ret;
|
|
6652
7032
|
}
|
|
@@ -6658,74 +7038,74 @@ export function __wbg_new_227d7c05414eb861() {
|
|
|
6658
7038
|
const ret = new Error();
|
|
6659
7039
|
return ret;
|
|
6660
7040
|
}
|
|
6661
|
-
export function
|
|
7041
|
+
export function __wbg_new_32b398fb48b6d94a() {
|
|
6662
7042
|
const ret = new Array();
|
|
6663
7043
|
return ret;
|
|
6664
7044
|
}
|
|
6665
|
-
export function
|
|
7045
|
+
export function __wbg_new_cd45aabdf6073e84(arg0) {
|
|
6666
7046
|
const ret = new Uint8Array(arg0);
|
|
6667
7047
|
return ret;
|
|
6668
7048
|
}
|
|
6669
|
-
export function
|
|
7049
|
+
export function __wbg_new_from_slice_7568ba55b4a7e81f(arg0, arg1) {
|
|
6670
7050
|
const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
|
|
6671
7051
|
return ret;
|
|
6672
7052
|
}
|
|
6673
|
-
export function
|
|
6674
|
-
const ret = new
|
|
7053
|
+
export function __wbg_new_from_slice_7e254b47c77fb8cc(arg0, arg1) {
|
|
7054
|
+
const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
|
|
6675
7055
|
return ret;
|
|
6676
7056
|
}
|
|
6677
|
-
export function
|
|
6678
|
-
const ret = new
|
|
7057
|
+
export function __wbg_new_from_slice_adc482e0820cc439(arg0, arg1) {
|
|
7058
|
+
const ret = new Int32Array(getArrayI32FromWasm0(arg0, arg1));
|
|
6679
7059
|
return ret;
|
|
6680
7060
|
}
|
|
6681
|
-
export function
|
|
7061
|
+
export function __wbg_new_with_length_112583d83d0cb73c(arg0) {
|
|
6682
7062
|
const ret = new Float64Array(arg0 >>> 0);
|
|
6683
7063
|
return ret;
|
|
6684
7064
|
}
|
|
6685
|
-
export function
|
|
7065
|
+
export function __wbg_new_with_length_664ae1da061c56fa(arg0) {
|
|
6686
7066
|
const ret = new Int32Array(arg0 >>> 0);
|
|
6687
7067
|
return ret;
|
|
6688
7068
|
}
|
|
6689
|
-
export function
|
|
7069
|
+
export function __wbg_new_with_length_e6785c33c8e4cce8(arg0) {
|
|
6690
7070
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
6691
7071
|
return ret;
|
|
6692
7072
|
}
|
|
6693
|
-
export function
|
|
7073
|
+
export function __wbg_new_with_length_f048f86e32f1515e(arg0) {
|
|
6694
7074
|
const ret = new Uint32Array(arg0 >>> 0);
|
|
6695
7075
|
return ret;
|
|
6696
7076
|
}
|
|
6697
|
-
export function
|
|
7077
|
+
export function __wbg_next_71f2aa1cb3d1e37e() { return handleError(function (arg0) {
|
|
6698
7078
|
const ret = arg0.next();
|
|
6699
7079
|
return ret;
|
|
6700
7080
|
}, arguments); }
|
|
6701
|
-
export function
|
|
7081
|
+
export function __wbg_prototypesetcall_18a0f7bcf4a5652d(arg0, arg1, arg2) {
|
|
6702
7082
|
Int32Array.prototype.set.call(getArrayI32FromWasm0(arg0, arg1), arg2);
|
|
6703
7083
|
}
|
|
6704
|
-
export function
|
|
6705
|
-
Uint32Array.prototype.set.call(getArrayU32FromWasm0(arg0, arg1), arg2);
|
|
6706
|
-
}
|
|
6707
|
-
export function __wbg_prototypesetcall_83f8c8d8e36faf9f(arg0, arg1, arg2) {
|
|
7084
|
+
export function __wbg_prototypesetcall_21a175a0a8157491(arg0, arg1, arg2) {
|
|
6708
7085
|
Float64Array.prototype.set.call(getArrayF64FromWasm0(arg0, arg1), arg2);
|
|
6709
7086
|
}
|
|
6710
|
-
export function
|
|
7087
|
+
export function __wbg_prototypesetcall_4770620bbe4688a0(arg0, arg1, arg2) {
|
|
6711
7088
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
6712
7089
|
}
|
|
6713
|
-
export function
|
|
7090
|
+
export function __wbg_prototypesetcall_62396032bc038599(arg0, arg1, arg2) {
|
|
7091
|
+
Uint32Array.prototype.set.call(getArrayU32FromWasm0(arg0, arg1), arg2);
|
|
7092
|
+
}
|
|
7093
|
+
export function __wbg_push_d2ae3af0c1217ae6(arg0, arg1) {
|
|
6714
7094
|
const ret = arg0.push(arg1);
|
|
6715
7095
|
return ret;
|
|
6716
7096
|
}
|
|
6717
|
-
export function
|
|
7097
|
+
export function __wbg_set_29967298e530d279(arg0, arg1, arg2) {
|
|
6718
7098
|
arg0.set(getArrayF64FromWasm0(arg1, arg2));
|
|
6719
7099
|
}
|
|
6720
|
-
export function
|
|
7100
|
+
export function __wbg_set_d07b6d94c9c97f43(arg0, arg1, arg2) {
|
|
6721
7101
|
arg0.set(getArrayI32FromWasm0(arg1, arg2));
|
|
6722
7102
|
}
|
|
6723
|
-
export function
|
|
6724
|
-
arg0[arg1 >>> 0] = arg2 >>> 0;
|
|
6725
|
-
}
|
|
6726
|
-
export function __wbg_set_index_dd52456a7aef02bf(arg0, arg1, arg2) {
|
|
7103
|
+
export function __wbg_set_index_0a2d916cd3658df4(arg0, arg1, arg2) {
|
|
6727
7104
|
arg0[arg1 >>> 0] = arg2;
|
|
6728
7105
|
}
|
|
7106
|
+
export function __wbg_set_index_1edd196294cd6dbf(arg0, arg1, arg2) {
|
|
7107
|
+
arg0[arg1 >>> 0] = arg2 >>> 0;
|
|
7108
|
+
}
|
|
6729
7109
|
export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
|
|
6730
7110
|
const ret = arg1.stack;
|
|
6731
7111
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
|
|
@@ -6733,7 +7113,7 @@ export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
|
|
|
6733
7113
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
6734
7114
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
6735
7115
|
}
|
|
6736
|
-
export function
|
|
7116
|
+
export function __wbg_value_a5d5488a9589444a(arg0) {
|
|
6737
7117
|
const ret = arg0.value;
|
|
6738
7118
|
return ret;
|
|
6739
7119
|
}
|
|
@@ -6805,6 +7185,9 @@ const FrameFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
6805
7185
|
const FrameIndexEntryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6806
7186
|
? { register: () => {}, unregister: () => {} }
|
|
6807
7187
|
: new FinalizationRegistry(ptr => wasm.__wbg_frameindexentry_free(ptr, 1));
|
|
7188
|
+
const GROReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
7189
|
+
? { register: () => {}, unregister: () => {} }
|
|
7190
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_groreader_free(ptr, 1));
|
|
6808
7191
|
const GyrationTensorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6809
7192
|
? { register: () => {}, unregister: () => {} }
|
|
6810
7193
|
: new FinalizationRegistry(ptr => wasm.__wbg_gyrationtensor_free(ptr, 1));
|
|
@@ -6820,21 +7203,24 @@ const LAMMPSTrajReaderFinalization = (typeof FinalizationRegistry === 'undefined
|
|
|
6820
7203
|
const LinkedCellFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6821
7204
|
? { register: () => {}, unregister: () => {} }
|
|
6822
7205
|
: new FinalizationRegistry(ptr => wasm.__wbg_linkedcell_free(ptr, 1));
|
|
7206
|
+
const MOL2ReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
7207
|
+
? { register: () => {}, unregister: () => {} }
|
|
7208
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_mol2reader_free(ptr, 1));
|
|
6823
7209
|
const MSDFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6824
7210
|
? { register: () => {}, unregister: () => {} }
|
|
6825
7211
|
: new FinalizationRegistry(ptr => wasm.__wbg_msd_free(ptr, 1));
|
|
6826
7212
|
const MSDResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6827
7213
|
? { register: () => {}, unregister: () => {} }
|
|
6828
7214
|
: new FinalizationRegistry(ptr => wasm.__wbg_msdresult_free(ptr, 1));
|
|
6829
|
-
const MolRecReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6830
|
-
? { register: () => {}, unregister: () => {} }
|
|
6831
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_molrecreader_free(ptr, 1));
|
|
6832
7215
|
const NeighborListFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6833
7216
|
? { register: () => {}, unregister: () => {} }
|
|
6834
7217
|
: new FinalizationRegistry(ptr => wasm.__wbg_neighborlist_free(ptr, 1));
|
|
6835
7218
|
const PDBReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6836
7219
|
? { register: () => {}, unregister: () => {} }
|
|
6837
7220
|
: new FinalizationRegistry(ptr => wasm.__wbg_pdbreader_free(ptr, 1));
|
|
7221
|
+
const POSCARReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
7222
|
+
? { register: () => {}, unregister: () => {} }
|
|
7223
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_poscarreader_free(ptr, 1));
|
|
6838
7224
|
const RDFFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6839
7225
|
? { register: () => {}, unregister: () => {} }
|
|
6840
7226
|
: new FinalizationRegistry(ptr => wasm.__wbg_rdf_free(ptr, 1));
|
|
@@ -6844,12 +7230,18 @@ const RDFResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
6844
7230
|
const RadiusOfGyrationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6845
7231
|
? { register: () => {}, unregister: () => {} }
|
|
6846
7232
|
: new FinalizationRegistry(ptr => wasm.__wbg_radiusofgyration_free(ptr, 1));
|
|
7233
|
+
const RecordReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
7234
|
+
? { register: () => {}, unregister: () => {} }
|
|
7235
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_recordreader_free(ptr, 1));
|
|
6847
7236
|
const SDFReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6848
7237
|
? { register: () => {}, unregister: () => {} }
|
|
6849
7238
|
: new FinalizationRegistry(ptr => wasm.__wbg_sdfreader_free(ptr, 1));
|
|
6850
7239
|
const SmilesIRFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6851
7240
|
? { register: () => {}, unregister: () => {} }
|
|
6852
7241
|
: new FinalizationRegistry(ptr => wasm.__wbg_smilesir_free(ptr, 1));
|
|
7242
|
+
const TRRReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
7243
|
+
? { register: () => {}, unregister: () => {} }
|
|
7244
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_trrreader_free(ptr, 1));
|
|
6853
7245
|
const TopologyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6854
7246
|
? { register: () => {}, unregister: () => {} }
|
|
6855
7247
|
: new FinalizationRegistry(ptr => wasm.__wbg_topology_free(ptr, 1));
|
|
@@ -6883,6 +7275,9 @@ const WasmSdfStreamFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
6883
7275
|
const WasmXyzStreamFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6884
7276
|
? { register: () => {}, unregister: () => {} }
|
|
6885
7277
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmxyzstream_free(ptr, 1));
|
|
7278
|
+
const XTCReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
7279
|
+
? { register: () => {}, unregister: () => {} }
|
|
7280
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_xtcreader_free(ptr, 1));
|
|
6886
7281
|
const XYZReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6887
7282
|
? { register: () => {}, unregister: () => {} }
|
|
6888
7283
|
: new FinalizationRegistry(ptr => wasm.__wbg_xyzreader_free(ptr, 1));
|
package/molrs_bg.wasm
CHANGED
|
Binary file
|