diff --git a/DESCRIPTION b/DESCRIPTION index 7fd6571d..a2c3e72e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: spant Type: Package Title: MR Spectroscopy Analysis Tools -Version: 2.24.9000 -Date: 2024-08-27 +Version: 2.24.0 +Date: 2024-11-14 Authors@R: c( person("Martin", "Wilson", email = "martin@pipegrep.co.uk", role = c("cre", "aut"), comment = c(ORCID = "0000-0002-2089-3956")), diff --git a/docs/404.html b/docs/404.html index 8ea731c0..0e6ac51b 100644 --- a/docs/404.html +++ b/docs/404.html @@ -39,11 +39,7 @@
@@ -126,11 +122,7 @@Site built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> devel diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 9b720e04..69792ba5 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -17,11 +17,7 @@ @@ -766,11 +762,7 @@Site built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> devel diff --git a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_aic-1.png b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_aic-1.png index 7b354e92..5872498b 100644 Binary files a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_aic-1.png and b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_aic-1.png differ diff --git a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_bspline-1.png b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_bspline-1.png index 0da03150..30072f44 100644 Binary files a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_bspline-1.png and b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_bspline-1.png differ diff --git a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_bspline_more-1.png b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_bspline_more-1.png index b37e6a33..d2ac3e5a 100644 Binary files a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_bspline_more-1.png and b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_bspline_more-1.png differ diff --git a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_default-1.png b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_default-1.png index 29b01e04..d8f30f43 100644 Binary files a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_default-1.png and b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_default-1.png differ diff --git a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_flex-1.png b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_flex-1.png index 794df7ae..48f315df 100644 Binary files a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_flex-1.png and b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_flex-1.png differ diff --git a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_stiff-1.png b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_stiff-1.png index 1a1b9bb3..6e0c5c5a 100644 Binary files a/docs/articles/abfit-baseline-opts_files/figure-html/abfit_stiff-1.png and b/docs/articles/abfit-baseline-opts_files/figure-html/abfit_stiff-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index 2b1f1a37..aad69369 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,11 +17,7 @@ @@ -99,11 +95,7 @@Site built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> devel diff --git a/docs/articles/spant-intro.html b/docs/articles/spant-intro.html index 938c488e..0ab4d399 100644 --- a/docs/articles/spant-intro.html +++ b/docs/articles/spant-intro.html @@ -38,11 +38,7 @@ @@ -180,57 +176,22 @@Perform ABfit analysis of the processed data
(mrs_proc
):
+fit_res <- fit_mrs(mrs_proc, basis)
Plot the fit result:
-@@ -313,53 +256,18 @@+plot(fit_res)
Unscaled amplitudes, CRLB error estimates and other useful fitting diagnostics, such as SNR, are given in the
-fit_res
results table:+fit_res$res_tab -<<<<<<< HEAD -#> X Y Z Dynamic Coil X.CrCH2 Ala Asp Cr GABA -#> 1 1 1 1 1 1 0 8.133932e-06 3.547065e-05 4.02672e-05 1.697281e-05 -#> Glc Gln GSH Glu GPC Ins -#> 1 2.446596e-06 3.036132e-06 2.228048e-05 6.503217e-05 1.606706e-05 5.906155e-05 -#> Lac Lip09 Lip13a Lip13b Lip20 MM09 MM12 -#> 1 5.802284e-06 2.387704e-05 2.670653e-06 0 0 9.630788e-06 6.511381e-06 -#> MM14 MM17 MM20 NAA NAAG PCh -#> 1 2.603855e-05 2.238405e-05 9.203743e-05 6.011109e-05 1.536531e-05 0 -#> PCr sIns Tau tNAA tCr tCho -#> 1 2.101921e-05 6.504098e-06 0 7.54764e-05 6.12864e-05 1.606706e-05 -#> Glx tLM09 tLM13 tLM20 X.CrCH2.sd Ala.sd -#> 1 6.80683e-05 3.350783e-05 3.522059e-05 9.203743e-05 2.386861e-06 4.343919e-06 -#> Asp.sd Cr.sd GABA.sd Glc.sd Gln.sd GSH.sd -#> 1 9.235326e-06 3.689004e-06 4.574407e-06 4.421681e-06 5.083001e-06 2.020426e-06 -#> Glu.sd GPC.sd Ins.sd Lac.sd Lip09.sd Lip13a.sd -#> 1 5.082976e-06 2.602651e-06 2.093225e-06 5.301703e-06 4.119256e-06 1.328305e-05 -#> Lip13b.sd Lip20.sd MM09.sd MM12.sd MM14.sd MM17.sd -#> 1 6.474481e-06 7.510908e-06 3.827554e-06 4.594019e-06 7.223367e-06 3.811301e-06 -#> MM20.sd NAA.sd NAAG.sd PCh.sd PCr.sd sIns.sd -#> 1 8.595853e-06 1.017712e-06 1.208985e-06 2.236873e-06 3.084598e-06 7.240068e-07 -#> Tau.sd tNAA.sd tCr.sd tCho.sd Glx.sd tLM09.sd -#> 1 3.759956e-06 7.031383e-07 5.890481e-07 2.110662e-07 3.16966e-06 1.006794e-06 -#> tLM13.sd tLM20.sd phase lw shift asym -#> 1 1.573147e-06 3.016809e-06 11.10963 5.023681 -0.00376505 0.1771067 -#> res.deviance res.niter res.info -#> 1 7.307669e-05 28 2 -#> res.message bl_ed_pppm -#> 1 Relative error between `par' and the solution is at most `ptol'. 2.364083 -#> max_bl_flex_used full_res fit_pts ppm_range SNR SRR FQN -#> 1 FALSE 7.754368e-05 497 3.8 62.71687 51.3328 1.492722 -#> tNAA_lw tCr_lw tCho_lw auto_bl_crit_7 auto_bl_crit_5.901 -#> 1 0.04562445 0.05189506 0.05438237 -8.900349 -8.944159 -======= #> X Y Z Dynamic Coil X.CrCH2 Ala Asp Cr #> 1 1 1 1 1 1 0 8.133802e-06 3.547064e-05 4.026719e-05 #> GABA Glc Gln GSH Glu GPC @@ -263,32 +224,19 @@
Basis simulation#> 1 FALSE 7.75437e-05 7.307671e-05 497 3.8 62.71686 51.33279 #> FQN tNAA_lw tCr_lw tCho_lw auto_bl_crit_7 auto_bl_crit_5.901 #> 1 1.492722 0.04562445 0.05189506 0.05438237 -8.900349 -8.944159 ->>>>>>> devel #> auto_bl_crit_4.942 auto_bl_crit_4.12 auto_bl_crit_3.425 auto_bl_crit_2.844 #> 1 -8.977355 -9.000064 -9.013367 -9.02055 #> auto_bl_crit_2.364 auto_bl_crit_1.969 auto_bl_crit_1.647 auto_bl_crit_1.384 #> 1 -9.024177 -9.023462 -9.009854 -8.958654 #> auto_bl_crit_1.17 auto_bl_crit_0.997 auto_bl_crit_0.856 auto_bl_crit_0.743 -<<<<<<< HEAD -#> 1 -8.844271 -8.690744 -8.562631 -8.485471 -#> auto_bl_crit_0.654 auto_bl_crit_0.593 auto_bl_crit_0.558 auto_bl_crit_0.54 -#> 1 -8.447136 -8.430174 -8.423053 -8.420086 -======= #> 1 -8.844271 -8.690744 -8.56263 -8.485471 #> auto_bl_crit_0.654 auto_bl_crit_0.593 auto_bl_crit_0.558 auto_bl_crit_0.54 #> 1 -8.447135 -8.430173 -8.423052 -8.420085 ->>>>>>> devel #> auto_bl_crit_0.532 auto_bl_crit_0.529 #> 1 -8.418839 -8.418312
Note that signal names appended with “.sd” are the CRLB estimates for the uncertainty (standard deviation) in the metabolite quantity estimate. e.g. to calculate the percentage s.d. for tNAA:
-<<<<<<< HEAD ---fit_res$res_tab$tNAA.sd / fit_res$res_tab$tNAA * 100 -#> [1] 0.9316001
Spectral SNR:
-=======@@ -297,12 +245,7 @@fit_res$res_tab$tNAA.sd / fit_res$res_tab$tNAA * 100 #> [1] 0.9316002
Basis simulationfit_res$res_tab$SNR #> [1] 62.71686
Linewidth of the tNAA resonance in PPM:
->>>>>>> devel--fit_res$res_tab$SNR -#> [1] 62.71687
Linewidth of the tNAA resonance in PPM:
-fit_res$res_tab$tNAA_lw #> [1] 0.04562445
Ratios to total-creatine -
->>>>>>> devel+-======= #> Ala 0.13271789 #> Asp 0.57876852 #> Cr 0.65703306 #> GABA 0.27694176 #> Glc 0.03992062 -#> Gln 0.04953983 +#> Gln 0.04953982 #> GSH 0.36354693 #> Glu 1.06111932 #> GPC 0.26216353 @@ -387,7 +295,6 @@fit_res_tcr_sc <- scale_amp_ratio(fit_res, "tCr") amps <- fit_amps(fit_res_tcr_sc) print(t(amps)) #> [,1] #> X.CrCH2 0.00000000 -<<<<<<< HEAD -#> Ala 0.13272001 -#> Asp 0.57876874 -#> Cr 0.65703313 -#> GABA 0.27694252 -#> Glc 0.03992071 -#> Gln 0.04954005 -#> GSH 0.36354683 -#> Glu 1.06111906 -#> GPC 0.26216356 -#> Ins 0.96369746 -#> Lac 0.09467490 -#> Lip09 0.38959768 -#> Lip13a 0.04357660 -#> Lip13b 0.00000000 -#> Lip20 0.00000000 -#> MM09 0.15714395 -#> MM12 0.10624512 -#> MM14 0.42486672 -#> MM17 0.36523688 -#> MM20 1.50175937 -#> NAA 0.98082268 -#> NAAG 0.25071313 -#> PCh 0.00000000 -#> PCr 0.34296687 -#> sIns 0.10612627 -#> Tau 0.00000000 -#> tNAA 1.23153582 -#> tCr 1.00000000 -#> tCho 0.26216356 -#> Glx 1.11065912 -#> tLM09 0.54674163 -#> tLM13 0.57468844 -#> tLM20 1.50175937
Ratios to total-creatine#> tLM09 0.54674149 #> tLM13 0.57468661 #> tLM20 1.50175914
A more sophisticated approach to scaling metabolite values involves the use of a separate water-reference acquisition - which can be imported in the standard way:
-+fname_wref <- system.file("extdata", "philips_spar_sdat_W.SDAT", package = "spant") mrs_data_wref <- read_mrs(fname_wref)
The following code assumes the voxel contains 100% white matter tissue and scales the metabolite values into molal (mM) units (mol / kg tissue water) based on the method described by Gasparovic et al MRM 2006 55(6):1219-26:
-- +#> 1 1H 2.5 +custom_mol |> sim_mol() |> lb(2) |> zf() |> plot(xlim = c(4.4, 0.5))+@@ -281,9 +277,8 @@p_vols <- c(WM = 100, GM = 0, CSF = 0) TE = 0.03 TR = 2 @@ -414,14 +321,10 @@
Water reference sca LCModel manual and references therein (section 10.2). This approach may be preferred when comparing results to those obtained LCModel or TARQUIN. -
->>>>>>> devel+-======= #> [1] 6.826335fit_res_molar <- scale_amp_molar(fit_res, mrs_data_wref) fit_res_molar$res_tab$tNAA -<<<<<<< HEAD -#> [1] 6.826336
Note, while “absolute” units are attractive, a large number of assumptions about metabolite and water relaxation rates are necessary to arrive at these mM estimates. If you’re not confident at being able to @@ -447,11 +350,7 @@
Water reference sca diff --git a/docs/articles/spant-intro_files/figure-html/unnamed-chunk-10-1.png b/docs/articles/spant-intro_files/figure-html/unnamed-chunk-10-1.png index a8160510..3640c474 100644 Binary files a/docs/articles/spant-intro_files/figure-html/unnamed-chunk-10-1.png and b/docs/articles/spant-intro_files/figure-html/unnamed-chunk-10-1.png differ diff --git a/docs/articles/spant-metabolite-simulation.html b/docs/articles/spant-metabolite-simulation.html index 0b599b16..83e21ed5 100644 --- a/docs/articles/spant-metabolite-simulation.html +++ b/docs/articles/spant-metabolite-simulation.html @@ -38,11 +38,7 @@
Custom molecules#> L/G lineshape : 0 #> #> nucleus chem_shift -#> 1 1H 2.5
Once your happy the new molecule is correct, please consider contributing it to the package if you think others would benefit.
@@ -305,11 +300,7 @@Site built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> devel diff --git a/docs/authors.html b/docs/authors.html index a7fe7801..ee2d0e06 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,11 +17,7 @@ @@ -144,11 +140,7 @@Site built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develspline basis density (signals per ppm).
adjust the spline basis density in the detailed +fit phase, based on the required level of smoothness, to reduce computation +time.
add the fitted spline functions to the fit result.
individual line broadening parameter.
lineshape asymmetry parameter.
include more fitting parameters in the fit table, e.g. individual shift and damping factors for each basis set element.
offset in number of data points from the end of the FID to -zero-fill. Default is NULL and will automatically set this to 50 points when -the FID distortion flag is set for the mrs_data.
Site built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develmeasure the signal from the first scan in this reference data and apply the same target noise level to mrs_data.
Site built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develMRSI data.
must be "hamming", "hanning" or "gaussian".
Site built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> devel7d data array.
example data to copy acquisition parameters from.
example data to copy acquisition parameters from.
sampling frequency in Hz.
Site built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develSite built with pkgdown 2.0.9.
-=======Site built with pkgdown 2.1.0.
->>>>>>> develMRSI data containing metabolite data.
coil combined MRSI data.
-=======coil combined MRSI data.
->>>>>>> devel