plot_vip_scores(): nbootstrap argument renamed to n_samples, and its
threshold line now uses the correct degrees of freedom
(df = n_samples - 1), matching the selection bp_VIP_analysis() actually
performs.nmr_read_bruker_fid(): endian argument removed (byte order is now
auto-detected from acqus), and it now returns a data frame with
time_s/fid_complex columns instead of a raw numeric vector. Also fixes
silent truncation of the FID to half its length.nmr_baseline_threshold() / nmr_baseline_threshold_plot():
range_without_peaks / chemshift_range no longer default to c(9.5, 10)
ppm; must now be given explicitly.nmr_detect_peaks(): range_without_peaks no longer defaults to
c(9.5, 10) ppm either; either it or baselineThresh must now be given,
or the call aborts with a clear message instead of failing deep inside
with a confusing one (#66).download_MTBLS242(): keep_only_preop_and_3months (logical) replaced by
timepoints (a character vector of TimePoint values to keep, or NULL
for every timepoint), so any two (or more) of the study's five timepoints
can be selected, not just preop and 12 months. timepoints = c("preop", "12 months after surgery") is the new default and reproduces the old
keep_only_preop_and_3months = TRUE behavior.nmr_baseline_threshold_plot(): NMRExperiment = NULL now means "every
sample" (paginated via new nrow/ncol/page arguments) instead of
silently subsampling to 10 random samples when there were more than 20.
"all" remains a synonym for NULL. nrow/ncol default to a snug grid
for small sample counts, or a fixed 3x3 (paginate with page) for 7 or
more.nmr_baseline_threshold_plot(): new nrow/ncol/page arguments paginate
the per-sample facets instead of cramming every sample onto one
illegible page.bp_VIP_analysis() / bp_kfold_VIP_analysis(): new optional
identity_column argument. When given, fold assignment and bootstrap
resampling keep every identity_column group (e.g. a subject's repeated
measurements) together, and the fitted plsda models become multilevel,
matching what nmr_data_analysis() already did for the same
identity_column. Opt-in and backward compatible (defaults to NULL,
reproducing the previous behavior).peaklist_fit_lorentzians() (used by nmr_detect_peaks(fit_lorentzians = TRUE)): its "Fitting lorentzians" progress bar was not gated behind the
same interactive/non-knitr check every other progress bar in the package
uses, so it always printed, including inside notebooks/vignettes.nmr_identify_regions_blood() / nmr_identify_regions_urine() /
nmr_identify_regions_cell(): each ppm_to_assign query always
contributed exactly num_proposed_compounds rows, padding with NA when
fewer candidate metabolites were found within tolerance; those NA-only
rows are now dropped instead of returned.models_stability_plot_plsda() / models_stability_plot_bootstrap(): the
loadings-correlation heatmap now uses a fixed, sign-agnostic color scale
(-1 and +1 both render as the same dark blue, 0 as white; a latent
variable's sign is arbitrary, so -1 and +1 indicate equally strong
agreement) instead of a plain sequential palette that auto-scaled to
whatever range the data happened to have. Also fixes self-correlation
cells (expected to be exactly 1) intermittently rendering as blank/white:
a loading vector's self dot-product can come out as e.g.
1.0000000000000002 due to floating-point rounding, which fell just
outside the (-1, 1) scale limits and was dropped to NA by ggplot2's
default out-of-bounds handling; now clamped to the nearest limit instead.bp_VIP_analysis(): VIP scores were indexed by the requested ncomp
rather than the fitted model's actual model$ncomp; on data where
mixOmics silently fits fewer components than requested (e.g. a
degenerate bootstrap resample), this caused subscript out of bounds.bp_kfold_VIP_analysis(): fixed fold partitioning, which assigned samples
to folds with a deterministic x %% k split instead of the intended random
shuffle.bp_VIP_analysis(): a degenerate (single-class) bootstrap resample is now
redrawn instead of being patched with a fixed, non-random replacement,
which biased a fraction of the bootstrap replicates.read_bruker_param(): fixed a wrong regex capture-group index causing
subscript out of bounds on some Bruker parameter files.parse_title_file(): fixed a gsub() call missing perl = TRUE, which
left trailing whitespace untrimmed from Bruker pdata title fields.choose_best_nlv(): fixed a key-name mismatch that made
diagnostic_plot, diagnostic_box_plot, and model_performances always
NULL for models built with plsda_auroc_vip_method().models_stability_plot_plsda() / models_stability_plot_bootstrap() /
plot_bootstrap_multimodel(): fixed two ggplot2 arguments deprecated since
ggplot2 3.3.4/3.4.0, which warned on every call.create_sample_names(): disambiguates samples sharing a leaf directory
name (e.g. Bruker EXPNO 10) by stripping the full common path prefix,
instead of only one parent level. Collisions more than one level deep now
get readable names instead of vctrs-generated ...N suffixes (#62).tidy.nmr_dataset_1D() (and thus plot() /
nmr_baseline_threshold_plot()): an unknown NMRExperiment value now
warns and is excluded (if some values are valid) or errors (if none are),
instead of silently returning rows with NA intensities (#69).download_MTBLS242(): validate downloaded files against MetaboLights'
published SHA-256 checksums for the MTBLS242 dataset (#72).ggplot2 (>= 3.5.2), fs (>= 1.6.7), curl (>= 6.4.0), zip (>= 2.3.3),
progressr (>= 0.19.0).nmr_detect_peaks_tune_snr().nmr_autophase() for automated phase correction using the NMRphasing package (#68).to_ASICS function to export dataset for ASICS quantification (#68).ggplot2::qplot()Improved the download_MTBLS242() function, allowing to either download the parts
of MTBLS242 needed for the tutorial or the whole dataset, which may be nice to
have if you want to play beyond the tutorial.
When reading a Bruker sample from a zip file, you now can specify in the file
name the zip subdirectory. For instance, "/path/to/sample.zip!/sample/3", when
sample.zip contains a folder named sample with a subfolder named 3 that
includes the sample data you want to actually read.
fix_baseline = FALSE in nmr_integrate_regions() as default. The former TRUE
approach here did not make much sense if peak boundaries were not perfectly
established.Baseline estimation: We now offer nmr_baseline_estimation() besides
nmr_baseline_removal(). The estimation function computes the baseline and saves it
instead of subtracting it from the signal. This is a better approach because it
lets each step of the pipeline decide whether it makes sense to subtract the baseline
or not. The nmr_baseline_removal() is for now still available, but it will be
deprecated in a future version.
For the baselineThresh argument in nmr_detect_peaks() we now suggest using
nmr_baseline_threshold(dataset, method = "median3mad"). This is more robust than
the former (but still the default) method.
Peak detection and integration: We want to approach the peak detection, clustering an integration in a different way. While the old pipeline still works as expected, we have introduced new arguments to peak detection, with backwards compatible defaults and a peak clustering function. We still provide the vignette with the former workflow, because it is still relevant but we may deprecate it in a future version, once we are confident the changes we are making are robust across several datasets.
Parallellization: We are switching from the future package to BiocParallel,
to better integrate in the Bioconductor ecosystem. In this version, if you use
a different future plan you may get a warning to switch to BiocParallel. In a
future version we will remove our dependency with the (awesome) future package.
names(dataset) <- c("Sample1", "Sample2").axis = NULL is given in nmr_interpolate_1D()nmr_dataset object.future package (#65, thanks to @HenrikBengtsson)plot_interactive now accepts an overwrite argument to avoid asking the user
interactivelynmr_detect_peaks_tune_snr to tune the SNR threshold with the right
other parametersdownload_MTBLS242() function to help download the data for the tutorialnmr_data_analysissave_profiling_plotsnmr_normalize_extra_info
that offers a less confusing name.nmr_identify_regions_cell functionHMDB_cellnmr_identify_regions_blood functionnmr_identify_regions_urine functionHMDB_urinecomputes_peak_width_ppmfunction for nmr_integrate_peak_positionsget_integration_with_metadatanmr_identify_regions functionHMDB_bloodfiles_to_rDolphin functionbrowseVignettes("NIHSnmr").Rename injection_id to NMRExperiment.
nmr_dataset_load and nmr_dataset_save now use readRDS and saveRDS
instead of load and save. This is the right approach to serialize
single R objects. If you need a script to convert previously saved datasets (created
using nmr_dataset_save) please use
NIHSnmr:::nmr_dataset_load_old_and_save("your_old_file.RData", "your_old_file.RDS")
to convert the files. Sorry for the inconvenience, but the sooner we fix this
the better.
filter to select a subset of samples from an nmr_dataset object has
been adapted to dplyr >= 0.7.4. Unless you used the .dots argument in
your calls there is no need to change anything. This means we now use a tidy
evaluation syntax for filter.
nmr_get_metadata() returns always a data frame / tibble, even when only a single
column is requested. It also always includes the "NMRExperiment" column.
nmr_dataset object has two tables metadata and metadata_ext. The
metadata_ext table includes all the metadata we add with nmr_add_metadata while
metadata has the internal metadata (acquisition parameters, etc).
Please use nmr_get_metadata(nmr_dataset) instead of nmr_dataset$metadata.
Remove workaround to dplyr issue: https://github.com/tidyverse/dplyr/issues/2203 (Sergio Oller reported and fixed the issue, dplyr-0.7.0 is fixed)
The Bruker title file has quite a free format definition. A title file can contain lines like "Field value" or "Field value ;" or simply "value". The heuristics to parse the title file have been improved.
Depend on tidyr 0.8.1. tidyr 0.8.0 had a bug that we reported (and for which we also provided a fix): https://github.com/tidyverse/tidyr/pull/419
nmr_get_metadata gives a warning if the user asks for metadata columns that
are missing.
New nmr_integrate_regions function.
nmr_normalize accepts pqn normalization.