日本語: TOF-SIMS(飛行時間型二次イオン質量分析)のマススペクトル・深さ方向プロファイル・PCA解析をブラウザ上で行えるPython/Streamlitアプリです。
English: A Python/Streamlit application for interactive analysis of TOF-SIMS (Time-of-Flight Secondary Ion Mass Spectrometry) data — mass spectra, depth profiles, and PCA-based multivariate analysis.
- What is TOF-SIMS?
- Features
- Intended Users
- Installation
- Usage
- Input Data Format
- Output
- Sample Data
- Screenshots
- Roadmap
- Disclaimer
- License
TOF-SIMS (Time-of-Flight Secondary Ion Mass Spectrometry) is a surface-sensitive analytical technique that provides:
- Elemental and molecular composition of the top 1–2 nm of a surface
- Depth profiles of chemical species by sequential ion sputtering
- 2D chemical imaging of lateral elemental distribution
It is widely used in semiconductor, electronic materials, polymer, and life-science research.
| Feature | Module |
|---|---|
| Multi-file mass spectrum overlay | app.py |
| TIC / mean-centering / autoscaling / Poisson normalization | app.py |
| m/z alignment across spectra | app.py |
| PCA score plot and loading plot | app.py, legacy/TOF-SIMS_data_PCA.py |
| Hierarchical clustering (dendrogram) | app.py |
| Difference spectrum between two samples | app.py, legacy/TOF-SIMS_spectrum_viewer.py |
| Peak detection in difference spectrum (scipy) | legacy/TOF-SIMS_spectrum_viewer.py |
| Interactive spectrum viewer (Plotly) | legacy/Spectrum_Viewer_Plotly.py |
| CSV export of aligned spectra / PCA scores | app.py |
| One-click demo mode (synthetic spectra, no data needed) | app.py |
Standalone desktop scripts that predate the Streamlit app live in legacy/ — see its README for details.
- Depth profile visualization and quantification
- 2D ion image display and RGB overlay
- Automated peak assignment from mass library
- Batch processing of large datasets
- Accurate mass calibration
- Docker containerization
- Surface analysis researchers (XPS, AES, TOF-SIMS, SIMS)
- Materials scientists and thin-film engineers
- Semiconductor process engineers
- Researchers interested in research DX / data-driven analysis
- Python >= 3.10
- pip
git clone https://github.com/yharada520/tof-sims-analyzer.git
cd tof-sims-analyzer
pip install -r requirements.txt# Desktop GUI scripts (PySimpleGUI-based)
pip install PySimpleGUI
# Static image export from Plotly
pip install kaleidostreamlit run app.pyOpen http://localhost:8501 in your browser.
Try it without your own data: check "デモデータを使用" (Use demo data) in the sidebar — six synthetic spectra are generated in memory (or open http://localhost:8501/?demo=1).
Upload one or more .asc, .txt, or .csv spectrum files from the sidebar. The app will:
- Parse and align spectra to a common m/z grid
- Apply the selected normalization
- Display overlaid spectra, PCA, and clustering
You can deep-link to a specific tab with ?tab=raw|diff|pca|hca.
# Interactive spectrum viewer (Plotly)
python legacy/Spectrum_Viewer_Plotly.py
# PCA analysis tool
python legacy/TOF-SIMS_data_PCA.py
# Difference spectrum between two files
python legacy/TOF-SIMS_spectrum_viewer.pyThe app accepts two formats:
Space-delimited, 3 columns, no header:
510, 0.7225411, 6
1022, 0.6806757, 2
...
| Column | Description |
|---|---|
| 1 | m/z index (integer, bin number) |
| 2 | Normalized intensity (0–1) |
| 3 | Raw ion counts |
mz,intensity,counts
1.008,0.650,8000
12.000,0.248,3050
...See examples/ for sample files.
| Output | Format | Description |
|---|---|---|
aligned_spectra.csv |
CSV | m/z-aligned intensity matrix |
pca_scores.csv |
CSV | PCA score per sample |
| Interactive plots | Plotly (browser) | Spectra, PCA, dendrogram |
| PNG graph | PNG | Static export (legacy scripts) |
All files in examples/ are synthetic / simulated data.
They do NOT originate from real measurements.
# Regenerate sample data
python examples/generate_sample_data.pyAll screenshots below use the built-in demo mode (synthetic data — no real measurements).
Spectrum overlay — upload multiple ASC files and compare them on a common m/z axis:
PCA score plot — sample groups separate automatically (demo: Si-rich group A vs. organically contaminated group B):
Difference spectrum — which m/z increased or decreased between two samples, with the top peaks tabulated (demo: m/z 73 PDMS contamination marker):
- Depth profile viewer
- 2D ion image RGB overlay
- Automated peak assignment
- Mass calibration tool
- Docker support
- English UI option
- This software is provided for research and educational purposes only.
- The author does not guarantee the accuracy of analysis results.
- Use of this software in any commercial, medical, or safety-critical context is at the user's own risk.
- This project is a personal development effort and is not affiliated with any organization or company.
MIT License — see LICENSE.
Yoshihiro Harada — materials scientist / thin-film engineer
GitHub: @yharada520


