Back to API
API Documentation
annotate_peak
Category: Data Visualization
Classes
annotate_peak
A Dash application for annotating NMR spectra with interactive features. This application allows users to visualize NMR spectra, add annotations, style lines, and export annotations in HTML and JSON formats. Parameters:
- spectra: DataFrame containing NMR spectra data.
- ppm: List of ppm values corresponding to the spectra.
- label: Series or DataFrame containing labels for the spectra. Usage:
import pandas as pd
df = pd.read_csv('path_to_your_data.csv')
spectra = df.iloc[:, 1:] # Assuming first column is not part of spectra
ppm = spectra.columns.astype(float).to_list()
label = df['Group'] # Assuming 'Group' is the label column
annotator = annotate_peak(label, spectra, ppm, label)
annotator.run(debug=True, port=8050)