API: GUI2D
NMRAnalysis.GUI2D.FIT_TIME_BUDGET — Constant
Maximum wall-clock time (seconds) allowed for a single cluster fit before it is aborted.
Interactive fitting re-runs on every peak move, so a hard cap keeps the GUI responsive even if convergence is slow. The residual function checks elapsed time on every iteration. The budget is applied per-cluster so that a spectrum with many peaks does not exhaust the budget on early clusters and cancel later ones.
NMRAnalysis.GUI2D.METHYL_K — Constant
METHYL_KPrefactor K (s⁻²) in eq 1 relating η to S²τc for an ideal methyl group, so that S²τc = η / K. Assumes the H–H vector is perpendicular to the methyl 3-fold axis (θ = 90°, [P₂(cosθ)]² = 1/4) and r_HH = 1.813 Å:
K = (9/40)·(μ₀/4π)²·γ_H⁴·ℏ² / r_HH⁶ ≈ 3.61×10⁹ s⁻²giving S²τc (ns) ≈ 0.277·η for η in s⁻¹.
NMRAnalysis.GUI2D.STANDARD_RESIDUES — Constant
Standard amino acid one-letter codes.
NMRAnalysis.GUI2D.CCRExperiment — Type
CCRExperimentCross-correlated relaxation experiment with decay and buildup spectra.
Fields
specdata: Spectral data and metadatapeaks: Observable list of peaksisbuildup: Vector of booleans indicating buildup (true) or decay (false) spectraT: Relaxation time constant in secondsissymmetric: Whether symmetric reconversion is used (pairs of experiments)
NMRAnalysis.GUI2D.CCRExperiment — Method
CCRExperiment(decay_expts, buildup_expts, T)Create CCR experiment from lists of decay and buildup experiment files.
Arguments
decay_expts: Vector of file paths to decay experimentsbuildup_expts: Vector of file paths to buildup experimentsT: Relaxation time constant in seconds
For symmetric reconversion, provide pairs of experiments (2 decay + 2 buildup). For standard CCR, provide single experiments (1 decay + 1 buildup).
NMRAnalysis.GUI2D.CESTExperiment — Type
CESTExperiment <: FixedPeakExperimentChemical Exchange Saturation Transfer experiment with reference and saturation spectra.
Fields
specdata: Spectral data and metadatapeaks: Observable list of peaksfrequencies: Vector of saturation frequencies in ppm
NMRAnalysis.GUI2D.CESTExperiment — Method
CESTExperiment(inputfilename)Create CEST experiment from a pseudo-3D input file where the first plane is the reference and the remaining planes are saturation spectra at different frequencies.
NMRAnalysis.GUI2D.CPMGExperiment — Type
CPMGExperiment <: FixedPeakExperimentCPMG experiment with reference plane and relaxation planes.
Fields
specdata: Spectral data and metadatapeaks: Observable list of peaksvCPMG: Vector of CPMG frequencies in Hz (zero for reference)Trelax: Relaxation time in seconds
NMRAnalysis.GUI2D.CPMGExperiment — Method
CPMGExperiment(inputfilename, Trelax, vCPMG)Create CPMG experiment from a pseudo-3D input file. Zero frequency in vCPMG indicates the reference plane.
NMRAnalysis.GUI2D.Experiment — Type
Abstract type representing an NMR experiment.
Subtypes must inherit from either FixedPeakExperiment or MovingPeakExperiment. See guide for implementing new experiment types.
NMRAnalysis.GUI2D.FitCancelled — Type
Thrown from within a fit's residual function to abort an in-flight fit (because the inputs changed, the time budget was exceeded, or the user cancelled). Caught silently in fit!(expt).
NMRAnalysis.GUI2D.HetNOEExperiment — Type
HetNOEExperimentHeteronuclear NOE experiment with reference and saturated spectra.
Fields
specdata: Spectral data and metadatapeaks: Observable list of peakssaturation: Vector of booleans indicating saturated spectra
NMRAnalysis.GUI2D.HetNOEExperiment — Method
HetNOEExperiment(planefilenames, saturation)Create hetNOE experiment from a list of input planes and a list of true/false values indicating where saturation has been applied.
NMRAnalysis.GUI2D.IntensityExperiment — Type
IntensityExperiment <: FixedPeakExperimentGeneric experiment for measurement of intensity modulations across 2D spectra.
Fields
specdata: Spectral data and metadatapeaks: Observable list of peaks
NMRAnalysis.GUI2D.MethylCCRModel — Type
MethylCCRModel <: ParametricModelRatio model (eq 7) for methyl CCR buildup/decay analysis. Named to disambiguate from the single-delay CCRExperiment/ccr2d analysis. Carries the fixed prefactor C and the N relaxation delays times; func(T, p) evaluates eq 7 with p = [η, δ].
NMRAnalysis.GUI2D.MovingExperiment — Type
MovingExperiment <: MovingPeakExperimentGeneric experiment for measurement of peak positions that change across a series of 2D spectra. Unlike IntensityExperiment, where each peak sits at one chemical shift and only its amplitude is read out, here each peak's position (and linewidth) is an independent fit parameter in every plane. This is the common core for titrations, coupling-constant and RDC measurements: the spectrum fit recovers a per-plane position trajectory, and a postfit model turns that trajectory into a physical quantity.
Fields
specdata: Spectral data and metadatapeaks: Observable list of peaks (each holds per-plane:x,:y,:R2x,:R2y,:amp)x: Per-plane independent variable (e.g. ligand concentration); defaults to plane indexmodel: Postfit model relating the position trajectory to the independent variablevisualisation: Strategy for the per-peak plot panel
NMRAnalysis.GUI2D.RDCModel — Type
RDCModelDerive a scalar coupling J and residual dipolar coupling D (both in Hz) from the peak position difference between paired component spectra. isotropic/aligned are the plane indices of the two components in each condition; couplingdim is the dimension the splitting is measured in; scale is the fraction of the coupling the measured separation represents (1 for IPAP, 0.5 for HSQC/TROSY); gammasign flips the sign for a negative-γ nucleus (¹⁵N).
NMRAnalysis.GUI2D.ResidueLabel — Type
ResidueLabelParsed representation of a peak label.
Fields
resnum: residue number (negative for non-standard residue types, e.g. the default unassignedX#peaks;0if the label contains no digits)onelettercode: residue one-letter code ('?'if none could be identified)atom: atom name (uppercase, verbatim), or""for backbone amides
NMRAnalysis.GUI2D.SummaryDataset — Type
SummaryDatasetA named collection of SummaryPoints for one parameter, from one source (experiment or file).
NMRAnalysis.GUI2D.SummaryPoint — Type
SummaryPointOne peak's contribution to a summary plot: identity plus a single value and its uncertainty.
NMRAnalysis.GUI2D.TitrationModel — Type
TitrationModelFit a single-site (1:1) binding isotherm to a titration series, deriving a global dissociation constant Kd (shared by all residues) together with per-residue, per-dimension free and bound chemical shifts (δfree, δbound).
The bound fraction in each plane is computed from the ligand concentration (expt.x) and, if available, the protein concentration (protein, one per plane). With protein concentrations the exact 1:1 quadratic is used; with ligand concentrations only, the hyperbolic f = [L]/(Kd + [L]) approximation (ligand ≈ free) is used. The two are consistent in the limit [P] → 0.
Fields
protein: Per-plane total protein concentration, ornothingwhen only ligand concentrations were supplied.weights:(wx, wy)dimension weights for the combined CSP (Williamson 2013); the default(1.0, 0.14)assumes the F1 (x) axis is ¹H and the F2 (y) axis is ¹⁵N.
NMRAnalysis.GUI2D._filterunassigned — Method
Drop unassigned peaks (resnum ≤ 0), unless that would leave nothing to plot.
NMRAnalysis.GUI2D._peakvalue — Method
Value/uncertainty for param from a live peak (post-fit params first, then raw).
NMRAnalysis.GUI2D._rdc_summaryplot — Method
RDC summary: residual dipolar coupling D (Hz) against residue number.
NMRAnalysis.GUI2D._readtable — Method
_readtable(file) -> (header, rows)Read a results.csv: skip blank and #-comment lines, take the first remaining line as the (comma- or whitespace-separated) header, the rest as rows of strings.
NMRAnalysis.GUI2D._titration_summaryplot — Method
Titration summary: three stacked panels of the fitted saturation perturbation against residue number — ΔδX (= δbound − δfree, x dim), ΔδN (y dim, assuming ¹⁵N) and the weighted combination |Δδ|. Values are the extrapolated full-saturation CSPs from the global fit, so the experiment must have been fitted.
NMRAnalysis.GUI2D.add_moving_overlays! — Method
add_moving_overlays!(g, state, expt::MovingPeakExperiment)Add the moving-peak overlays to the contour panel:
- a faint polyline tracing each peak's fitted position across all planes (the trajectory), so the walk is visible at a glance;
- a toggleable "Context" overlay drawing every plane's contours faintly behind the current one, for orienting peaks that move a long way.
NMRAnalysis.GUI2D.addandtrackpeak! — Function
addandtrackpeak!(expt, initialposition, label="")Add a peak at initialposition and track it across every plane by following the local maximum: the current plane is anchored at the click, then the position is propagated outward in both directions, each plane seeded from its neighbour's tracked position. The subsequent fit then refines each plane within its radius. Good for non-crowded series (titrations); for crowded regions, add with A and adjust planes by hand instead.
NMRAnalysis.GUI2D.addpeak! — Function
Add peak to experiment, setting up per-plane position, linewidth and amplitude parameters.
NMRAnalysis.GUI2D.addpeak! — Function
Add peak to experiment, setting up type-specific parameters.
NMRAnalysis.GUI2D.addpeak! — Function
Add peak to experiment, setting up type-specific parameters.
NMRAnalysis.GUI2D.addpeak! — Function
Add peak to experiment, setting up type-specific parameters.
NMRAnalysis.GUI2D.addpeak! — Function
Add peak to experiment, setting up type-specific parameters.
NMRAnalysis.GUI2D.addpeak! — Function
Add peak to experiment, setting up type-specific parameters.
NMRAnalysis.GUI2D.asexptpath — Method
asexptpath(x)Coerce an experiment identifier (or a collection of them) to the path-string form the file loaders expect: an integer becomes its Bruker experiment number as a string (e.g. 1 -> "1", loaded relative to the working directory, as for the 1D functions' own exptno arguments), broadcasting elementwise over a collection of them (e.g. 1:11 -> ["1", ..., "11"]); anything else (a string, or an existing collection of strings) passes through unchanged.
NMRAnalysis.GUI2D.available_params — Method
available_params(source) -> Vector{Symbol}Parameters that can be plotted from a live experiment (post-fit and raw parameter keys) or a saved file (value columns, excluding identity columns).
NMRAnalysis.GUI2D.average_displacements — Method
average_displacements(expt) -> (dx, dy) | nothingMean per-plane position displacement of the already-fitted peaks, relative to the current plane (so dx/dy are zero at that plane). Used to seed a new peak's planes with the common motion pattern. Returns nothing if no peak has been fitted yet.
NMRAnalysis.GUI2D.backup_file — Method
backup_file(filepath::AbstractString)Create a backup of an existing file by appending '.old'.
NMRAnalysis.GUI2D.begin_add! — Method
Begin a guided add at the current plane, marking it immediately at pos.
NMRAnalysis.GUI2D.cancel_add! — Method
Abort the guided add and return to the original plane.
NMRAnalysis.GUI2D.ccr2d — Method
ccr2d(decay_expts, buildup_expts, T)Start interactive GUI for analysing 2D measurements of cross-correlated relaxation data.
Fits intensities of peaks in a series of 2D spectra to a model of the form:
tanh(η * T) = I_buildup / I_decayor
tanh(η * T) = sqrt((I_buildup1 * I_buildup2) / (I_decay1 * I_decay2))Arguments
decay_expts: List of NMR data files for decay experimentsbuildup_expts: List of NMR data files for buildup experimentsT: Relaxation time constant (in seconds)
Example:
ccr2d("decay_expt", "buildup_expt", 0.08) # single decay and buildup experiment
ccr2d(["decay_expt1", "decay_expt2"], # symmetric reconversion experiments
["buildup_expt1", "buildup_expt2"], 0.08)Experiments can also be given as Bruker experiment numbers, individually or as a list/range (e.g. 1:3).
NMRAnalysis.GUI2D.cest2d — Method
cest2d(inputfilename; B1, Tsat)Start interactive GUI for analysing 2D CEST (Chemical Exchange Saturation Transfer) data.
Arguments
inputfilename: NMR data file as a processed data directory containing pseudo-3D data where the first plane is the reference spectrum and subsequent planes are the saturation spectraB1: Saturation power in HzTsat: Saturation time in seconds
Example:
cest2d("path/to/expno/pdata/1"; B1=15, Tsat=0.3)NMRAnalysis.GUI2D.checktouched! — Method
checktouched!(expt)Update which clusters have been modified.
NMRAnalysis.GUI2D.cluster! — Method
Update experiment with non-overlapping clusters for fitting (e.g. [[1], [2, 3]])
NMRAnalysis.GUI2D.cpmg2d — Method
cpmg2d(inputfilename; Trelax, vCPMG)
cpmg2d(inputfilename; Trelax, ncyc)Start interactive GUI for analysing 2D CPMG relaxation dispersion data.
Arguments
inputfilename: NMR data file as a processed data directory containing pseudo-3D data where the first plane is the reference spectrum and subsequent planes are the saturation spectraTrelax: Relaxation time in secondsvCPMG: list of CPMG frequencies in Hz, use zero for reference spectrumncyc: list of CPMG cycle numbers, use zero for reference spectrum. When provided, vCPMG is calculated as ncyc/Trelax
Examples:
# Direct specification of CPMG frequencies
cpmg2d("path/to/expno"; Trelax=0.04, vCPMG=[0, 25, 50, 75, 100])
# Using cycle numbers (vCPMG calculated automatically)
ncyc = [0, 1, 2, 3, 4]
cpmg2d("path/to/expno"; Trelax=0.04, ncyc=ncyc)NMRAnalysis.GUI2D.deleteallpeaks! — Method
deleteallpeaks!(expt)Remove all peaks from the experiment.
NMRAnalysis.GUI2D.deletepeak! — Method
deletepeak!(expt, idx)Delete peak idx. Updates clusters automatically.
NMRAnalysis.GUI2D.eta_to_s2tc_ns — Method
Convert a cross-correlated relaxation rate η (s⁻¹) to S²τc in ns (eq 1).
NMRAnalysis.GUI2D.experimentinfo — Method
Return formatted text describing experiment.
NMRAnalysis.GUI2D.experimentinfo — Method
Return formatted text describing experiment.
NMRAnalysis.GUI2D.experimentinfo — Method
Return formatted text describing experiment.
NMRAnalysis.GUI2D.experimentinfo — Method
Return formatted text describing experiment.
NMRAnalysis.GUI2D.extract_residue_number — Method
extract_residue_number(label)::IntResidue number for label (see parse_label). Negative for non-standard residue types; 0 if no digits are present.
NMRAnalysis.GUI2D.fill_add! — Method
Fill every not-yet-marked plane with pos, then finish.
NMRAnalysis.GUI2D.finish_add! — Method
Create the peak from the marked positions, return to the original plane, leave :adding.
NMRAnalysis.GUI2D.fit! — Method
fit!(expt::Experiment)Fit all touched peaks/clusters in the experiment.
NMRAnalysis.GUI2D.fit2d — Method
fit2d(inputfilenames)Start an interactive GUI for peak analysis of a single 2D spectrum or a series of 2D spectra. Each peak is fitted to a 2D Lorentzian lineshape; no physical model is applied to the amplitudes across spectra.
Use this function to measure peak positions, linewidths, and amplitudes for downstream analysis, or when none of the built-in physical models (relaxation2d, recovery2d, modelfit2d) are appropriate.
Arguments
inputfilenames: A single path string or vector of path strings pointing to processed Bruker data directories (e.g."expno/pdata/1").
Example
# Single spectrum
fit2d("109/pdata/1")
# Series of spectra (e.g. titration or temperature series)
fit2d(["11/pdata/1", "12/pdata/1", "13/pdata/1"])NMRAnalysis.GUI2D.format_param — Method
format_param(peak, param, slice, value_type) -> StringFormat a parameter value, returning "NA" if not found.
NMRAnalysis.GUI2D.format_post — Method
Format a post-fit parameter value/uncertainty, returning "NA" if absent.
NMRAnalysis.GUI2D.get_titration_data — Method
get_titration_data(peak, expt) -> (obsX, obsY, fitX, fitY)Per-dimension Δδ-vs-concentration points for the highlighted residue: observed points (obsX/obsY) and the fitted binding curve (fitX/fitY, empty until the global fit runs). The Y series (F2 dimension) is divided by the standard heteronuclear scaling factor (_yshiftscalefactor, 10 for ¹⁵N / 4 for ¹³C) so it can be overlaid on the same axis as X.
NMRAnalysis.GUI2D.has_atom_labels — Method
has_atom_labels(labels)::Booltrue if any label in the iterable carries an atom name (e.g. methyls such as "I13CD1"), used to decide between scatter and bar summary plots.
NMRAnalysis.GUI2D.hetnoe2d — Method
hetnoe2d(reference, saturated)Start interactive GUI for analysing 2D heteronuclear NOE data.
reference and saturated can each be a single filename or a list of filenames — Bruker experiment numbers work too, individually or as a list/range. When lists are provided, results are averaged across all pairs.
Examples
# Single reference / saturated pair
hetnoe2d("expno1/pdata/231", "expno1/pdata/232")
# Multiple pairs (results are averaged across pairs)
hetnoe2d(
["expno1/pdata/231", "expno2/pdata/231"], # references
["expno1/pdata/232", "expno2/pdata/232"], # saturated
)
# Bruker experiment numbers
hetnoe2d(1, 2)NMRAnalysis.GUI2D.makeadjacency — Method
Generate adjacency matrix for peak overlap
NMRAnalysis.GUI2D.mark_add! — Method
Record pos for the plane currently being marked and advance (or finish).
NMRAnalysis.GUI2D.mask! — Method
mask!(expt::Experiment)Calculate masks for all peaks and update specdata.
NMRAnalysis.GUI2D.methylccr2d — Method
methylccr2d(buildupexpt, decayexpt, T; C=3/4, skipplanes=nothing)Start an interactive GUI for methyl ¹H–¹H cross-correlated relaxation analysis.
For each peak, the ratio of buildup to decay intensities |Iₐ/I_b| is measured across a series of relaxation delays T and fitted to eq 7 with two parameters: the cross-correlated relaxation rate η (s⁻¹) and a coupling term δ (< 0). The fitted η is converted to the methyl order parameter × tumbling time S²τc (ns) via eq 1 (ideal methyl geometry), which is the parameter shown in the summary plot.
Arguments
buildupexpt: buildup series (Iₐ) — a single pseudo-3D path string, or aVector{String}of per-delay 2D data directories. Bruker experiment numbers work too, individually or as a list/range.decayexpt: decay series (I_b), in the same form asbuildupexpt.T: vector of relaxation delays in seconds, or a path string to a text file of delays (one per line; lines beginning with#are ignored). Each series must have one plane per delay.
Keyword Arguments
C: fixed prefactor in eq 7.3/4(default) for triple-quantum (TQ);1/2for double-quantum (DQ).skipplanes: optional list of delay indices (1-based, intoT) to exclude from the eq 7 fit. Skipped points appear as open grey markers.
Example
# buildup and decay each as a pseudo-3D dataset
methylccr2d("11/pdata/1", "12/pdata/1", [0.001, 0.002, 0.004, 0.006, 0.010])
# double-quantum variant
methylccr2d("11/pdata/1", "12/pdata/1", "vdlist.txt"; C=1/2)NMRAnalysis.GUI2D.modelfit2d — Function
modelfit2d(inputfilenames, xvalues, equation, parameters)Create an intensity analysis experiment with fitting to a custom equation.
Arguments
inputfilenames: String or vector of strings giving the input data files.xvalues: Vector of Float64 giving the x values for fitting, or string giving a filename from which to read the x values.equation: String giving the model equation to fit, e.g."A*sin(J*x)"parameters: Vector of parameter name-value pairs giving initial parameter values, e.g.["A"=>40., "J"=>0.5]
Example: J-modulation
modelfit2d(["112","113","114","115"],
[0.1, 0.2, 0.3, 0.4],
"A*sin(J*x)",
["A"=>40., "J"=>0.5])NMRAnalysis.GUI2D.movepeak! — Method
movepeak!(expt, idx, newpos)Move peak idx to newpos. Updates clusters automatically.
NMRAnalysis.GUI2D.npeaks — Method
npeaks(expt::Experiment)Number of peaks currently in the experiment.
NMRAnalysis.GUI2D.nslices — Method
nslices(expt::Experiment)Number of spectra in the experiment.
NMRAnalysis.GUI2D.pack! — Function
Return list with value(s) (or if :min or :max passed, their limits)
NMRAnalysis.GUI2D.pack! — Function
Create vector of parameters (options - :min, :max, :initial)
NMRAnalysis.GUI2D.parse_label — Method
parse_label(label)::ResidueLabelBest-effort parse of a peak label into residue number, one-letter code, and atom name. Handles, e.g.:
- Amides:
"G10", reversed"7A" - Methyls/sidechains:
"I13CD1","L26CD1"/"L26CD2","V70CG1","M98CE" - Nucleic-acid atoms:
"A12C8","G5C1'" - Non-standard/unassigned:
"X99"→ resnum-99
This function is deliberately permissive: it never throws. Unrecognised input simply yields a best guess (e.g. ResidueLabel(0, '?', "") for an empty or number-less label). Parsing is metadata only and must never block fitting, saving, or loading — users may use any labelling convention they like.
NMRAnalysis.GUI2D.parse_radius_comment! — Method
parse_radius_comment!(expt, line)If line records an X/Y fitting radius (as written by writeresults!, e.g. # X radius / ppm: 0.04), apply it to the experiment. Generic to all 2D experiments.
NMRAnalysis.GUI2D.peakinfotext — Method
Return formatted text describing peak idx.
NMRAnalysis.GUI2D.peakinfotext — Method
Return formatted text describing peak idx.
NMRAnalysis.GUI2D.peakinfotext — Method
Return formatted text describing peak idx.
NMRAnalysis.GUI2D.peakinfotext — Method
Generic handler for peak info text
NMRAnalysis.GUI2D.peakinfotext — Method
Return formatted text describing peak idx.
NMRAnalysis.GUI2D.peaktrack2d — Method
peaktrack2d(inputfilenames)Start an interactive GUI for analysing a series of 2D spectra in which peak positions change from plane to plane (e.g. a titration, or a coupling-constant / RDC measurement). Each peak is fitted to a 2D Lorentzian lineshape independently in every plane, so its position and linewidth are free to move; no physical model is applied to the trajectory.
Use this to measure how peak positions and linewidths evolve across a series for downstream analysis, or as the basis for the position-based physical models (titration, coupling).
Arguments
inputfilenames: A single path string (pseudo-3D dataset) or a vector of path strings (one file per plane) pointing to processed Bruker data directories. Bruker experiment numbers work too, individually or as a list/range (e.g.1:11), resolved relative to the working directory.
Example
peaktrack2d(["11/pdata/1", "12/pdata/1", "13/pdata/1"])
peaktrack2d(1:11)See also titration2d for fitting binding isotherms to a titration series.
NMRAnalysis.GUI2D.postfit! — Method
Calculate final parameters after fitting.
Computes CCR rate η from the model:
- Single experiments: tanh(η * T) = Ibuildup / Idecay
- Symmetric (pairs): tanh(η * T) = sqrt((Ibuildup1 * Ibuildup2) / (Idecay1 * Idecay2))
NMRAnalysis.GUI2D.postfit! — Method
Calculate final parameters after fitting.
NMRAnalysis.GUI2D.postfit! — Method
Calculate final parameters after fitting.
NMRAnalysis.GUI2D.postfit! — Method
Additional fitting of peak following spectrum fit - defaults to no action
NMRAnalysis.GUI2D.postfit! — Method
Calculate final parameters after fitting.
NMRAnalysis.GUI2D.postfitglobal! — Method
Global fitting of entire experiment following spectrum fit - defaults to no action
NMRAnalysis.GUI2D.primaryparam — Method
primaryparam(expt) -> SymbolThe experiment's primary derived (post-fit) result. It is written first among the derived columns in results.csv and is the default parameter plotted by summaryplot. Defaults to :amp (peak amplitude) for experiments that derive no post-fit parameters (e.g. plain fit2d).
NMRAnalysis.GUI2D.rdc2d — Method
rdc2d(; isotropic, aligned, coupling=nothing, scale=1)Interactive measurement of one-bond couplings and residual dipolar couplings from paired 2D spectra. Supply the two doublet-component spectra (already combined, e.g. IPAP α/β, or HSQC/TROSY) for each condition:
rdc2d(isotropic = ["iso_a/pdata/1", "iso_b/pdata/1"],
aligned = ["aln_a/pdata/1", "aln_b/pdata/1"])The four spectra become the planes of a peak-tracking experiment. Track each residue's peak across the planes (T) or add and adjust by hand (A); the per-residue postfit then reports
J = sep(isotropic) / scale
J+D = sep(aligned) / scale
D = (J+D) − Jwhere sep is the position difference between the two components in the coupling dimension (converted to Hz). scale is 1 for IPAP and 0.5 for HSQC/TROSY (the separation is then half the coupling). coupling selects the dimension (:F1/:F2); it defaults to the heteronuclear dimension, and the sign is flipped automatically for ¹⁵N (so J ≈ −93 Hz). List the two components in the same order for both conditions; if J comes out with the wrong sign, swap the pair. Each component can also be given as a Bruker experiment number.
NMRAnalysis.GUI2D.readpeaklist! — Method
readpeaklist!(expt, filepath::AbstractString)Read a peak list and add the peaks to expt. Only the label, x and y columns are used — every other column (resnum, resname, atom, linewidths, amplitudes, derived parameters …) is ignored, since the residue number and atom are re-derived from the label.
Two layouts are accepted:
- With a header row (e.g. the program's own
results.csv): the first non-comment line contains alabelcolumn name, andx/yare located by name, so column order and extra columns don't matter. - Without a header (a hand-made list): values are read positionally as
label x yfrom the first three columns, so no exact column names are needed.
Fields may be comma- or whitespace-separated. Lines beginning with # are comments. A malformed line is skipped with a warning rather than aborting the load — any labelling convention is tolerated.
NMRAnalysis.GUI2D.recovery2d — Method
recovery2d(inputfilenames, relaxationtimes)Start an interactive GUI for measuring longitudinal relaxation from an inversion recovery or saturation recovery experiment. Peak amplitudes are fitted to a magnetisation recovery model:
\[I(\tau) = A\left(1 - C\exp(-R\tau)\right)\]
where $R$ is the recovery rate (s⁻¹), $A$ is the equilibrium amplitude, and $C$ is the recovery factor. For an ideal inversion recovery experiment $C = 2$; for saturation recovery $C = 1$.
Arguments
inputfilenames: A single path string (pseudo-3D dataset) or vector of path strings (one file per delay) pointing to processed Bruker data directories.relaxationtimes: Vector of delay times in seconds, or a string giving a path to a text file containing the delays (one per line; lines beginning with#are ignored).
Example
t = [0.1, 0.2, 0.4, 0.7, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0]
recovery2d("33/pdata/1", t)
# Reading delays from a file
recovery2d("33/pdata/1", "vdlist.txt")NMRAnalysis.GUI2D.relaxation2d — Method
relaxation2d(inputfilenames, relaxationtimes; skipplanes=nothing)Start an interactive GUI for measuring R1 or R2 relaxation rates from a series of 2D spectra. Peak amplitudes are fitted to a mono-exponential decay:
\[I(\tau) = A \exp(-R\tau)\]
where $R$ is the relaxation rate (s⁻¹) and $A$ is the peak amplitude. The software does not distinguish R1 from R2 — the appropriate interpretation depends on the experiment.
Arguments
inputfilenames: Vector of path strings to processed Bruker data directories, one per relaxation delay.relaxationtimes: Vector of delay times in seconds, or a string giving a path to a text file containing the delays (one per line; lines beginning with#are ignored).
Keyword Arguments
skipplanes: Optional list of plane indices (1-based) to exclude from the exponential fit. All spectra are still loaded and displayed; skipped planes appear as open grey markers in the peak plot and are not used when fitting R or A. The full list of relaxation times must still be provided, including those for skipped planes.
Example
relaxation2d(
["11/pdata/1", "12/pdata/1", "13/pdata/1", "14/pdata/1"],
[0.010, 0.030, 0.060, 0.100]
)
# Reading delays from a file
relaxation2d(["11/pdata/1", "12/pdata/1", "13/pdata/1"], "vclist.txt")
# Omit the 3rd plane (e.g. corrupted or duplicate delay) from the fit
relaxation2d(
["11/pdata/1", "12/pdata/1", "13/pdata/1", "14/pdata/1"],
[0.010, 0.030, 0.060, 0.100];
skipplanes=[3]
)NMRAnalysis.GUI2D.resultstable — Method
resultstable(expt) -> (header, rows)Build the column-name header and the rows (each a vector of strings) for the results file. Derived (post-fit) parameters are appended with the experiment's primary parameter first (see primaryparam).
NMRAnalysis.GUI2D.sampleconcentrations — Method
Name => total concentration for the sample components defined on spec, or an empty Dict when spec carries no sample component metadata (e.g. a plane of a pseudo-3D dataset).
NMRAnalysis.GUI2D.save_cluster_plots! — Method
save_cluster_plots!(expt, folder)Save one zoomed contour plot per cluster of overlapping peaks (first plane only). Axis limits are set to include only the peaks in that cluster plus padding.
Files are named cluster_LABEL.pdf (single peak) or cluster_LABEL1-LABEL2.pdf (overlapping peaks).
NMRAnalysis.GUI2D.save_summary_plot! — Method
save_summary_plot!(expt, folder)Write summary.pdf to folder using the experiment's default summary parameter. Skipped when there are no peaks.
NMRAnalysis.GUI2D.setperplane! — Method
setperplane!(peak, param, values)Write a per-plane parameter from a loaded results file, setting both the fitted value and the initial value in every plane (so the loaded positions display immediately and seed any refit).
NMRAnalysis.GUI2D.simulate! — Function
Simulate single peak according to experiment type.
NMRAnalysis.GUI2D.simulate! — Function
Simulate single peak according to experiment type.
NMRAnalysis.GUI2D.simulate! — Function
Simulate single peak according to experiment type.
NMRAnalysis.GUI2D.simulate! — Function
Simulate single peak according to experiment type.
NMRAnalysis.GUI2D.simulate! — Function
Simulate single peak across all planes (used for the displayed fit spectrum).
NMRAnalysis.GUI2D.simulate! — Function
Simulate single peak according to experiment type.
NMRAnalysis.GUI2D.simulate! — Method
simulate!(expt::Experiment)Simulate all peaks in the experiment and update specdata.
NMRAnalysis.GUI2D.simulatepeakplane! — Function
Simulate a single peak into one plane i. xbounds/ybounds, if given, are the boolean masks restricting z to that plane's fit window.
NMRAnalysis.GUI2D.slicelabel — Method
Return descriptive text for slice idx.
NMRAnalysis.GUI2D.slicelabel — Method
Return descriptive text for slice idx.
NMRAnalysis.GUI2D.slicelabel — Method
Return descriptive text for slice idx.
NMRAnalysis.GUI2D.slicelabel — Method
Generic label for spectum slices
NMRAnalysis.GUI2D.slicelabel — Method
Return descriptive text for slice idx.
NMRAnalysis.GUI2D.sortedpeaks — Method
Sort peaks by residue number (positive ascending first, then unassigned).
NMRAnalysis.GUI2D.splitfields — Method
splitfields(line)Split a data line into fields, accepting either comma-separated (the format written by writeresults!) or whitespace-separated values. Surrounding whitespace on each field is stripped.
NMRAnalysis.GUI2D.summary_dataset — Function
summary_dataset(expt, param; name, include_unassigned) -> SummaryDatasetCollect param (default: the experiment's primaryparam) for every peak in a live experiment.
NMRAnalysis.GUI2D.summary_dataset — Method
summary_dataset(path, param; name, include_unassigned) -> SummaryDatasetRead param from a saved results.csv (or a folder containing one). The label, residue number and atom are re-derived from each row's label.
NMRAnalysis.GUI2D.summaryplot — Method
summaryplot(source; param=<default>, ylabel, title, size, include_unassigned)
summaryplot(source1, source2, ...; kwargs...)Plot a fitted parameter against residue number.
source may be a live experiment, a saved results.csv (or its folder), or a vector of any of these (which gives vertically stacked panels). Multiple sources may also be passed as separate positional arguments instead of a vector.
param selects which parameter to plot:
- omitted/
nothing→ each source's own default (itsprimaryparamor first derived column), so a mix of experiment types — e.g. relaxation and hetNOE — each plot their own result; - a single
Symbol→ the same parameter for every source; - a vector → one parameter per source (a
nothingentry uses that source's default).
ylabel likewise may be a single label applied to all panels or a vector of per-panel labels; by default each panel is labelled from its parameter.
size sets the figure size in pixels, e.g. size=(800, 400).
- Backbone/amide labels → a scatter of value vs residue number with error bars.
- Any atom-typed labels (e.g. methyls
I13CD1,L26CD2) → a bar plot ordered by(residue, atom)with peak labels as ticks, so stereospecific pairs don't overlap. Decided per panel. - Unassigned peaks (the default
X#names) are omitted unless every peak is unassigned, orinclude_unassigned=true.
Uses whichever Makie backend is active and returns the Figure, so the result displays interactively under GLMakie and can be saved with save("summary.pdf", fig) under CairoMakie.
NMRAnalysis.GUI2D.summaryplot — Method
summaryplot(expt::MovingExperiment; weights=(1.0, 0.14), title, size, include_unassigned)Default summary for a moving-peak experiment: combined chemical-shift perturbation Δδ against residue number, with one series per plane beyond the first (each plane's shift is measured relative to plane 1).
Δδ = √((w₁·Δδx)² + (w₂·Δδy)²), with weights weighting the two dimensions. The default (1.0, 0.14) assumes the F1 (x) axis is ¹H and the F2 (y) axis is ¹⁵N (Williamson 2013); pass weights to suit other nuclei (e.g. (1.0, 0.25) for ¹³C).
NMRAnalysis.GUI2D.titration2d — Method
titration2d(inputfilenames; L0=nothing, P0=nothing, weights=(1.0, 0.14))Interactive analysis of a 2D titration series, fitting a global binding isotherm to the chemical-shift perturbations. Built on peaktrack2d: track each residue's peak across the planes (T) or add and adjust by hand (A), and the fit recovers a single Kd shared by all residues plus per-residue free/bound shifts in each dimension.
Arguments
inputfilenames: A single path string (pseudo-3D dataset) or a vector of path strings (one file per plane) pointing to processed Bruker data directories. Bruker experiment numbers work too, individually or as a list/range (e.g.1:11), resolved relative to the working directory.L0: Total ligand concentration in each plane (one per plane). If omitted, it is read from each plane's NMR sample metadata (seetitrationconcentrations); an error is raised if that metadata isn't available either.P0: Total protein concentration in each plane (one per plane), ornothing. When given (explicitly, or found in sample metadata), the exact 1:1 binding equation is used, accounting for protein concentration and dilution; otherwise the hyperbolic (ligand ≈ free) approximation is used.Kdis reported in the same concentration units asL0/P0.weights:(wx, wy)weighting of the two dimensions for the combined CSP|Δδ|; the default assumes ¹H (x) / ¹⁵N (y).
Results
- The per-residue panel shows ΔδX and ΔδY together on a single axis (referenced to the fitted
δfree), with the fitted binding curves overlaid. ΔδY is divided by the standard scaling factor for its nucleus (10 for ¹⁵N, 4 for ¹³C) so it sits on the same ppm scale as ΔδX. - The global
Kdis reported in the results panel. - The summary plot shows ΔδX, ΔδN and the combined
|Δδ|(saturation CSP =δbound − δfree) against residue number.
Example
titration2d(files) # concentrations from sample metadata
titration2d(files; L0=ligand_concs) # ligand concentrations only
titration2d(files; L0=ligand_concs, P0=protein_concs) # exact 1:1, accounts for dilution
titration2d(1:11) # Bruker experiment numbersNMRAnalysis.GUI2D.titrationconcentrations — Method
titrationconcentrations(nmrdata) -> (L0, P0)Derive per-plane ligand (L0) and protein (P0) concentration vectors from each plane's sample metadata (see above for the inference rule). Returns (nothing, nothing) when no plane carries any sample concentration metadata. P0 alone comes back nothing if the protein's concentration isn't defined on every plane (the hyperbolic ligand ≈ free approximation is then used instead of the exact 1:1 equation) — as with exchange1d's _prompt_concentrations!, a molecule missing from only some planes' sample metadata is warned about rather than silently treated as zero or silently dropped. The resolved per-plane concentrations are printed as a table (in the same style as exchange1d's parameter tables) so they can be checked at a glance.
NMRAnalysis.GUI2D.trackmaximum — Method
trackmaximum(expt, i, xc, yc) -> (x, y)Position of the most intense point in plane i within the peak radius of (xc, yc). Used to follow a peak from plane to plane during tracking; returns (xc, yc) unchanged if the search window falls off the spectrum.
NMRAnalysis.GUI2D.unpack! — Function
Unpack a parameter and pop from input vector. Quantity could also be :uncertainty
NMRAnalysis.GUI2D.unpack! — Function
Unpack a parameter and pop from input vector. Quantity could also be :uncertainty
NMRAnalysis.GUI2D.writeresults! — Method
writeresults!(expt, folder) -> StringWrite all peak results to a single results.csv in folder. Each row is one peak with identity (label, resnum, resname, atom), positions (x, y), linewidths (R2x, R2y), per-plane amplitudes (amp[1], amp[2], …) and any derived parameters, each value immediately followed by its _err uncertainty column. Experiment metadata is written as #-comment lines above an ordinary (uncommented) header row, so the file opens directly in spreadsheets and via pandas.read_csv(comment="#").