Added Statistics for mean plot values

This commit is contained in:
José Julián Sierra Álvarez 2024-09-11 12:35:15 -06:00 committed by GitHub
parent e5824dd858
commit 60441a28d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 11 deletions

View File

@ -4,7 +4,7 @@ For this to work you must insert the next lines as they are depicted in your Jul
```
julia
]
add Pkg Libz ; add https://github.com/CINVESTAV-LABI/julia_mzML_imzML ; add PlotlyBase ; add Genie
add Pkg Libz ; add https://github.com/CINVESTAV-LABI/julia_mzML_imzML ; add PlotlyBase ; add Statistics
```
Then open a terminal on the directory "JuliaIMZML_GUI" and put the next code: <br />
```

16
app.jl
View File

@ -6,6 +6,7 @@ using Pkg
using Libz
using PlotlyBase
using julia_mzML_imzML
using Statistics
@genietools
# == Code import ==
@ -46,14 +47,16 @@ using julia_mzML_imzML
@in msgimg = ""
@in msgtriq = ""
@out full_route = ""
@out dims = 0
@out MicroscansMax = 0
layoutSpectra = PlotlyBase.Layout(
title = "Spectra Plot",
xaxis = PlotlyBase.attr(
title = "X Axis",
title = "m/z",
showgrid = true
),
yaxis = PlotlyBase.attr(
title = "Y Axis",
title = "Intensity",
showgrid = true
),
width = 450,
@ -86,7 +89,6 @@ using julia_mzML_imzML
lastimg = Nmass
lastimgTriq = Nmass
end
# the onbutton handler will set the variable to false after the block is executed
#/home/julian/Documentos/Cinvestav_2024/Web/Archivos IMZML/royaimg.imzML
@onbutton Main_Process begin
@ -96,7 +98,10 @@ using julia_mzML_imzML
if isfile(full_route) && Nmass > 0 && Tol > 0 && Tol <= 1
msg = "File exists, Nmass=$(Nmass) Tol=$(Tol). Please do not press the start button until confirmation"
spectra = LoadImzml(full_route)
spectraMz = LoadMzml(full_route)
full_routeMz = split( full_route, "." )[1] * ".mzML" # Splitting the route from imzml to mzml so the plotting can work
spectraMz = LoadMzml(full_routeMz)
dims = size(spectraMz)
MicroscansMax = dims[2] # we get the total of microscans
msg = "File loaded. Please do not press the start button until confirmation"
slice = GetSlice(spectra, Nmass, Tol)
if triqProb != 0 # if we have TrIQ
@ -119,7 +124,8 @@ using julia_mzML_imzML
msgimg = "image with the Nmass of $(Int(Nmass))"
end
msg = "The file has been created inside the 'public' folder of the app"
traceSpectra = PlotlyBase.scatter(x = spectraMz[1, 1], y = spectraMz[2, 1], mode="lines+markers")
# traceSpectra = PlotlyBase.scatter(x = spectraMz[1, 1], y = spectraMz[2, 1], mode="lines+markers")
traceSpectra = PlotlyBase.scatter(x = mean(spectraMz, dims=1), y = mean(spectraMz, dims=2), mode="lines+markers")
plotdata = [traceSpectra] # we add the data of spectra to the plot
else
msg = "File does not exist or a parameter was not well inputted"

View File

@ -1,7 +1,7 @@
<header>
<h4>Julia mzML imzML GUI&nbsp;</h4>
</header>
<h6>Please make sure the ibd file is located in the same directory as the imzML file</h6>
<h6>Please make sure the ibd, the mzML and the imzML files are located in the same directory and have the same name</h6>
<h6>It may take a while to generate the image, don't press the Start button more than once until it finishes</h6>
<div class="row">
<div class="st-col col-12 col-sm st-module">
@ -27,7 +27,7 @@
</div>
<div class="row">
<div class="st-col col-12 col-sm">
<q-toggle id="igqon" v-on:click="triqEnabled" v-model="triqEnabled" color="blue" label="Add TrIQ!"></q-toggle>
<q-toggle id="igqon" v-on:click="triqEnabled" v-model="triqEnabled" color="blue" label="Add Threshold Intensity Quantization (TrIQ)!"></q-toggle>
</div>
</div>
<div class="row">