Interface ready for preprocessing steps handling. style altered to support modular preprocessing pipeline, finished precalculations and preprocessing code, and its respective testing script, added preprocessingpipeline, a handler for the low level functions of preprocessing to work with the high level MSIData in the genie environment.

This commit is contained in:
Pixelguy14
2025-11-29 21:47:51 -06:00
parent bdd9315796
commit 11c181b3b3
13 changed files with 5039 additions and 988 deletions
+417 -214
View File
@@ -4,6 +4,16 @@
<h4>JuliaMSI&nbsp;</h4>
</div>
</header>
<!--
<div v-if="is_initializing" class="loading-overlay">
<div class="loading-content">
<q-spinner-hourglass color="white" size="4em" />
<div class="q-mt-md text-white text-h6">{{ initialization_message }}</div>
</div>
</div>
-->
<div id="extDivStyle" class="row col-12 q-pa-xl">
<div class="row col-6">
<!-- Left DIV -->
@@ -16,219 +26,408 @@
<q-separator></q-separator>
<q-tab-panels v-model="left_tab" animated>
<q-tab-panel name="pre_treatment">
<div class="text-h6">imzML & mzML Data Pre-Treatment</div>
<div class="row items-center">
<q-input standout="custom-standout" class="q-ma-sm cursor-pointer col" v-model="full_route" readonly
:label="batch_file_count > 0 ? batch_file_count + ' file(s) in batch' : 'Select an imzMl / mzML file'"
v-on:click="btnSearch=true">
<template v-slot:append>
<q-icon name="search" v-on:click="btnSearch=true" class="cursor-pointer" />
</template>
</q-input>
<q-btn class="q-ma-sm" icon="add" v-on:click="btnAddBatch=true" label="Add"></q-btn>
<q-btn class="q-ma-sm" icon="clear" v-on:click="clear_batch_btn=true" :disable="batch_file_count === 0"
label="Clear"></q-btn>
<div class="text-h6">imzML & mzML Data Pre-Treatment</div>
<!-- File Selection & Batch Controls (keep existing) -->
<div class="row items-center">
<q-input standout="custom-standout" class="q-ma-sm cursor-pointer col" v-model="full_route" readonly
:label="batch_file_count > 0 ? batch_file_count + ' file(s) in batch' : 'Select an imzMl / mzML file'"
v-on:click="btnSearch=true">
<template v-slot:append>
<q-icon name="search" v-on:click="btnSearch=true" class="cursor-pointer" />
</template>
</q-input>
<q-btn class="q-ma-sm" icon="add" v-on:click="btnAddBatch=true" label="Add"></q-btn>
<q-btn class="q-ma-sm" icon="clear" v-on:click="clear_batch_btn=true" :disable="batch_file_count === 0"
label="Clear"></q-btn>
</div>
<!-- Mask Configuration -->
<div class="row items-center q-mb-md">
<q-toggle v-model="maskEnabled" label="Apply Mask During Preprocessing" color="green" class="q-mr-md" />
</div>
<!-- Spectrum Selection for Visualization -->
<div class="row items-center q-mb-md">
<div class="text-subtitle2 q-mr-md">Preview Spectrum:</div>
<q-btn-dropdown class="q-ma-sm" :loading="progressSpectraPlot" :disable="btnSpectraDisable"
label="Generate Spectra" icon="play_arrow">
<q-list>
<q-item clickable v-close-popup v-on:click="createMeanPlot=true">
<q-item-label>Mean spectrum plot</q-item-label>
</q-item>
<q-item clickable v-close-popup v-on:click="createSumPlot=true">
<q-item-label>Sum Spectrum plot</q-item-label>
</q-item>
<q-item clickable v-close-popup v-on:click="createXYPlot=true">
<q-item-label>Spectrum plot (X,Y)</q-item-label>
</q-item>
</q-list>
</q-btn-dropdown>
<div class="row col-6">
<div class="st-col col-3 col-sm-3 q-ma-sm">
<q-input standout="custom-standout" step="1" v-model="idSpectrum" label="Spectrum ID" type="number"
hint="Not for Mean/Sum plots."></q-input>
</div>
<div class="st-col col-3 col-sm-3 q-ma-sm">
<q-input standout="custom-standout" step="1" v-model="xCoord" label="X coord" type="number" :rules="[
val => !btnSpectraDisable ? ( val >= 0 || 'Needs to be bigger than 0') : true
]"></q-input>
</div>
<div class="st-col col-3 col-sm-3 q-ma-sm">
<q-input standout="custom-standout" step="1" v-model="yCoord" label="Y coord" type="number" :rules="[
val => !btnSpectraDisable ? ( val >= 0 || 'Needs to be bigger than 0') : true
]"></q-input>
</div>
</div>
</div>
<!-- Internal Standards (Fixed First Item) -->
<q-card class="q-mb-md">
<q-card-section>
<div class="text-h6">Internal Standards</div>
<div class="text-caption">Reference peaks for calibration and alignment</div>
</q-card-section>
<q-card-section>
<!-- Keep your existing reference_peaks_list implementation -->
<q-list bordered separator class="q-mt-md">
<q-item v-for="(peak, index) in reference_peaks_list" :key="index">
<q-item-section avatar>
<q-btn flat round icon="delete" color="negative" @click="removeReferencePeak(index)"></q-btn>
</q-item-section>
<q-item-section>
<div class="row q-col-gutter-sm">
<div class="col-6">
<q-input standout="custom-standout" label="m/z" type="number" step="0.0001"
v-model.number="peak.mz" :rules="[val => !!val || 'Required', val => val > 0 || 'Must be positive']"></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Label (optional)" v-model="peak.label"></q-input>
</div>
</div>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-btn class="q-ma-sm btn-style" icon="add" label="Add Reference Peak" @click="addReferencePeak"></q-btn>
</q-item-section>
</q-item>
</q-list>
</q-card-section>
</q-card>
<!-- Reorderable Preprocessing Steps -->
<div class="text-h6 q-mb-md">Preprocessing Pipeline</div>
<q-list bordered>
<q-expansion-item v-for="(step, index) in pipeline_step_order" :key="step.name"
:label="step.label" group="preprocessing-steps"
:class="step.enabled ? '' : 'text-grey'">
<!-- Header with controls -->
<template v-slot:header>
<q-item-section avatar>
<div class="row no-wrap">
<q-btn flat round icon="arrow_upward" size="sm"
:disable="index === 0" @click.stop="moveStepUp(index)"></q-btn>
<q-btn flat round icon="arrow_downward" size="sm"
:disable="index === pipeline_step_order.length - 1" @click.stop="moveStepDown(index)"></q-btn>
</div>
<q-list bordered separator v-if="selected_files.length > 0">
<q-item v-for="(file, index) in selected_files" :key="index">
<q-item-section>
{{ file }}
</q-item-section>
<q-item-section side>
<q-btn flat round icon="delete" size="sm" v-on:click="selected_files.splice(index, 1)"></q-btn>
</q-item-section>
</q-item>
</q-list>
<q-input standout="custom-standout" class="q-ma-sm cursor-pointer col" v-model="full_route_cal" readonly
label="Select a calibration imzMl / mzML file" v-on:click="btnSearchCal=true">
<template v-slot:append>
<q-icon name="search" v-on:click="btnSearchCal=true" class="cursor-pointer" />
</template>
</q-input>-
<br>
<br>
<q-tabs v-model="pre_tab" dense class="text-grey" indicator-color="primary" align="justify">
<q-tab name="stabilization" label="Stabilization"></q-tab>
<q-tab name="smoothing" label="Smoothing"></q-tab>
<q-tab name="baseline" label="Baseline"></q-tab>
<q-tab name="calibration" label="Calibration"></q-tab>
<q-tab name="warping" label="Warping"></q-tab>
<q-tab name="peak" label="Peak Detection"></q-tab>
<q-tab name="binning" label="Binning"></q-tab>
</q-tabs>
<q-separator />
<q-tab-panels v-model="pre_tab" animated>
<q-tab-panel name="stabilization" class="q-pa-md">
<q-card class="q-mb-md">
<q-card-section>
<div class="text-h6">Method</div>
</q-card-section>
<q-card-section>
<q-radio v-model="stabilization_method" val="sqrt" label="SQRT" /><br>
<q-radio v-model="stabilization_method" val="log" label="LOG" /><br>
<q-radio v-model="stabilization_method" val="log2" label="LOG 2" /><br>
<q-radio v-model="stabilization_method" val="log10" label="LOG 10" /><br>
</q-card-section>
</q-card>
<div class="row justify-end">
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="play_arrow" v-on:click="acceptStab=true"
padding="lg" label="Accept" />
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="clear" v-on:click="undoPrep=true"
padding="lg" label="Undo" />
</div>
</q-tab-panel>
<q-tab-panel name="smoothing">
<q-card class="q-mb-md">
<q-card-section>
<div class="text-h6">Method</div>
</q-card-section>
<q-card-section>
<q-radio v-model="smoothing_method" val="sg" label="Savitzky-Golay" /><br>
<q-radio v-model="smoothing_method" val="ma" label="Moving Average" /><br>
</q-card-section>
</q-card>
<q-card>
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<q-input standout="custom-standout" label="Half Window Size" type="number"
v-model.number="smoothing_window"></q-input>
</q-card-section>
</q-card>
<div class="row justify-end q-mt-md">
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="play_arrow" v-on:click="acceptSmoo=true"
padding="lg" label="Accept" />
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="clear" v-on:click="undoPrep=true"
padding="lg" label="Undo" />
</div>
</q-tab-panel>
<q-tab-panel name="baseline">
<q-card class="q-mb-md">
<q-card-section>
<div class="text-h6">Method</div>
</q-card-section>
<q-card-section>
<q-radio v-model="baseline_method" val="snip" label="SNIP" /><br>
<q-radio v-model="baseline_method" val="tophat" label="TOP HAT" /><br>
<q-radio v-model="baseline_method" val="convex_hull" label="CONVEX HULL" /><br>
<q-radio v-model="baseline_method" val="median" label="MEDIAN" /><br>
</q-card-section>
</q-card>
<q-card>
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<q-input standout="custom-standout" label="Iterations" type="number"
v-model.number="baseline_iterations"></q-input>
</q-card-section>
</q-card>
<div class="row justify-end q-mt-md">
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="play_arrow" v-on:click="acceptBase=true"
padding="lg" label="Accept" />
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="clear" v-on:click="undoPrep=true"
padding="lg" label="Undo" />
</div>
</q-tab-panel>
<q-tab-panel name="calibration">
<q-card class="q-mb-md">
<q-card-section>
<div class="text-h6">Method</div>
</q-card-section>
<q-card-section>
<q-radio v-model="calibration_method" val="tic" label="TIC" /><br>
<q-radio v-model="calibration_method" val="pqn" label="PQN" /><br>
<q-radio v-model="calibration_method" val="median" label="MEDIAN" /><br>
</q-card-section>
</q-card>
<div class="row justify-end q-mt-md">
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="play_arrow" v-on:click="acceptCali=true"
padding="lg" label="Accept" />
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="clear" v-on:click="undoPrep=true"
padding="lg" label="Undo" />
</div>
</q-tab-panel>
<q-tab-panel name="warping">
<q-card class="q-mb-md">
<q-card-section>
<div class="text-h6">Method</div>
</q-card-section>
<q-card-section>
<q-radio v-model="warping_method" val="snip" label="SNIP" /><br>
<q-radio v-model="warping_method" val="tophat" label="TOP HAT" /><br>
<q-radio v-model="warping_method" val="convex_hull" label="CONVEX HULL" /><br>
<q-radio v-model="warping_method" val="median" label="MEDIAN" /><br>
</q-card-section>
</q-card>
<q-card>
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<q-input standout="custom-standout" label="Iterations" type="number"
v-model.number="warping_iterations"></q-input>
</q-card-section>
</q-card>
<div class="row justify-end q-mt-md">
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="play_arrow" v-on:click="acceptWarp=true"
padding="lg" label="Accept" />
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="clear" v-on:click="undoPrep=true"
padding="lg" label="Undo" />
</div>
</q-tab-panel>
<q-tab-panel name="peak">
<p>Detect if profile or centroid to determine which elements to show.</p>
<q-card class="q-mb-md">
<q-card-section>
<div class="text-h6">Method</div>
</q-card-section>
<q-card-section>
<q-radio v-model="peak_method" val="mad" label="MAD" /><br>
<q-radio v-model="peak_method" val="super_smoother" label="SUPER SMOOTHER" /><br>
</q-card-section>
</q-card>
<q-card>
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<q-input standout="custom-standout" label="Signal to Noise" type="number"
v-model.number="peak_snr"></q-input>
<q-input standout="custom-standout" label="Half Window Size" type="number" class="q-mt-md"
v-model.number="peak_window"></q-input>
<q-input standout="custom-standout" label="Intensity Threshold" type="number" class="q-mt-md"
v-model.number="peak_threshold"></q-input>
</q-card-section>
</q-card>
<div class="row justify-end q-mt-md">
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="play_arrow" v-on:click="acceptPeak=true"
padding="lg" label="Accept" />
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="clear" v-on:click="undoPrep=true"
padding="lg" label="Undo" />
</div>
</q-tab-panel>
<q-tab-panel name="binning">
<q-card>
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<q-input standout="custom-standout" label="Tolerance" type="number"
v-model.number="binning_tolerance"></q-input>
<q-input standout="custom-standout" label="Frequency Threshold" type="number" class="q-mt-md"
v-model.number="binning_threshold"></q-input>
</q-card-section>
</q-card>
<div class="row justify-end q-mt-md">
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="play_arrow" v-on:click="acceptBinn=true"
padding="lg" label="Accept" />
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="clear" v-on:click="undoPrep=true"
padding="lg" label="Undo" />
</div>
</q-tab-panel>
</q-tab-panels>
</q-tab-panel>
</q-item-section>
<q-item-section>
{{ step.label }}
</q-item-section>
<q-item-section side>
<q-toggle v-model="step.enabled" color="green" @click.stop />
</q-item-section>
</template>
<!-- Step-specific parameters -->
<q-card v-if="step.name === 'stabilization'">
<q-card-section>
<q-radio v-model="stabilization_method" val="sqrt" label="SQRT" />
<q-radio v-model="stabilization_method" val="log" label="LOG" />
<q-radio v-model="stabilization_method" val="log2" label="LOG 2" />
<q-radio v-model="stabilization_method" val="log10" label="LOG 10" />
<q-radio v-model="stabilization_method" val="log1p" label="LOG 1P" />
</q-card-section>
</q-card>
<q-card v-if="step.name === 'smoothing'">
<q-card-section>
<q-radio v-model="smoothing_method" val="sg" label="Savitzky-Golay" />
<q-radio v-model="smoothing_method" val="ma" label="Moving Average" />
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-6">
<q-input standout="custom-standout" label="Window Size" v-model.number="smoothing_window" type="number" />
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Order (Savitzky-Golay)" v-model.number="smoothing_order" type="number" />
</div>
</div>
</q-card-section>
</q-card>
<q-card v-if="step.name === 'baseline_correction'">
<q-card-section>
<div class="text-h6">Method</div>
<div class="text-caption">The algorithm to use for baseline correction.</div>
</q-card-section>
<q-card-section>
<q-radio v-model="baseline_method" val="snip" label="SNIP" hint="Sensitive Nonlinear Iterative Peak clipping." /><br>
<q-radio v-model="baseline_method" val="convex_hull" label="CONVEX HULL" hint="Finds the lower convex hull of the spectrum." /><br>
<q-radio v-model="baseline_method" val="median" label="MEDIAN" hint="Moving median filter." /><br>
</q-card-section>
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<div class="row q-col-gutter-sm">
<div class="col-6">
<q-input standout="custom-standout" label="Iterations (for SNIP)" type="number"
:placeholder="suggested_baseline_iterations" v-model.number="baseline_iterations" hint="The number of iterations for the SNIP algorithm. A higher number results in a more aggressive baseline."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Window (for Median)" type="number"
:placeholder="suggested_baseline_window" v-model.number="baseline_window" hint="The window size for the median method, determining the local region for median calculation."></q-input>
</div>
</div>
</q-card-section>
</q-card>
<q-card v-if="step.name === 'normalization'">
<q-card-section>
<div class="text-h6">Method</div>
<div class="text-caption">The normalization method to apply.</div>
</q-card-section>
<q-card-section>
<q-radio v-model="normalization_method" val="tic" label="TIC" hint="Total Ion Current normalization (divides by the sum of intensities)." /><br>
<q-radio v-model="normalization_method" val="median" label="MEDIAN" hint="Divides by the median intensity." /><br>
<q-radio v-model="normalization_method" val="rms" label="RMS" hint="Root Mean Square normalization." /><br>
<q-radio v-model="normalization_method" val="none" label="NONE" hint="No normalization is applied." /><br>
</q-card-section>
</q-card>
<q-card v-if="step.name === 'peak_alignment'">
<q-card-section>
<div class="text-h6">Method</div>
<div class="text-caption">The alignment algorithm.</div>
</q-card-section>
<q-card-section>
<q-radio v-model="alignment_method" val="lowess" label="LOWESS" hint="Locally Weighted Scatterplot Smoothing regression." /><br>
<q-radio v-model="alignment_method" val="linear" label="LINEAR" hint="Linear regression." /><br>
<q-radio v-model="alignment_method" val="ransac" label="RANSAC" hint="Random Sample Consensus algorithm for robust fitting." /><br>
</q-card-section>
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<div class="row q-col-gutter-sm">
<div class="col-6">
<q-input standout="custom-standout" label="Span (for LOWESS)" type="number" step="0.01"
:placeholder="suggested_alignment_span" v-model.number="alignment_span" :rules="[val => val >= 0.0 && val <= 1.0 || 'Needs to be between 0 and 1']" hint="The span parameter for LOWESS regression, controlling smoothness (0.0 to 1.0)."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Tolerance" type="number" step="0.001"
:placeholder="suggested_alignment_tolerance" v-model.number="alignment_tolerance" hint="The tolerance for matching peaks between the target and reference spectrum."></q-input>
</div>
</div>
<q-select standout="custom-standout" label="Tolerance Unit" v-model="alignment_tolerance_unit"
:options="['mz', 'ppm']" class="q-mt-md" hint="The unit for tolerance, either 'mz' (absolute) or 'ppm' (relative)."></q-select>
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-6">
<q-input standout="custom-standout" label="Max Shift PPM" type="number"
:placeholder="suggested_alignment_max_shift_ppm" v-model.number="alignment_max_shift_ppm" hint="The maximum allowed m/z shift in ppm to prevent spurious peak matches."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Min Matched Peaks" type="number"
:placeholder="suggested_alignment_min_matched_peaks" v-model.number="alignment_min_matched_peaks" hint="The minimum number of matching peaks required to perform the alignment."></q-input>
</div>
</div>
</q-card-section>
</q-card>
<q-card v-if="step.name === 'calibration'">
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<div class="row q-col-gutter-sm">
<div class="col-6">
<q-input standout="custom-standout" label="Fit Order" type="number"
:placeholder="suggested_calibration_fit_order" v-model.number="calibration_fit_order"
hint="Polynomial order for the calibration curve (e.g., 1 or 2)."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="PPM Tolerance" type="number"
:placeholder="suggested_calibration_ppm_tolerance" v-model.number="calibration_ppm_tolerance"
hint="PPM tolerance for matching reference peaks to internal standards."></q-input>
</div>
</div>
</q-card-section>
</q-card>
<q-card v-if="step.name === 'peak_picking'">
<q-card-section>
<div class="text-h6">Method</div>
<div class="text-caption">The peak detection algorithm.</div>
</q-card-section>
<q-card-section>
<q-radio v-model="peak_picking_method" val="profile" label="PROFILE" hint="For profile-mode data, using local maxima and quality filters." /><br>
<q-radio v-model="peak_picking_method" val="wavelet" label="WAVELET" hint="Continuous Wavelet Transform (CWT) based peak detection." /><br>
<q-radio v-model="peak_picking_method" val="centroid" label="CENTROID" hint="For centroid-mode data, essentially a filtering step." /><br>
</q-card-section>
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<div class="row q-col-gutter-sm">
<div class="col-6">
<q-input standout="custom-standout" label="Signal to Noise Threshold" type="number" step="0.1"
:placeholder="suggested_peak_picking_snr_threshold" v-model.number="peak_picking_snr_threshold" hint="Signal-to-Noise Ratio threshold. Peaks with SNR below this value are discarded."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Half Window Size" type="number"
:placeholder="suggested_peak_picking_half_window" v-model.number="peak_picking_half_window" hint="Number of data points to the left and right of a potential peak to consider for local maximum detection (for Profile method)."></q-input>
</div>
</div>
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-6">
<q-input standout="custom-standout" label="Min Peak Prominence" type="number" step="0.01"
:placeholder="suggested_peak_picking_min_peak_prominence" v-model.number="peak_picking_min_peak_prominence" hint="Minimum required prominence of a peak, expressed as a fraction of its height."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Merge Peaks Tolerance (m/z)" type="number" step="0.001"
:placeholder="suggested_peak_picking_merge_peaks_tolerance" v-model.number="peak_picking_merge_peaks_tolerance" hint="The m/z tolerance within which to merge adjacent peaks, keeping the more intense one."></q-input>
</div>
</div>
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-6">
<q-input standout="custom-standout" label="Min Peak Width (PPM)" type="number"
:placeholder="suggested_peak_picking_min_peak_width_ppm" v-model.number="peak_picking_min_peak_width_ppm" hint="Minimum acceptable peak width (FWHM) in ppm."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Max Peak Width (PPM)" type="number"
:placeholder="suggested_peak_picking_max_peak_width_ppm" v-model.number="peak_picking_max_peak_width_ppm" hint="Maximum acceptable peak width (FWHM) in ppm."></q-input>
</div>
</div>
<q-input standout="custom-standout" label="Min Peak Shape R2" type="number" step="0.01" class="q-mt-md"
:placeholder="suggested_peak_picking_min_peak_shape_r2" v-model.number="peak_picking_min_peak_shape_r2" hint="Minimum R-squared value from a Gaussian fit to the peak, used as a quality measure for peak shape."></q-input>
</q-card-section>
</q-card>
<q-card v-if="step.name === 'peak_selection'">
<q-card-section>
<div class="text-h6">Peak Quality Filters</div>
</q-card-section>
<q-card-section>
<div class="row q-col-gutter-sm">
<div class="col-6">
<q-input standout="custom-standout" label="Min SNR" type="number" step="0.1"
:placeholder="suggested_peak_selection_min_snr" v-model.number="peak_selection_min_snr" hint="Minimum Signal-to-Noise Ratio for a peak to be kept."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Min FWHM (PPM)" type="number"
:placeholder="suggested_peak_selection_min_fwhm_ppm" v-model.number="peak_selection_min_fwhm_ppm" hint="Minimum Full Width at Half Maximum (FWHM) in ppm for a peak to be kept."></q-input>
</div>
</div>
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-6">
<q-input standout="custom-standout" label="Max FWHM (PPM)" type="number"
:placeholder="suggested_peak_selection_max_fwhm_ppm" v-model.number="peak_selection_max_fwhm_ppm" hint="Maximum Full Width at Half Maximum (FWHM) in ppm for a peak to be kept."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Min Peak Shape R2" type="number" step="0.01"
:placeholder="suggested_peak_selection_min_shape_r2" v-model.number="peak_selection_min_shape_r2" hint="Minimum R-squared value from a Gaussian fit, filtering for good peak shape."></q-input>
</div>
</div>
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-6">
<q-input standout="custom-standout" label="Frequency Threshold" type="number" step="0.01"
:placeholder="suggested_peak_selection_frequency_threshold" v-model.number="peak_selection_frequency_threshold"
hint="The minimum fraction of spectra a peak must be present in to be kept (0.0 to 1.0)."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Correlation Threshold" type="number" step="0.01"
:placeholder="suggested_peak_selection_correlation_threshold" v-model.number="peak_selection_correlation_threshold"
hint="Minimum correlation with neighboring peaks (not yet implemented)."></q-input>
</div>
</div>
</q-card-section>
</q-card>
<q-card v-if="step.name === 'peak_binning'">
<q-card-section>
<div class="text-h6">Method</div>
<div class="text-caption">The binning strategy.</div>
</q-card-section>
<q-card-section>
<q-radio v-model="binning_method" val="adaptive" label="ADAPTIVE" hint="Creates bins based on the density of detected peaks." /><br>
<q-radio v-model="binning_method" val="uniform" label="UNIFORM" hint="Creates a fixed number of equally spaced bins over the m/z range." /><br>
</q-card-section>
<q-card-section>
<div class="text-h6">Parameters</div>
</q-card-section>
<q-card-section>
<div class="row q-col-gutter-sm">
<div class="col-6">
<q-input standout="custom-standout" label="Tolerance (for Adaptive)" type="number" step="0.001"
:placeholder="suggested_binning_tolerance" v-model.number="binning_tolerance" hint="Tolerance for grouping peaks into a bin in adaptive mode."></q-input>
</div>
<div class="col-6">
<q-select standout="custom-standout" label="Tolerance Unit" v-model="binning_tolerance_unit"
:options="['mz', 'ppm']" hint="The unit for tolerance, either 'mz' (absolute) or 'ppm' (relative)."></q-select>
</div>
</div>
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-6">
<q-input standout="custom-standout" label="Frequency Threshold" type="number" step="0.01"
:placeholder="suggested_binning_frequency_threshold" v-model.number="binning_frequency_threshold" hint="The minimum fraction of spectra a bin must contain a peak in to be kept (0.0 to 1.0)."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Min Peaks Per Bin" type="number"
:placeholder="suggested_binning_min_peak_per_bin" v-model.number="binning_min_peak_per_bin" hint="The minimum number of individual peaks required to form a bin in adaptive mode."></q-input>
</div>
</div>
<div class="row q-col-gutter-sm q-mt-md">
<div class="col-6">
<q-input standout="custom-standout" label="Max Bin Width (PPM)" type="number"
:placeholder="suggested_binning_max_bin_width_ppm" v-model.number="binning_max_bin_width_ppm" hint="Maximum width of a bin in ppm for adaptive mode."></q-input>
</div>
<div class="col-6">
<q-input standout="custom-standout" label="Number of Uniform Bins" type="number"
:placeholder="suggested_binning_num_uniform_bins" v-model.number="binning_num_uniform_bins" hint="The number of bins to create for the uniform method."></q-input>
</div>
</div>
<q-toggle v-model="binning_intensity_weighted_centers" label="Intensity Weighted Centers"
class="q-mt-md" hint="If enabled, calculates bin centers as an intensity-weighted average of the peaks within it."></q-toggle>
</q-card-section>
</q-card>
</q-expansion-item>
</q-list>
<!-- Pipeline Controls -->
<div class="row justify-end items-center q-mt-md">
<q-btn class="q-ma-sm" icon="save" @click="export_params_btn=true" label="Export Params" outline />
<q-btn class="q-ma-sm" icon="upload_file" @click="import_params_btn=true" label="Import Params" outline />
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="play_arrow"
v-on:click="run_full_pipeline=true" padding="lg" label="Run Pipeline" />
</div>
</q-tab-panel>
</q-expansion-item>
</q-list>
<!-- Pipeline Controls -->
<div class="row justify-end items-center q-mt-md">
<q-btn class="q-ma-sm" icon="save" @click="export_params_btn=true" label="Export Params" outline />
<q-btn class="q-ma-sm" icon="upload_file" @click="import_params_btn=true" label="Import Params" outline />
<q-btn :loading="progressPrep" class="q-ma-sm btn-style" icon="play_arrow"
v-on:click="run_full_pipeline=true" padding="lg" label="Run Pipeline" />
</div>
</q-tab-panel>
<q-tab-panel name="generator">
<div class="text-h6">imzML & mzML Data Processor</div>
<p>Please make sure the ibd and imzML file are located in the same directory and have the same name.
@@ -330,6 +529,10 @@
</q-btn-dropdown>
</div>
<div class="row col-6">
<div class="st-col col-4 col-sm-4 q-ma-sm">
<q-input standout="custom-standout" step="1" v-model="idSpectrum" label="Spectrum ID" type="number"
hint="Not for Mean/Sum plots."></q-input>
</div>
<div class="st-col col-4 col-sm-4 q-ma-sm">
<q-input standout="custom-standout" step="1" v-model="xCoord" label="X coord" type="number" :rules="[
val => SpectraEnabled ? ( '* Required', val >= 0|| 'Needs to be bigger than 0') : true
@@ -455,7 +658,7 @@
<div class="text-subtitle1">Before Preprocessing</div>
</q-card-section>
<q-card-section>
<plotly id="plotSpectraBefore" :data="plotdata" :layout="plotlayout" class="q-pa-none q-ma-none"></plotly>
<plotly id="plotSpectraBefore" :data="plotdata_before" :layout="plotlayout_before" class="q-pa-none q-ma-none"></plotly>
</q-card-section>
</q-card>
<q-card>
@@ -790,4 +993,4 @@
<q-btn flat label="Close" style="color:#009f90" v-close-popup />
</q-card-actions>
</q-card>
</q-dialog>
</q-dialog>