Fixed some errors to get ready for release
This commit is contained in:
parent
455d88cbb7
commit
e3e987f0cd
55
app.jl
55
app.jl
@ -59,7 +59,6 @@ include("./julia_imzML_visual.jl")
|
|||||||
@in triq3dPlot=false # To generate 3d plot based on current triq image
|
@in triq3dPlot=false # To generate 3d plot based on current triq image
|
||||||
@in imageCPlot=false # To generate contour plots of current image
|
@in imageCPlot=false # To generate contour plots of current image
|
||||||
@in triqCPlot=false # To generate contour plots of current triq image
|
@in triqCPlot=false # To generate contour plots of current triq image
|
||||||
@in btnCreateImz=false # To start process for creating imzML and Ibd with mzML and Syncro
|
|
||||||
# Image change buttons
|
# Image change buttons
|
||||||
@in imgPlus=false
|
@in imgPlus=false
|
||||||
@in imgMinus=false
|
@in imgMinus=false
|
||||||
@ -281,6 +280,25 @@ include("./julia_imzML_visual.jl")
|
|||||||
btnStartDisable=true
|
btnStartDisable=true
|
||||||
full_route=full_routeMz
|
full_route=full_routeMz
|
||||||
end
|
end
|
||||||
|
progressSpectraPlot=true
|
||||||
|
btnPlotDisable=true
|
||||||
|
btnStartDisable=true
|
||||||
|
msg="Loading SUM spectrum plot..."
|
||||||
|
sTime=time()
|
||||||
|
plotdata, plotlayout, xSpectraMz, ySpectraMz=sumSpectrumPlot(full_routeMz)
|
||||||
|
progressSpectraPlot=false
|
||||||
|
btnPlotDisable=false
|
||||||
|
if endswith(full_route, "imzML")
|
||||||
|
btnStartDisable=false
|
||||||
|
end
|
||||||
|
if isfile(full_routeMz)
|
||||||
|
# We enable coord search and spectra plot creation
|
||||||
|
btnSpectraDisable=false
|
||||||
|
SpectraEnabled=true
|
||||||
|
end
|
||||||
|
fTime=time()
|
||||||
|
eTime=round(fTime-sTime,digits=3)
|
||||||
|
msg="Plot loaded in $(eTime) seconds"
|
||||||
end
|
end
|
||||||
xCoord=0
|
xCoord=0
|
||||||
yCoord=0
|
yCoord=0
|
||||||
@ -388,9 +406,7 @@ include("./julia_imzML_visual.jl")
|
|||||||
else
|
else
|
||||||
msg="File does not exist or a parameter is incorrect, please try again."
|
msg="File does not exist or a parameter is incorrect, please try again."
|
||||||
warning_msg=true
|
warning_msg=true
|
||||||
end
|
end|
|
||||||
spectra=nothing # Important for memory cleaning
|
|
||||||
slice=nothing
|
|
||||||
GC.gc() # Trigger garbage collection
|
GC.gc() # Trigger garbage collection
|
||||||
if Sys.islinux()
|
if Sys.islinux()
|
||||||
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS
|
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS
|
||||||
@ -414,30 +430,7 @@ include("./julia_imzML_visual.jl")
|
|||||||
btnPlotDisable=true
|
btnPlotDisable=true
|
||||||
btnStartDisable=true
|
btnStartDisable=true
|
||||||
msg="Loading plot..."
|
msg="Loading plot..."
|
||||||
spectraMz=LoadMzml(full_routeMz)
|
plotdata, plotlayout, xSpectraMz, ySpectraMz=sumSpectrumPlot(full_routeMz)
|
||||||
layoutSpectra=PlotlyBase.Layout(
|
|
||||||
title="SUM Spectrum plot",
|
|
||||||
xaxis=PlotlyBase.attr(
|
|
||||||
title="<i>m/z</i>",
|
|
||||||
showgrid=true
|
|
||||||
),
|
|
||||||
yaxis=PlotlyBase.attr(
|
|
||||||
title="Intensity",
|
|
||||||
showgrid=true
|
|
||||||
),
|
|
||||||
autosize=false,
|
|
||||||
margin=attr(l=0,r=0,t=120,b=0,pad=0)
|
|
||||||
)
|
|
||||||
try
|
|
||||||
xSpectraMz=mean(spectraMz[1,:])
|
|
||||||
ySpectraMz=mean(spectraMz[2,:])
|
|
||||||
catch e
|
|
||||||
xSpectraMz=spectraMz[1,1]
|
|
||||||
ySpectraMz=spectraMz[2,1]
|
|
||||||
end
|
|
||||||
traceSpectra=PlotlyBase.scatter(x=xSpectraMz, y=ySpectraMz, mode="lines")
|
|
||||||
plotdata=[traceSpectra] # We add the data from spectra to the plot
|
|
||||||
plotlayout=layoutSpectra
|
|
||||||
GC.gc() # Trigger garbage collection
|
GC.gc() # Trigger garbage collection
|
||||||
if Sys.islinux()
|
if Sys.islinux()
|
||||||
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS
|
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS
|
||||||
@ -463,7 +456,7 @@ include("./julia_imzML_visual.jl")
|
|||||||
end
|
end
|
||||||
|
|
||||||
@onbutton createXYPlot begin
|
@onbutton createXYPlot begin
|
||||||
msg="Sum spectrum plot selected"
|
msg="XY spectrum plot selected"
|
||||||
sTime=time()
|
sTime=time()
|
||||||
if isfile(full_routeMz) # Check if the file exists
|
if isfile(full_routeMz) # Check if the file exists
|
||||||
progressSpectraPlot=true
|
progressSpectraPlot=true
|
||||||
@ -917,10 +910,6 @@ include("./julia_imzML_visual.jl")
|
|||||||
CompareDialog=true
|
CompareDialog=true
|
||||||
end
|
end
|
||||||
|
|
||||||
@onbutton btnCreateImz begin
|
|
||||||
msg="Not yet implemented"
|
|
||||||
end
|
|
||||||
|
|
||||||
# To include a visualization in the spectrum plot indicating where is the selected mass
|
# To include a visualization in the spectrum plot indicating where is the selected mass
|
||||||
@onchange Nmass begin
|
@onchange Nmass begin
|
||||||
if !isempty(xSpectraMz)
|
if !isempty(xSpectraMz)
|
||||||
|
|||||||
@ -90,13 +90,6 @@
|
|||||||
]" :readonly="!SpectraEnabled" :disable="!SpectraEnabled"></q-input>
|
]" :readonly="!SpectraEnabled" :disable="!SpectraEnabled"></q-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<q-btn id="btnStyle" icon="play_arrow" class="q-ma-sm" v-on:click="btnCreateImz=true" :loading="progressSpectraPlot" :disable="btnSpectraDisable"
|
|
||||||
label="Generate imzML">
|
|
||||||
<template v-slot:loading>
|
|
||||||
<q-spinner-hourglass class="on-left" />
|
|
||||||
Loading Plot
|
|
||||||
</template>
|
|
||||||
</q-btn>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
2
config/env/global.jl
vendored
2
config/env/global.jl
vendored
@ -1 +1 @@
|
|||||||
ENV["GENIE_ENV"] = "dev"
|
ENV["GENIE_ENV"] = "prod"
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
command="julia --project=. start_MSI_GUI.jl"
|
|
||||||
|
|
||||||
case "$OSTYPE" in
|
|
||||||
linux*)
|
|
||||||
$command
|
|
||||||
;;
|
|
||||||
darwin*)
|
|
||||||
$command
|
|
||||||
;;
|
|
||||||
cygwin*|msys*|win32)
|
|
||||||
julia --project=. start_MSI_GUI.jl
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported OS"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@ -405,3 +405,37 @@ function medianFilterjl(pixMap)
|
|||||||
return target
|
return target
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# sumSpectrumPlot 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)
|
||||||
|
spectraMz=LoadMzml(mzmlRoute)
|
||||||
|
xSpectraMz=Float64[]
|
||||||
|
ySpectraMz=Float64[]
|
||||||
|
|
||||||
|
layout=PlotlyBase.Layout(
|
||||||
|
title="SUM spectrum plot",
|
||||||
|
xaxis=PlotlyBase.attr(
|
||||||
|
title="<i>m/z</i>",
|
||||||
|
showgrid=true
|
||||||
|
),
|
||||||
|
yaxis=PlotlyBase.attr(
|
||||||
|
title="Intensity",
|
||||||
|
showgrid=true
|
||||||
|
),
|
||||||
|
autosize=false,
|
||||||
|
margin=attr(l=0,r=0,t=120,b=0,pad=0)
|
||||||
|
)
|
||||||
|
try
|
||||||
|
xSpectraMz=mean(spectraMz[1,:])
|
||||||
|
ySpectraMz=mean(spectraMz[2,:])
|
||||||
|
catch e
|
||||||
|
xSpectraMz=spectraMz[1,1]
|
||||||
|
ySpectraMz=spectraMz[2,1]
|
||||||
|
end
|
||||||
|
trace=PlotlyBase.scatter(x=xSpectraMz, y=ySpectraMz, mode="lines")
|
||||||
|
plotdata=[trace] # We add the data from spectra to the plot
|
||||||
|
plotlayout=layout
|
||||||
|
return plotdata, plotlayout, xSpectraMz, ySpectraMz
|
||||||
|
end
|
||||||
@ -4,26 +4,6 @@ Pkg.activate(".")
|
|||||||
Pkg.instantiate()
|
Pkg.instantiate()
|
||||||
Pkg.gc()
|
Pkg.gc()
|
||||||
|
|
||||||
"""
|
|
||||||
packages = [
|
|
||||||
"GenieFramework", "Libz", "PlotlyBase", "CairoMakie", "Colors",
|
|
||||||
"Statistics", "NaturalSort", "Genie",
|
|
||||||
"Images", "LinearAlgebra", "NativeFileDialog", "StipplePlotly"
|
|
||||||
]
|
|
||||||
|
|
||||||
# Check for missing packages
|
|
||||||
for pkg in packages
|
|
||||||
if !(pkg in keys(Pkg.dependencies()))
|
|
||||||
Pkg.add(pkg)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add library for mzML imzML from GitHub if missing
|
|
||||||
if !("julia_mzML_imzML" in keys(Pkg.dependencies()))
|
|
||||||
Pkg.add(url="https://github.com/CINVESTAV-LABI/julia_mzML_imzML")
|
|
||||||
end
|
|
||||||
"""
|
|
||||||
|
|
||||||
using Genie
|
using Genie
|
||||||
|
|
||||||
# Load and configure Genie
|
# Load and configure Genie
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user