{"name":"ml-tree-similarity","version":"2.2.0","description":"Compares two spectra using a tree similarity","main":"./lib/index.js","module":"./lib-esm/index.js","types":"./lib/index.d.ts","scripts":{"check-types":"tsc --noEmit","clean":"rimraf lib lib-esm","eslint":"eslint src","eslint-fix":"npm run eslint -- --fix","prepack":"npm run tsc","prettier":"prettier --check src","prettier-write":"prettier --write src","test":"npm run test-only && npm run eslint && npm run prettier && npm run check-types","test-only":"vitest run --coverage","tsc":"npm run clean && npm run tsc-cjs && npm run tsc-esm","tsc-cjs":"tsc --project tsconfig.cjs.json","tsc-esm":"tsc --project tsconfig.esm.json"},"repository":{"type":"git","url":"git+https://github.com/mljs/tree-similarity.git"},"keywords":[],"author":{"name":"Miguel Asencio"},"license":"MIT","bugs":{"url":"https://github.com/mljs/tree-similarity/issues"},"homepage":"https://github.com/mljs/tree-similarity#readme","devDependencies":{"@babel/plugin-transform-modules-commonjs":"^7.23.3","@babel/preset-typescript":"^7.23.3","@vitest/coverage-v8":"^1.2.2","eslint":"^8.56.0","eslint-config-cheminfo-typescript":"^12.2.0","prettier":"^3.2.5","rimraf":"^5.0.5","typescript":"^5.3.3","vitest":"^1.2.2"},"dependencies":{"binary-search":"^1.3.6","cheminfo-types":"^1.7.2"},"_id":"ml-tree-similarity@2.2.0","gitHead":"ae0d9a1bddeebbc190d6d349d1ffe8974a8d5b07","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-fL/+YBDNQRE1YpjigSIID0Jy4K1f1c2N877n53E4B11x2kNufo4q7Phlfl0J5V812ljoR15qKRb7i1me0PgBpw==","shasum":"f18310416a0f9862dce28716777fccb76b8071ab","tarball":"http://registry-npm.ywwl.com/ml-tree-similarity/download/ml-tree-similarity-2.2.0.tgz","fileCount":43,"unpackedSize":33544,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/Hb1kh+B3Pz1RGwMHuibh4tN8g1Zh7HdtCPTxnqDICAiEAy++Ppmhkb6OaWPvL5s4ho/EZZHSgEUvVaR27uokZ0XU="}],"size":8033,"noattachment":false,"key":"/ml-tree-similarity/-/ml-tree-similarity-2.2.0.tgz"},"_npmUser":{"name":"mljs-bot","email":"bot+npm-mljs@zakodium.com"},"directories":{},"maintainers":[{"name":"stropitek","email":"kostro.d@gmail.com"},{"name":"targos","email":"targos+npm@protonmail.com"},{"name":"lpatiny","email":"luc@patiny.com"},{"name":"mljs-bot","email":"bot+npm-mljs@zakodium.com"},{"name":"maasencioh","email":"maasencioh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ml-tree-similarity_2.2.0_1708004859568_0.26970394782173335"},"_hasShrinkwrap":false,"readme":"# tree-similarity\n\n[![NPM version][npm-image]][npm-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![npm download][download-image]][download-url]\n\nCompares two spectra using a tree similarity.\n\n## Installation\n\n`$ npm i ml-tree-similarity`\n\n## Usage\n\n```js\nimport { createTree, treeSimilarity } from 'ml-tree-similarity';\n\nconst a = {\n  x: [1, 2, 3, 4, 5, 6, 7],\n  y: [0.3, 0.7, 4, 0.3, 0.2, 5, 0.3],\n};\nconst b = {\n  x: [1, 2, 3, 4, 5, 6, 7],\n  y: [0.3, 4, 0.7, 0.3, 5, 0.2, 0.3],\n};\n\n// create a tree\nconst options = { from: 1, to: 7 };\nconst aTree = createTree(a, options);\nconst bTree = createTree(b, options);\n\nconst ans = treeSimilarity(aTree, bTree, options);\n```\n\n## [API Documentation](https://mljs.github.io/tree-similarity/)\n\nThis algorithm was based in the following papers:\n\n- [A new method for the comparison of 1H NMR predictors based on tree-similarity of spectra](https://doi.org/10.1186/1758-2946-6-9)\n- [Fast and shift-insensitive similarity comparisons of NMR using a tree-representation of spectra](https://doi.org/10.1016/j.chemolab.2013.05.009)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/ml-tree-similarity.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/ml-tree-similarity\n[codecov-image]: https://img.shields.io/codecov/c/github/mljs/tree-similarity.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/mljs/tree-similarity\n[download-image]: https://img.shields.io/npm/dm/ml-tree-similarity.svg?style=flat-square\n[download-url]: https://npmjs.org/package/ml-tree-similarity\n","publish_time":1708004859773,"_cnpm_publish_time":1708004859773,"dist-tags":{"latest":"2.2.0"}}