Package: fitnmr 1.1

Colin Smith

fitnmr: Multidimensional Nuclear Magnetic Resonance Peak Fitting and Analysis

Tools for fitting and analyzing 1D-4D nuclear magnetic resonance spectra with analytical models of peak shapes and peak groups. The package reads spectra in 'NMRPipe' format, builds constrained parameter structures for chemical shifts, line widths, scalar couplings, volumes, and phases, and performs nonlinear least-squares optimization for iterative peak discovery or simultaneous fits across multiple spectra. It also provides methods for visualization, preprocessing, and kinetic analysis of 1D time-series data, including automated phase optimization, solvent suppression, time-domain correction for frequency shifts and line broadening, modeling spectra as linear combinations of two component spectra, and exponential rate fitting.

Authors:Colin Smith [aut, cre]

fitnmr_1.1.tar.gz
fitnmr_1.1.zip(r-4.7)fitnmr_1.1.zip(r-4.6)fitnmr_1.1.zip(r-4.5)
fitnmr_1.1.tgz(r-4.6-any)fitnmr_1.1.tgz(r-4.5-any)
fitnmr_1.1.tar.gz(r-4.7-any)fitnmr_1.1.tar.gz(r-4.6-any)
fitnmr_1.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
fitnmr/json (API)

# Install 'fitnmr' in R:
install.packages('fitnmr', repos = c('https://smith-group.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/smith-group/fitnmr/issues

Pkgdown/docs site:https://smith-group.github.io

On CRAN:

Conda:

5.38 score 2 stars 5 scripts 442 downloads 42 exports 5 dependencies

Last updated from:3e9bb7d758. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK187
source / vignettesOK348
linux-release-x86_64OK161
macos-release-arm64OK183
macos-oldrel-arm64OK154
windows-develOK110
windows-releaseOK103
windows-oldrelOK103
wasm-releaseOK124

Exports:contour_pipecoupling_param_idxfit_peak_iterget_spec_intHamiltonianMultipletheight_assignlimit_omega0_by_r2make_fit_inputmake_mapmake_param_listnmr_pipenmrpipe_ftnmrpipe_ftinmrpipe_psnmrpipe_spnmrpipe_zfnoise_estimateomega0_param_idxparam_list_to_arg_listparam_list_to_peak_dfparam_list_to_tablesparam_valuesparam_values<-peak_df_to_fit_inputpeak_df_to_param_listperform_fitplot_fit_1dplot_fit_2dplot_peak_dfplot_resonances_1dplot_resonances_2dplot_resonances_3dplot_sparse_1dplot_sparse_2dppm_to_ptsread_nmrdraw_peak_tabread_nmrpiperead_resonance_tablessim_time_ndtables_to_param_listupdate_fit_boundswrite_nmrdraw_peak_tab

Dependencies:abindlatticeMatrixminpack.lmR6

1D Time Series Preprocessing/Two-State Fitting

Rendered fromtimeseries1d.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-03-20
Started: 2025-11-11

Automated 2D Peak Fitting Code

Rendered frompeak2d.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-03-20
Started: 2020-01-11

Automated 2D Peak Fitting Scripts

Rendered frompeak2d_scripts.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-03-20
Started: 2020-03-18

Readme and manuals

Help Manual

Help pageTopics
fitnmr Package Overviewfitnmr-package fitnmr
Combine multi-dimensional arrays with listsabind_list
Collapse strings of repeated NAs in a vector with numeric namescollapse_na
Collapse blocks of NAs in an array with numeric dimension namescollapse_na_array
Determine array of destination parameters from a source vectorcomb_vec_to_param_array
Plot Spectra Contourscontour_pipe
Get a list of logical arrays indicating which parameters correspond to scalar couplingscoupling_param_idx
Extract parameters from fit object for use with make_fit_inputextract_params
Determine the region of a spectrum containing the majority of the fit peaksfit_footprint
Fit a cluster of nearby peaks starting from a seed table of chemical shiftsfit_peak_cluster
Iterative Peak Fittingfit_peak_iter
Fit peaks from a table of chemical shiftsfit_peaks
Get arrays of spectral intensities for input, starting parameters, and fit peaksget_spec_int
Get spectra for individual peaksget_spec_peak_int
HamiltonianMultiplet R6 classHamiltonianMultiplet
Calculate mapping from assigned peak list onto an unknown peak listheight_assign
Infer acquisition time for each dimensioninfer_acquisition_time
Infer which dimension was directly acquiredinfer_aliasing
Infer which dimension was directly acquiredinfer_direct
Infer original sweep width for each dimensioninfer_sweep_width
Add upper/lower limits based on the r2 valuelimit_omega0_by_r2
Make a multiplet matrix with weights and scalar coupling coefficientsmake_coupling_mat
Prepare input data structure for peak fittingmake_fit_input
Create a sparse axis mapmake_map
Make a parameter list for a set of spectra and chemical shiftsmake_param_list
Process an FID with NMRPipenmr_pipe
Fourier transform a 1D FIDnmrpipe_ft
Inverse Fourier transform a 1D spectrumnmrpipe_fti
Change phases of a 1D spectrumnmrpipe_ps
Apply sine-based window function to a 1D FIDnmrpipe_sp
Apply zero filling to a 1D FIDnmrpipe_zf
Estimate Noisenoise_estimate
Get the first index in the omega0 array corresponding to each TRUE value in omega0_idxomega0_comb_source_idx
Get a list of logical arrays indicating which parameters correspond to peak positionsomega0_param_idx
Determine vector of source parameters from destination array via least squaresparam_array_to_comb_vec
Convert a list of parameters for use with make_fit_inputparam_list_to_arg_list
Convert Fit to Data Frameparam_list_to_peak_df
Convert a parameter list into a set of tables with resonance/nuclei/couplingsparam_list_to_tables
Get/set a subset of fitting parameters specified by a list of logical vectorsparam_values param_values<-
Combine parameter lists referring to different peakspeak_bind
Convert a peak data frame to fit inputpeak_df_to_fit_input
Convert a peak data frame to a parameter listpeak_df_to_param_list
Perform a fit with an input data structureperform_fit
Plot a one dimensional peak fitplot_fit_1d
Plot a two dimensional peak fitplot_fit_2d
Plot Peaks from a Peak Tableplot_peak_df
Plot resonances from 1D fitplot_resonances_1d
Plot resonances from 2D fitplot_resonances_2d
Plot resonances from 3D fitplot_resonances_3d
Plot spectrum from 1D fitplot_sparse_1d
Plot spectrum from 2D fitplot_sparse_2d
Convert PPM values to pointsppm_to_pts
Read an NMRDraw formatted peak tableread_nmrdraw_peak_tab
Read NMRPipe spectrumread_nmrpipe
Read resonance, nuclei, coupling, and spin system tablesread_resonance_tables
Convert data frame of resonances into a parameter listresonance_to_param_list
Update HamiltonianMultiplet parameters from input dataset_spinsystem_params
Simulate an FID using the NMRPipe SimTimeND functionsim_time_nd
Combine parameter lists referring to different spectraspec_bind
Determine a matrix of fractional peak overlapspec_overlap_mat
Split string of scalar coupling namessplit_coupling_names
Convert tables with resonance/nuclei/couplings to a parameter listtables_to_param_list
Update bounds on fitting parametersupdate_fit_bounds
Update HamiltonianMultiplet parameters from fit dataupdate_spinsystem_params
Convert widths in Hz into pointswhz_to_pts
Write an NMRDraw formatted peak tablewrite_nmrdraw_peak_tab