Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spectral Calculation Generator

A simple application that calculates peak intensity, area under the curve (AUC), and full width at half maximum (FWHM) from structural spectroscopy data (Raman, FTIR, UV-Vis, etc.). Using user-defined parameters, it processes multiple datasets in batch to eliminate manual analysis, extracting these spectral features into a clean, publication-ready Microsoft Excel spreadsheet where each processed spectrum is organized as a structured data row.

Application Screenshot


🚀 Core Features

  • Multi-Format Ingestion: Load directories or custom selections of raw spectral files simultaneously.

  • Dual Visualization: Inspect spectra via an inline static dashboard plot or an interactive web-browser-based Plotly interface.

  • Spectral Info Summary: View a quick tabular overview of all loaded spectra details, including ranges, min/max intensities, and resolution steps.

  • Protocol Automation: Save or load parameter sets as reusable .json files to streamline workflows.

  • Structured Export: Generate clean data matrices matching calculated features against their source file signatures.


📊 Methodological Logic & Core Operations

The application focuses on the specific spectral region you choose for each spectrum to calculate metrics based on your selected calculation type:

  1. Area Under Curve ("Area") Evaluates the total integrated area of a specified spectral region using the composite trapezoidal rule via scipy.integrate.trapezoid.

  2. Peak Intensity Extracts the highest measured value within your target window using numpy.max. If you select a single specific point on the X-axis ($X_1 = X_2$), the app automatically finds and maps the closest available data point in the spectrum using an absolute distance matrix search.

  3. Full Width at Half Maximum ("FWHM Gaussian" / "Lorentzian" / "Gauss-Lorentzian") For peak width analysis, the app automatically finds the highest peak in your selected region using scipy.signal.find_peaks. It then fits this segment to a mathematical model (Gaussian, Lorentzian, or a mixed profile) using non-linear least squares optimization via scipy.optimize.curve_fit. Once the model fits the peak, the application calculates exactly how wide the peak is at half of its maximum height.


📂 Supported File Formats

The backend parser handles raw instrumentation and data arrays automatically via file extensions:

  • Bruker OPUS Data: Native files ending with numeric channel sequences (e.g., .0, .1).
  • Text/ASCII Columns: Spreadsheet exports containing standard format layouts (.txt, .dat, .dpt).
  • JCAMP-DX & SPC Format: Standard laboratory instrumentation arrays (.dx, .spc).
  • Renishaw & MATLAB Sets: Core analytical data arrays (.wdf, .mat).

⚙️ Running the Application

Option A: Portable Executable (.exe)

No Python installation required (Windows only).

  1. Download Spectral_Calculation_Generator.zip from the Releases page.
  2. Unzip the file.
  3. Double-click the Spectral_Calculation_Generator.exe file to launch the Graphical User Interface.

⚠️ Antivirus Warning: Initial startup may trigger a false positive flag from Windows Defender or corporate firewalls due to the single-binary packaging. Click "Run Anyway" to proceed safely.

Option B: Running from Source Code

If you are developing or modifying features, you can launch the script using a local environment setup:

  1. Clone or unpack the repository bundle.
  2. Install the necessary library framework dependencies using pip:
    pip install -r requirements.txt
    python Spectral_Calculation_Generator.py

💡 Quick Start Guide

  1. Import Data: Click 📁 Open Directory or 📄 Open Files on the top toolbar to load your data.
  2. Define a Rule: In the right sidebar panel, input a descriptive label name (e.g., Amide_I), pick a calculation mode, define your X_axis range (X1​→X2)​, and click ➕ Add.
  3. Run Processing Pipeline: Click the green 🧮 Calculate & Generate Excel button in the status bar at the bottom. Select a storage path on your computer, and the formatted report sheet will instantly generate.

⚠️ Data Preprocessing Notice: This application is designed exclusively for feature extraction from ready-to-analyze data. Input spectra must be fully preprocessed (baseline corrected, spikes removed, smoothed, or normalized) prior to loading.

🛠️ Troubleshooting & Feedback

  • File Format Requests: If an output file fails to load, open a GitHub issue and attach a sample file to request a parser update.

  • Bug Reports & Calculation Errors: Open a ticket on the GitHub Issues page including your .json parameter file and the error log.

  • Feature Requests: If you need more features or specific analytical metrics added to the pipeline, feel free to open an issue or start a discussion on the GitHub repository.

  • Direct Support: Send inquiries and sample datasets to: shibarjunmandal@gmail.com.

📜 Citations & Publications

If this software helps automate your workflow and the generated results are utilized in a scientific publication, thesis, or conference report, please cite this repository to support the project:

Shibarjun Mandal, Spectral Calculation Generator (Version 1.0). GitHub Repository: Spectral-Calculation-Generator

☕ Support the Project

If you find this utility useful and it saves you manual data-entry time, consider supporting further development! You can contribute and help keep the project active by clicking the Sponsor button at the top of the GitHub repository page.

🤝 License & Legal

This project is maintained under a standard open-source license. Authors retain intellectual property rights, but users are granted permission to freely use, modify, and distribute the code and executable, provided appropriate credit is given as outlined in the Citation section.

About

Batch-process spectroscopy data (Raman, FTIR, UV-Vis, etc.) to extract peak intensity, AUC, and FWHM—exporting results to Excel for easy analysis.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages