batmanrerun {batman} | R Documentation |
This performs metabolite and wavelet fitting to input NMR spectra with
fixed multiplet position obtained from running batman
, and also
plots fitting results. The user should modify parameters in the copy file "batmanOptions.txt"
in batman
output folder to change the rerun settings.
batmanrerun(BM, figBatmanFit = TRUE, listMeta = FALSE, figRelCon = FALSE, figMetaFit = FALSE, showPlot)
BM |
|
figBatmanFit |
Plot metabolites and wavelets fit if set |
listMeta |
Individual metabolite fit will also be shown in the plot if set |
figRelCon |
Plot posterior samples of the relative concentration for listed
metabolites with 95% credible interval if set |
figMetaFit |
If set |
showPlot |
If set |
When batmanrerun
is called with multiplet ppm shifts fixed from the
batman
results, the following objects are added to the batman
result:
sFitRerun |
A matrix t \times 5n of BATMAN rerun fit results (down sampled). For 1 spectrum, it is a matrix with 5 columns: [ppm, original spectrum, metabolites fit, wavelets fit, overall fit]. n is the number of spectra, and t is the number of data points in each spectrum. |
sFitRerunHR |
A matrix t \times 3n of BATMAN rerun fit results in the original resolution (without down sample). For 1 spectrum, it is a matrix with 3 columns: [ppm, original spectrum, metabolites fit]. n is the number of spectra, and t is the number of data points (without down sample) in each spectrum. |
betaRerun |
For batman rerun, a matrix (m \times n) containing the posterior means of relative concentrations for m fitted metabolites and n spectra. |
betaSamRerun |
For batman rerun, a matrix (m \times (s*n)) containing (for the first spectrum) s posterior samples of the relative concentrations in its rows. m is the number of fitted metabolites. n is the number of spectra analyzed. The subsequent columns contain the same data format for the rest n-1 spectra. |
betaCIRerun |
For batman rerun, a matrix (m \times 2n) containing the 95% credible interval of the relative concentrations for m fitted metabolites. Every pair of columns is for one spectrum. |
metaTempRerun |
For batman rerun, a matrix (t \times (m*n)) containing the posterior means of m fitted metabolite templates in its columns (down sampled). n is the number of spectra analyzed and t is the number of data points in each spectrum. |
metaTempRerunHR |
For batman rerun, a matrix (t \times (m*n)) containing the posterior means of m fitted metabolite templates in its columns (without down sample). n is the number of spectra analyzed and t is the number of data points (without down sample) in each spectrum. |
metaFitSamRerun |
For batman rerun, a matrix (t \times (s*n)) containing s posterior samples of total metabolites fit in its columns. n is the number of spectra analyzed and t is the number of data points in each spectrum. The remaining n-1 spectra metabolites fit results are saved in the same sequence in subsequent columns. |
metaIndFitSamRerun |
For batman rerun, a matrix (t \times (m*s*n)) containing s posterior samples of m individual metabolites fit in its columns. n is the number of spectra analyzed and t is the number of data points in each spectrum. The remaining n-1 spectra results are saved in the same sequence in subsequent columns. |
thetaSamRerun |
For batman rerun, a matrix (t \times (s*n)) containing s samples of wavelet fit in its columns. n is the number of spectra analyzed. The remaining n-1 spectra wavelet fit results are saved in the same sequence in subsequent columns. |
outputDir |
The directory of output folder with all the output result files. |
library(batman) ## Run batman if(interactive()) { bm<-batman() ## then call batmanrerun bm<-batmanrerun(bm) } ####################################################################### ## The following is an example of what will be displayed in R ## and what value the user could input: ####################################################################### ## Rerunning batman for 500 iterations. ## percentage completed... ## | | 0% ## Size of each spectrum is 382. ## Size of metabolite list is 22. ## Constructing chain data structure... ## time used is 1 seconds. ## Running MCMC... ## |==================================================================| 100% ## time used is 65 seconds. ## saving posteriors... ## ## For rerun, time elapsed ## 65.96 seconds. ## Reading in saved data in folder ## .../user_specified_dir/runBATMAN/BatmanOutput/07_Dec_17_35_53 ## Completed. ######################################################################## ## Alternatively if more than 1 spectrum are included without using fixed ## effect, user will be asked to input whether to parallelize the analysis ## between spectra. ######################################################################## ## How many parallel processes (multicores) do you want to run the ## multi-spectra analysis? ## (Enter 1 for running them sequentially.) ## ## Parallel processing of multi spectra currently cannot display ## the progress bar (or any words), if you input is > 1, please be patient ## for the results :) ## ## 1: 2 ## user input ## ## For rerun, time elapsed ## 64.4 ## Reading in saved data in folder ## .../user_specified_dir/runBATMAN/BatmanOutput/07_Dec_17_35_53 ## Completed. #######################################################################