Concept error in Sum spectrum, changed to Mean spectrum

This commit is contained in:
Pixelguy14 2025-03-13 13:49:49 -06:00
parent 8e1c473acb
commit 2bd2e819a4
3 changed files with 16 additions and 16 deletions

20
app.jl
View File

@ -54,7 +54,7 @@ include("./julia_imzML_visual.jl")
@in btnSearch=false # To search for files in your device
@in mainProcess=false # To generate images
@in compareBtn=false # To open dialog
@in createSumPlot=false # To generate sum spectrum plot
@in createMeanPlot=false # To generate mean spectrum plot
@in createXYPlot=false # To generate an spectrum plot according to the xy values inputed
@in image3dPlot=false # To generate 3d plot based on current image
@in triq3dPlot=false # To generate 3d plot based on current triq image
@ -290,13 +290,13 @@ include("./julia_imzML_visual.jl")
# Splitting the route with regex from imzml to mzml so the plotting can work
full_routeMz=replace(full_route, r"\.[^.]*$" => ".mzML")
if isfile(full_routeMz)
# Start the sum spectrum creation on loading
# Start the mean spectrum creation on loading
progressSpectraPlot=true
btnPlotDisable=true
btnStartDisable=true
msg="Loading SUM spectrum plot..."
msg="Loading mean spectrum plot..."
sTime=time()
plotdata, plotlayout, xSpectraMz, ySpectraMz=sumSpectrumPlot(full_routeMz)
plotdata, plotlayout, xSpectraMz, ySpectraMz=meanSpectrumPlot(full_routeMz)
selectedTab="tab2"
progressSpectraPlot=false
btnPlotDisable=false
@ -319,13 +319,13 @@ include("./julia_imzML_visual.jl")
btnSpectraDisable=false
SpectraEnabled=true
if isfile(full_routeMz)
# Start the sum spectrum creation on loading
# Start the mean spectrum creation on loading
progressSpectraPlot=true
btnPlotDisable=true
btnStartDisable=true
msg="Loading SUM spectrum plot..."
msg="Loading mean spectrum plot..."
sTime=time()
plotdata, plotlayout, xSpectraMz, ySpectraMz=sumSpectrumPlot(full_routeMz)
plotdata, plotlayout, xSpectraMz, ySpectraMz=meanSpectrumPlot(full_routeMz)
selectedTab="tab2"
progressSpectraPlot=false
btnPlotDisable=false
@ -469,15 +469,15 @@ include("./julia_imzML_visual.jl")
end
end
@onbutton createSumPlot begin
msg="Sum spectrum plot selected"
@onbutton createMeanPlot begin
msg="Mean spectrum plot selected"
sTime=time()
if isfile(full_routeMz) # Check if the file exists
progressSpectraPlot=true
btnPlotDisable=true
btnStartDisable=true
msg="Loading plot..."
plotdata, plotlayout, xSpectraMz, ySpectraMz=sumSpectrumPlot(full_routeMz)
plotdata, plotlayout, xSpectraMz, ySpectraMz=meanSpectrumPlot(full_routeMz)
GC.gc() # Trigger garbage collection
if Sys.islinux()
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS

View File

@ -64,14 +64,14 @@
</template>
<q-list>
<q-item clickable v-close-popup v-on:click="createSumPlot=true">
<q-item clickable v-close-popup v-on:click="createMeanPlot=true">
<q-item-section>
<q-item-label>Sum Spectrum Plot</q-item-label>
<q-item-label>Mean spectrum plot</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup v-on:click="createXYPlot=true">
<q-item-section>
<q-item-label>Spectrum Plot (X,Y)</q-item-label>
<q-item-label>Spectrum plot (X,Y)</q-item-label>
</q-item-section>
</q-item>
</q-list>

View File

@ -442,17 +442,17 @@ function padarray(A, padsize)
return padded
end
# sumSpectrumPlot recieves the local directory of the image as a string,
# meanSpectrumPlot recieves the local directory of the image as a string,
# returns the layout and data for the surface plotly plot
# this function loads the spectra data and makes a mean to display
# its values in the spectrum plot
function sumSpectrumPlot(mzmlRoute::String)
function meanSpectrumPlot(mzmlRoute::String)
spectraMz=LoadMzml(mzmlRoute)
xSpectraMz=Float64[]
ySpectraMz=Float64[]
layout=PlotlyBase.Layout(
title="SUM spectrum plot",
title="Mean spectrum plot",
xaxis=PlotlyBase.attr(
title="<i>m/z</i>",
showgrid=true,