Skip to main content

Orange Data Mining widgets for spectroscopy: import spectra from IRUG/SOPRANO URLs, similarity search, spectral libraries (.speclib) and NNLS mixture analysis.

Project description

orange-spectra — spectroscopy widgets for Orange Data Mining

English中文

Five spectroscopy widgets for Orange Data Mining. They share their algorithms and the .speclib library format with SpectraView, a desktop spectroscopy viewer. Fetch spectra from public databases by URL, compare and search them, build reusable reference libraries, decompose mixtures, and draw aquaphotomics aquagrams — all inside Orange's visual workflow canvas.

Widget What it does
Import Spectrum URL Paste an IRUG id/URL or a SOPRANO URL (direct JCAMP-DX/CSV links work too), download and plot the spectrum, and output an Orange Table (one spectrum per row, wavenumbers as column names).
Spectra Similarity Score similarity between two sets of spectra: correlation, cosine, spectral angle (SAM), and Euclidean distance.
Spectral Library Build a reference library, save it as .speclib (interoperable with SpectraView), and rank an unknown spectrum against the library.
Mixture Analysis Decompose a mixed spectrum with non‑negative least squares (NNLS): solve mixture ≈ Σ cᵢ·refᵢ and report coefficients, proportions, and R².
Aquagram Aquaphotomics: read normalized absorbance at water's 12 characteristic bands (WAMACs) and draw a 12‑axis radar chart (raw / SNV / aquagram normalization).

The output Table follows the Orange-Spectroscopy convention (column names = wavelength/wavenumber, one spectrum per row), so it plugs straight into the Spectra viewer widget or into PCA / PLS chemometrics pipelines.

Install

⚠️ Know which Orange you run first — the desktop App and a pip‑installed Orange are separate Python environments. Installing into the wrong one means the widgets won't appear.

Works on Windows, macOS (Apple Silicon & Intel), and Linux — it's pure Python (numpy / scipy / matplotlib / Orange3).

A. Desktop App (the standalone program from orangedatamining.com): Options ▸ Add-ons… ▸ Add more…, type orange-spectra, tick it, OK, and restart. On macOS, download the Mac .dmg from https://orangedatamining.com/download/.

B. pip Orange (started with python -m Orange.canvas):

pip install orange-spectra
python -m Orange.canvas

On macOS use python3 / pip3 (e.g. install Python via Homebrew: brew install python).

If Orange fails to start with ImportError: PyQt5 … not available, it's missing a Qt binding — install one:

pip install PyQt5 PyQtWebEngine

After (re)starting Orange, a Spectra category with the five widgets appears in the toolbox.

Quick start

  1. Drop in Import Spectrum URL, enter 4119 (IRUG's PB15 phthalocyanine blue Raman spectrum) → Fetch.
  2. Fetch a few reference spectra → feed them to the Spectral Library Spectra input → Add input spectra to librarySave… as a .speclib.
  3. Feed an unknown spectrum to the library's Query input → the Hits output is the ranked match table.
  4. Feed a mixed spectrum to Mixture Analysis Mixture and the references (or the library's Library output) to References → get component proportions and R².

Every widget has an ℹ How to use box and a 📖 Open tutorial button in its top‑left corner.

Supported URL formats

  • IRUG detail pages (jqPlot‑embedded data)
  • SOPRANO pages (Dygraph‑embedded data)
  • JCAMP-DX (AFFN plain‑number format)
  • Two‑column CSV/TSV

Compressed JCAMP (SQZ/DIF) is not parsed here — open it in SpectraView and export first.

Documentation

Full tutorial with real‑data demos: https://tai-shengyeh.github.io/spectraview/orange.html (English).

Notes

  • You only need to install once; updating requires a reinstall (pip install --upgrade orange-spectra) and an Orange restart.
  • Source, issues, and the desktop SpectraView app: https://github.com/Tai-ShengYeh/spectraview.

License

MIT.


orange-spectra — Orange Data Mining 光譜 widgets

English中文

五個給 Orange Data Mining 的光譜學 widgets, 與桌面版光譜檢視程式 SpectraView 共用演算法與 .speclib 光譜庫格式。可用網址從公開資料庫抓光譜、比對與搜尋、建立可重複使用的 參考光譜庫、拆解混合光譜,並繪製 aquaphotomics 雷達圖——全部在 Orange 的視覺化 工作流程畫布中完成。

Widget 功能
Import Spectrum URL 貼上 IRUG 編號/網址SOPRANO 網址(也支援 JCAMP-DX/CSV 直接網址),下載並畫出光譜,輸出成 Orange Table(每列一條光譜、欄名=波數)。
Spectra Similarity 兩組光譜間的相似度:correlation / cosine / 光譜角 SAM / Euclidean。
Spectral Library 建立參考光譜庫、存成 .speclib(與 SpectraView 互通)、對庫比對未知譜並輸出排名。
Mixture Analysis 混合光譜的成分分析:以非負最小平方(NNLS)解 mixture ≈ Σ cᵢ·refᵢ,回報係數、比例與 R²。
Aquagram Aquaphotomics:在水的 12 個特徵吸收帶(WAMACs)取正規化吸光度,畫 12 軸雷達圖(raw / SNV / aquagram 三種正規化)。

輸出的 TableOrange-Spectroscopy 慣例(欄名=波長/波數、每列一條光譜),可直接接其 Spectra 檢視 widget 或 PCA / PLS 等化學計量學流程。

安裝

⚠️ 先確認你的 Orange 是哪一種——桌面版 App 與 pip 版是不同的 Python 環境,裝錯不會出現 widgets。

可在 Windows、macOS(Apple 晶片與 Intel)、Linux 執行——純 Python (numpy / scipy / matplotlib / Orange3)。

A. 桌面版 App(orangedatamining.com 下載的獨立程式): Options ▸ Add-ons… ▸ Add more… 輸入 orange-spectra → 打勾 → OK → 重啟。 macOS 到 https://orangedatamining.com/download/ 下載 Mac 版 .dmg

B. pip 版 Orangepython -m Orange.canvas 啟動):

pip install orange-spectra
python -m Orange.canvas

macOS 請用 python3 / pip3(可用 Homebrew 裝 Python: brew install python)。

若 Orange 開不了並出現 ImportError: PyQt5 … not available,是少了 Qt 綁定, 補裝:

pip install PyQt5 PyQtWebEngine

重新啟動 Orange,工具箱會出現 Spectra 分類(5 個 widgets)。

快速上手

  1. 拖出 Import Spectrum URL,輸入 4119(IRUG 的 PB15 酞菁藍 Raman 譜) → Fetch
  2. 多抓幾條參考譜 → 接 Spectral LibrarySpectra 輸入 → Add input spectra to librarySave… 存成 .speclib
  3. 未知譜接 Library 的 Query 輸入 → Hits 輸出就是排名表。
  4. 混合譜接 Mixture AnalysisMixture、參考譜(或 Library 的 Library 輸出)接 References → 得成分比例與 R²。

每個 widget 左上角都有「ℹ 說明 How to use」盒子與「📖 開啟線上教學」按鈕。

支援的網址格式

  • IRUG 詳情頁(jqPlot 內嵌資料)
  • SOPRANO 頁(Dygraph 內嵌資料)
  • JCAMP-DX(AFFN 純數字格式)
  • 兩欄 CSV/TSV

壓縮的 JCAMP(SQZ/DIF)這裡不解析——請先用 SpectraView 開啟後匯出。

教學文件

含真實數據 Demo 的完整教學: https://tai-shengyeh.github.io/spectraview/orange.htmlEnglish)。

注意

授權

MIT。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

orange_spectra-0.1.4.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

orange_spectra-0.1.4-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file orange_spectra-0.1.4.tar.gz.

File metadata

  • Download URL: orange_spectra-0.1.4.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for orange_spectra-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d09ba2d8c3295e0e097d28b6690d8797cc0bb4122d19525cca537a544a679649
MD5 eb69279d9c915a7c6bb492d52ba03d59
BLAKE2b-256 7225876d56111f7cc930c2e73c0cce2a0a760264b1816aa81cc53f90aaa9dc5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for orange_spectra-0.1.4.tar.gz:

Publisher: publish-pypi.yml on Tai-ShengYeh/spectraview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file orange_spectra-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: orange_spectra-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for orange_spectra-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7e5c13f764e768aa50734be04d046daea736d837abe015beb3cb09d3da47fd3d
MD5 f1182d5545eab4805478b7f290e11725
BLAKE2b-256 70b3983e653ec20746e6049bbf0b8c19af724722287f977d5081ba0930709cee

See more details on using hashes here.

Provenance

The following attestation bundles were made for orange_spectra-0.1.4-py3-none-any.whl:

Publisher: publish-pypi.yml on Tai-ShengYeh/spectraview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page