Let Y=(y_{ij})\in\mathbb R_+^{n\times m} contain the observed ion intensities, with scans i=1,\ldots,n in rows and mass channels j=1,\ldots,m in columns. Deconvolution estimates the contributions of individual compounds to the mean signal M=(\mu_{ij}), together with a smooth background. GCMSprime combines grouped sparse regression, PSF estimation and shape-constrained matrix factorization in a common likelihood-based workflow.
Write the weighted observation log likelihood as
\ell_\nu(M;Y)=\sum_{i=1}^n\sum_{j=1}^m w_{ij}\ell_\nu(y_{ij};\mu_{ij}),
where w_{ij}\geq0 are supplied observation weights and \nu contains the noise parameters. For quasipoisson data, the corresponding quasi-likelihood has the Poisson mean-dependent part divided by the estimated dispersion \phi. The same notation below covers likelihood and quasi-likelihood; Section 5 specifies the noise models. The identification article covers retention indices and spectral library search.
Sparse spectra and log-concave profiles for count data
For a count matrix with time in rows and ions in columns, write the expected signal in sample s as \mu_{sij} = \epsilon + (B_s A_s)_{ij} + \sum_{k=1}^K h_{sik}p_{kj}, \qquad p_{kj}\ge0,\quad \sum_j p_{kj}=1 . An absent compound has h_{s\cdot k}=0. Otherwise its positive support is a contiguous interval. For successive positive observations the slopes (\log h_{s,i+1,k}-\log h_{sik})/(t_{s,i+1}-t_{si}) are nonincreasing. This permits asymmetric peaks, including an abrupt change of slope at the apex. Each h_{sik} is the compound’s expected total ion count in that scan. Two samples can have different peak shapes, widths, areas and acquisition times.
With \operatorname{Var}(Y_{sij})=\phi_s\mu_{sij}, the conditional updates minimize J = 2\sum_{sij}\frac{y_{sij}\log(y_{sij}/\mu_{sij})-y_{sij}+\mu_{sij}}{\phi_s} + \lambda_{\rm eff} \left[\sum_{k=1}^{K}(\lVert p_k\rVert_0-1)+\sum_{sk}d(h_{s\cdot k})\right]. Use 0\log 0=0. A spectrum with u positive ions contributes u-1 free proportions. A positive log profile on two or more scans contributes two endpoint ordinates plus one dimension per interior strict decrease in log slope. A single-scan support contributes one dimension and an absent profile contributes zero. This is the dimension of the fitted face of the log-concavity cone, conditional on support and knots. Searching over their locations adds selection uncertainty. The working GIC uses \lambda_{\rm eff}=\kappa\log(p)\log\log(n). For a joint fit use p=n=\sum_s n_s. The temporal information factor \kappa equals one for independent residuals. Backgrounds are estimated on a fixed basis and remain unpenalized. The fitted noise parameters add a constant charge to the reported information criterion for that dataset.
For the local count search, pass
batch = list(coupling = list(penalty_search = TRUE)). Weak
occurrences can transfer their signal to overlapping log-concave
profiles. Across samples, similar spectra with overlapping aligned
half-height intervals can share one identity after a local joint refit
with their neighbours. The original-channel GIC decides each support
change. Shared rank and
time per sample on full chromatograms.
The adaptive-ridge calibration in the initial PSF regression applies
each time that regression uses the surrogate. Factor updates charge the
full original GIC price per degree of freedom. A temporary fourfold
price proposes a sparser support. After refitting, the original price
decides whether to keep the candidate. For simultaneous count fits a
second blind PSF also proposes groups of overlapping factors for
exchange. Long refinements revisit all factors on the first, every tenth
and the final sweep. Supply refinement_sweeps=100L,
penalty_search=TRUE and alternative_X=TRUE in
batch$coupling for this search.
- Form a spectral dictionary. Calibrate the PSF, form its banded design and fit a nonnegative grouped L0 regression across channels. For a single sample the independent log-concave fit supplies local starts. Repeated acquisitions can share a PSF estimated from pooled, count-conserving total-ion traces. Channel aggregation accelerates the initial regression. Estimate the original-ion intensities by nonnegative least squares. The sparse Gram matrix records which initial profiles overlap.
- Locate candidate occurrences. With several samples, interpolate each peak’s 1%-height onset on its native scan grid. Reciprocal spectral matches within the retention window provide the anchors for monotone time maps. On that shared clock, propose local spectral directions that overlapping candidates cannot already explain by a nonnegative mixture. Retain native time coordinates for testing peak shape. With one sample the time map is the identity.
- Alternate two conditional updates. Visit components in decreasing total abundance. To update one profile, put all other components and background in the offset. Compute per-scan conditional count estimates, project their logarithms onto the concavity cone with information weights, optimize the amplitude, and compare with keeping or removing the old profile using original-ion J. A curve reaching a window boundary can expand. For fixed profiles, refit a common spectrum from all occurrences. Compare each ion with zero using the same penalty and transfer the spectrum’s normalization into the profiles. Update the background.
- Check ambiguous overlaps. Test proposed local support exchanges and joint refits against the same original-channel objective. The default allows 12 initial sweeps and up to two exchange rounds, with at most ten refit sweeps after an accepted exchange. Relative objective improvement below 10^{-3} ends a round. These bounded searches return a local solution. Supplied ground truth need not minimize a penalized criterion on one realization of noisy data.
For overlapping peaks, a spectrum observed in relatively few samples can be proposed as a nonnegative combination of recurring spectra from the same aligned retention interval. Each proposed template must also occur in a sample where the putative mixture is absent. The solver refits the contributing log-concave profiles and shared spectra on the original ion counts. It tests both redistribution and retention of a residual spectrum. Within a sample, profiles whose half-height intervals overlap and whose spectra are nearly linearly dependent are also refitted jointly. The fit compares keeping the locally redundant profiles with dropping them. The fitted background and other compounds contribute to the offset in each comparison. An exchange is accepted only when it lowers the same deviance-plus-dimension penalty as the factor updates. Library identities and known peak areas enter only at validation.
With the spectra fixed, profiles in different samples have separate likelihood contributions. With profiles fixed, the spectral likelihood and ion inclusion penalty separate by ion. Workers therefore update different samples or ion columns while preserving the component order within each. The spectral sweep transfers the unit-sum normalization into each profile after all ions have finished. Accepting a merge changes the offsets of its neighbours, so merge decisions remain sequential.
For simulated data a truth-based comparison has a precise interpretation. Write \mu^\star=E(Y) and fix dispersion and weights. The expected difference in Poisson deviances between any fixed \mu and \mu^\star is 2\sum[\mu^\star\log(\mu^\star/\mu)+\mu-\mu^\star]/\phi, which is nonnegative. On a single noisy dataset this inequality need not hold. Adding a dimension penalty can also favor a simpler approximation in expectation. A true-profile initialization consequently provides a reference value for this dataset. In a grouped Poisson regression, starting the fitted mean at HS+BA gives the correct first Fisher weights. The support penalty and the sample score can still move the coefficients away from their generating values.
Use objective.trace=TRUE to record original-channel
deviance, the two dimension counts, rank, occurrences and J after each block. The values in
conditional_objective use the saturated model as the
deviance reference. The GIC() extractor includes the
data-dependent likelihood constant and estimated noise dimensions.
Comparisons on the same observations and noise specification give the
same objective differences.
For simulated data, pass truth.profiles to
gcmsDeco() to compare the standard fit with the same solver
initialized from known, matched elution profiles. Both fits estimate
spectra and abundances from the measured counts. The signed empirical
GIC gap compares the endpoints of the two fits at the same penalty. The
attainable reference depends on the data and starting values. The
full-chromatogram benchmark times the blind fit and checks its estimated
rank against the generating compounds. Simulation, measured rank and
timing.
Solver selection is automatic. Sections 3 and 4 give the component-count penalty used for other noise families and for disk-backed joint refinement.
1. Deconvolution based on a known peak shape
Suppose the response to a narrow input is a known point spread function (PSF), or peak shape function, g. Shifted copies form the columns of X(g)\in\mathbb R_+^{n\times p}, where p is the number of candidate peak positions. The mean model is
M=X(g)C+BA+O,\qquad C\geq0,\quad A\geq0.
Here C\in\mathbb R_+^{p\times m} contains the ion amplitudes, B\in\mathbb R_+^{n\times q} is a low-dimensional background basis, A contains its coefficients, and O is optional known additive signal. A nonzero row of C calls a peak using evidence from all mass channels. Define its row-support size by
s(C)=\|C\|_{2,0} =\sum_{r=1}^{p}\mathbf 1\{\|C_{r\cdot}\|_2>0\}.
The grouped L_0 selection target is
\mathcal G(C,A;g) =-2\ell_\nu\{X(g)C+BA+O;Y\}+\lambda_g s(C).
The row charge \lambda_g trades improved fit against the number of called peaks; background terms are compulsory and unpenalized. Minimizing this criterion corresponds to best subset of groups selection (BSGS): each group consists of all channel coefficients at one candidate position. It seeks the jointly most parsimonious peak calls supported by the complete multichannel signal.
L0glm approximates this selection problem using iterative adaptive ridge regression within GLM IRLS. The GIC preset supplies the information-criterion scale
\lambda_{\rm IC}=\log p\,\log\log n,
with natural logarithms, as motivated for high-dimensional penalized likelihood by Fan & Tang (2013). The adaptive-ridge calibration uses a quarter of this scale, with the appropriate dispersion factor in the working quadratic. Grouped selection shares support information across channels; a relaxed fit then re-estimates the amplitudes on the selected rows. The total compound charge used by GCMSprime’s final factorization is specified in Section 3.
The sparse pulse-train formulation was inspired by de Rooi & Eilers (2011). Our extensions add an efficient information-criterion regularization preset, grouped selection approximating BSGS, and likelihood-based treatment of Poisson or overdispersed Poisson ion-intensity noise. In the overdispersed case, the selection target is the corresponding quasi-GIC, with the estimated variance scale retained in the quasi-likelihood. This is especially useful for electron-multiplier measurements, whose variation exceeds that of ideal ion counts.
2. Estimate an unknown or time-varying PSF
When g is unknown, the convolution model is bilinear in g and C. For a fixed channel spike train c_j=C_{\cdot j},
X(g)c_j=T(c_j)g,
where T(c_j) contains shifted copies of c_j. Thus both conditional subproblems can be expressed as nonnegative GLMs. Blind PSF estimation alternates two L0glm fits:
- Spike-train update: hold g fixed and estimate C,A from Y using grouped sparse regression on [X(g),B].
- PSF update: hold the spike trains fixed and regress informative ion traces on T(c_j), with the background and known signal in the offset. The current kernel is the ridge prior center; positive starts preserve eligible tails. Combine the channel estimates, impose the kernel shape constraint, align its centroid and normalize its sum to one.
These are alternating block-coordinate updates for the joint sparse likelihood target
\mathcal G(C,A,g) =-2\ell_\nu\{X(g)C+BA+O;Y\}+\lambda_g s(C),
subject to nonnegativity and a normalized, log-concave kernel. The second block uses adaptive ridge regularization and shape smoothing to stabilize kernel estimation. Completed kernel proposals are compared after refitting their spike trains and backgrounds with the requested information criterion; the best synchronized checkpoint is retained. This makes the criterion apply to the complete reconstructed signal. The numerical procedure uses approximate conditional updates rather than exact minimization of each block.
The same observation model is carried through both fits. With the default quasipoisson model, the pooled dispersion is estimated first and reused as a fixed inverse-variance scale. Poisson sets \phi=1; the other supported noise families use their corresponding likelihoods. An alkane standard with isolated peaks can provide the initial kernel, followed by blind refinement on the sample.
For a time-varying PSF, repeat the local estimation in overlapping windows centered at \tau_1<\cdots<\tau_R. Between adjacent anchors, interpolate the log kernels and renormalize:
g_t=\frac{\exp\{(1-a)\log g_r+a\log g_{r+1}\}} {\sum_\ell\exp\{(1-a)\log g_{r\ell}+a\log g_{r+1,\ell}\}}, \qquad 0\leq a\leq1.
Convex combinations of concave log profiles preserve log-concavity. Each candidate peak receives the interpolated shape for its retention region, giving a sparse, time-varying convolution design. The full-chromatogram default uses ten PSF anchors. See PSF estimation in logconNMF for the calibration and windowed-estimation algorithms.
3. Compound- and concentration-dependent PSFs
A time-varying common PSF captures instrumental drift, while compound chemistry and concentration can produce additional broadening, tailing or overload. To accommodate these effects, each compound receives its own profile in the factorization
\mu_{ij}=\sum_{r=1}^{K}H_{ir}S_{rj}+(BA)_{ij}+O_{ij}, \qquad H,S,A\geq0.
The columns of H are elution profiles and the rows of S are mass spectra. Each profile has unit sum and a contiguous positive support, with
\Delta^2\log H_{\cdot r}\leq0.
On an equally spaced scan grid this is equivalent, at interior positive ordinates, to H_{ir}^2\geq H_{i-1,r}H_{i+1,r}. For an irregular time grid, the successive slopes of the log profile must be nonincreasing.
Log-concavity accommodates a broad range of chromatographic shapes: Gaussian peaks, exponentially modified Gaussian peaks, and asymmetric triangular or shark-fin-shaped acid peaks. Gaussian and exponential profiles are log-concave, and their convolution remains log-concave; this gives the exponentially modified Gaussian case. See Saumard & Wellner (2014) for the closure properties. Log-concavity implies unimodality and additionally constrains the evolution of the rising and falling slopes. It therefore provides stronger shape information than the unimodality constraint commonly used in MCR-ALS, helping prevent shoulders and fragments from being assigned to a single incoherent component. The MCR-ALS framework and its constraints are reviewed by de Juan, Jaumot & Tauler (2014).
The rank-selection objective is
J(H,S,A,K) =-2\ell_\nu(HS+BA+O;Y)+\lambda_RK, \qquad \lambda_R=m\kappa\lambda_{\rm IC}.
Here m is the original number of mass channels and \kappa=1 for independent observations; an optional temporal-correlation adjustment is described in Section 5. Equivalently, dividing by m gives -2\ell_\nu/m+\kappa\lambda_{\rm IC}K, with one rank-selection charge per compound. Smooth background coefficients and profile complexity receive no additional penalty under this compound-count convention. Reported IC values use mK plus the number of estimated shared noise parameters as their complexity count.
For fixed K, local conditional likelihood fits refine the spectra, profiles and background. For example, updating compound r uses
\mu_{ij}=R^{(-r)}_{ij}+H_{ir}S_{rj}, \qquad R^{(-r)}=BA+O+\sum_{s\ne r}H_{\cdot s}S_{s\cdot},
so the remaining fitted signal is an offset. Only the affected scan window needs updating. A constrained quadratic step in \log H_{\cdot r} uses the original intensity likelihood and is checked by backtracking. This preserves the chosen noise model while imposing a hard shape constraint. The spectra serve as covariates for the time profiles, with current profiles and spectra supplying the starting values. The native solver refines one log profile at a time and jointly refits the overlapping spectra. Fine refinement has no additional shrinkage toward zero or toward the starting peak shape. It normalizes each updated profile and transfers its scale to the spectrum, preserving the fitted contribution.
Final refinement also checks broader starting profiles when component modes nearly coincide. Left, right and two-sided width expansions preserve log concavity and are followed by local profile/spectrum updates. With channel aggregation enabled, compatible Poisson/quasi-Poisson fits screen these proposals in the existing ion groups. Promising spectra are expanded using their current within-group ion proportions. Both the candidate and a matched control are then refined on every original mass channel. A restart is accepted only when its complete original-data criterion improves relative to both the current fit and the separately refined control, with background, noise settings and compound count fixed. Cached control scores are discarded after any accepted move. Other families, channel-specific scales, nonscalar weights or nonzero offsets retain the original-channel proposal screen. The logconNMF algorithm gives the construction and mathematical pseudocode.
The model belongs to the broader class of deviance matrix factorization and generalized matrix factorization models, with additional nonnegativity, log-concavity and rank selection.
4. Automatically estimate the true number of compounds present
The number of compounds is estimated together with their profiles and spectra. Grouped deconvolution with the estimated time-varying PSF first supplies a statistically grounded set of candidate components. An unusually broad or tailed compound can initially produce several nearby components; spectral similarity identifies plausible fragments of the same compound.
The starting search uses an unadjusted IC preset to retain a useful pool of candidate components while their shapes are being refined. Final rank selection then applies the requested working-correlation multiplier \kappa. The initialization and final criterion have separate ledgers when their penalties differ.
The algorithm then proposes fusions of correlated spectra whose profiles overlap and whose combined elution profile is compatible with log-concavity. Local profile and spectral refinement assesses each proposal under the rank-selection objective. Unsupported components can be deleted, and residual-supported components can be added. For a move from K to K', acceptance is based on
\Delta J=-2\{\ell_\nu(M';Y)-\ell_\nu(M;Y)\} +\lambda_R(K'-K)\leq0,
up to numerical tolerance. The noise parameters and numerical rank penalty are held fixed during these comparisons. This balances explanatory power against the number of compounds, yielding an automatically selected factorization rank and a data-driven estimate of the underlying compound count.
For a small fragment contained within a broad peak, spectral similarity can be informative even when the two profile shapes differ substantially. The final pass considers fragments with spectral cosine at least 0.97, at least 99% of their profile mass inside the broad parent’s 1%-height interval, and at most 15% of its area. The parent’s FWHM must exceed four times the calibrated narrow-peak FWHM. A proposed merge and an unmerged control receive the same local joint-refinement budget. All original ion channels enter the decision. The other fitted components and background remain in an offset, and local windows include the entire support of each component whose spectrum changes.
The distinctive contribution is the combination of grouped sparse PSF-based initialization, noise-aware log-concave refinement and explicit compound-count selection within one objective-driven workflow. It extends conventional fixed-rank MCR-ALS formulations by selecting the rank during refinement. Automatic component determination also appears in other GC/MS approaches, including ADAP-GC 4.0; here it is integrated with the rank-penalized, shape-constrained likelihood.
For speed, initialization and fusion can aggregate ion traces into at most 32 size-adjusted groups. The compound charge retains the original m, and final refinement and acceptance checks use every original channel. Thus the fitted spectra retain low-abundance diagnostic ions. The logconNMF mathematical article gives the precise initialization, constrained solvers and pseudocode.
5. Modelled smooth background and flexible noise models
A low-dimensional nonnegative B-spline basis represents the smooth background BA. Its coefficients are compulsory, unpenalized terms and are fitted conditionally on the compound signal. The basis is deliberately much smoother than an individual peak: full chromatograms can follow slow baseline drift, while short windows can use a constant background. A lower-quantile background estimate initializes calibration peak detection.
For automatic background construction, let w denote the median PSF full width at half maximum in scans. The cubic basis dimension is q=\max\{4,\min(40,3+\lceil n/(50w)\rceil)\}, placing knots approximately 50 narrow-peak FWHMs apart. Each basis coefficient has its own nonnegative mass spectrum, so background composition can change gradually with time. Rank selection is conditional on this chosen background basis; background flexibility is not itself charged by the compound-rank penalty.
EI mass-spectrometric intensities commonly exhibit overdispersed counting variation. Ion arrivals are approximately Poisson, while the stochastic gain of the electron multiplier adds variation to the recorded intensity. In a simple compound-Poisson representation,
Y=\sum_{a=1}^{N}G_a,\quad N\sim\operatorname{Poisson}(\Lambda), \qquad \operatorname{E}(Y)=\Lambda\operatorname{E}(G),\quad \operatorname{Var}(Y)=\Lambda\operatorname{E}(G^2).
Consequently, variance is proportional to the mean, with a scale determined by detector gain and the intensity units. This motivates an overdispersed Poisson working model for GC/MS electron-multiplier signals; additional electronics and digitization can also contribute noise. See Ipsen (2015) for a physical derivation of mass-spectral intensity variation.
The default is therefore quasipoisson with estimated
dispersion: \operatorname{Var}(Y_{ij})=\phi\mu_{ij},
implemented as family=quasipoisson("identity"). With \widehat\phi fixed, the mean-dependent
quasi-likelihood is
Q(M;Y)=\frac{1}{\widehat\phi} \sum_{ij}w_{ij}\{y_{ij}\log\mu_{ij}-\mu_{ij}\}.
Thus quasi-GIC comparisons use Poisson deviance divided by \widehat\phi, together with the same compound-count penalty. The package reports these quasi-criteria through its regular IC methods.
Seven identity-link signal models are available:
| Model | Conditional variance or observation convention |
|---|---|
| Gaussian | \sigma^2 |
| Poisson | \mu |
| Quasipoisson | \phi\mu |
| Negative binomial, NB2 | \mu+\mu^2/\theta |
| Negative binomial, NB1 | \phi\mu, with \phi\geq1 |
| Gamma | \phi\mu^2; zeros are left-censored below the specified detection limit |
| Common-scale Gamma | b_0\mu for the latent signal, with the same censoring convention |
Noise parameters are pooled across channels. Fourth- and eighth-order
temporal differences suppress the smooth signal and estimate marginal
variation; their relationship also supports a lag-one covariance
estimate. GCMSprime reuses the calibrated noise specification for PSF
estimation and factorization. This keeps candidate-rank comparisons on a
common noise scale. An optional negative NB2 theta start
permits subsequent likelihood-based updates as documented in
logconNMF.
For temporally correlated scan noise, the working information adjustment \kappa=1+2\widehat\rho_1 increases the rank charge. The marginal variance remains in the observation model. Pearson residuals use that marginal mean-variance relationship, allowing residual heatmaps to compare strong and weak ion channels on a common scale.
6. Integrate and inspect each sample
With \sum_iH_{ir}=1, S_{rj} is the discrete integrated intensity of ion j in compound r. The total-intensity profile is P_{ir}=H_{ir}\sum_jS_{rj}, and the normalized spectrum is T_{rj}=S_{rj}/\sum_jS_{rj}, preserving HS=PT. GCMSprime reports both discrete totals and time-weighted integrated areas, alongside sample names, retention times, widths and compound IDs. Profiles and spectra are ordered by apex retention time by default.
Trace plots overlay fitted compounds on background-corrected observed ion traces. Heatmaps show observations, corrected observations, fitted signal and Pearson residuals. Profile/spectrum panels show the recovered shapes and ion patterns. The single-sample tutorial demonstrates the CDF workflow and MSP, Excel and PDF outputs.
7. Analyze samples together
Across samples, retention times drift and a compound can vary in width, tailing and abundance or be entirely absent. Simultaneous factorisation starts from individual-sample fits and estimates a shared spectrum for matched occurrences while retaining sample-specific profiles, areas and backgrounds.
High-confidence spectral matches supply alignment anchors. Each anchor is the leading 1%-height crossing plus half the width of a small peak in that region, reducing tail-related timing shifts. A robust, smooth monotone map captures retention-time drift, with concentration-related anchor motion accounted for separately.
Candidate matches must agree in spectral shape and aligned time. Comparing their profiles in area order checks compatibility with a coherent log-concave ridge across samples. Shared spectra are refined using pooled evidence from their occurrences. The simultaneous criterion counts a shared spectrum once and each detected occurrence’s amplitude separately.
For G shared spectra and L detected sample–compound occurrences over m original mass channels, the joint objective is
J=-2\sum_s\ell_{\nu_s}(M_s;Y_s) +\kappa\lambda_{\rm IC}\{(m-1)G+L+d_\nu\}.
The m-1 coordinates of each unit-sum spectrum and one amplitude per occurrence give the selection count. The term d_\nu counts estimated noise parameters. For one sample, G=L=K gives the same mK compound count as in Section 3. The GIC preset for the joint fit uses the total scan count for both of its dimension inputs.
Alignment retains each sample’s measured scan grid. Profile coordinates and bin widths transform with an area-preserving Jacobian. Known exposure can be supplied for integrated-count measurements; the default unit exposure preserves vendor intensity units.
Observations and factor checkpoints are stored per sample on disk
during simultaneous refinement. Workers can update samples concurrently
while shared spectra and compact matching summaries remain in memory.
Local retention-time comparisons avoid an all-pairs occurrence-distance
matrix. Samples retain acquisition order and group labels; alkane
standards are selected by acquisition time. Missing occurrences are
reported as NA.
See multiple-sample deconvolution for the directory workflow and logconNMF’s simultaneous model for its objective and mathematical specification.
8. Identify the recovered compounds
GCMSprime imports open and commercial spectral libraries. Alkane-derived retention indices first restrict candidate identities to compounds compatible with the selected stationary phase and RI tolerance. Spectral similarity then ranks those candidates. Consensus IDs connect repeated occurrences to a unique-compound summary across the experiment.
Retention indices and spectral identification describes diagnostic-ion alkane assignments, calibration, column classes, spectral distances and ion weighting. The library-search tutorial gives executable calls and annotated exports.
Parallel processing and sample-specific peak shapes
Directory analyses use one total core budget. For the default
conditional count workflow, file import and noise estimation divide it
among independent CDFs. The grouped PSF regressions choose the number of
sample workers using available memory, unless the caller sets
batch$workers. The joint fit reads disk-backed ion counts
and fitted means in parallel. Profile updates revisit local scan
intervals. Pooled spectrum and background updates read blocks of ions
across samples. The local rank search uses the same files and evaluates
changes against the original-ion criterion. Each sample retains its own
time grid, PSF and noise calibration.
Disk-backed refinement in the general identity-link solver
A shared aggregation is learned from summed chromatograms in common
time bins. Matching and Poisson/quasipoisson profile proposals use these
ion groups; proposal acceptance and spectral estimation use the original
mass channels. The common grid is used only to learn the groups. Each
worker loads its sample into RAM for the independent fit. During
simultaneous refinement, the fit reads bounded blocks of original
observations from disk to evaluate the likelihood and update spectra and
backgrounds. With preclustering, aggregate matrices are cached in RAM by
default. Count-family workers can also retain one original matrix up to
64 MiB and its equally sized likelihood-normalizer cache; larger samples
keep streaming blocks. Buffers belong to the active fit and are released
on return or error. batch=list(cache=FALSE) disables
persistent input caches. Profile updates that work directly on the
original channels and enabled noise updates can load a full assigned
sample into RAM.
Likelihood values already obtained during spectral scoring are reused rather than recomputed. Data-only likelihood constants remain in absolute GIC scores; they cancel algebraically in local acceptance checks. Background fits that already satisfy the existing convergence criterion need no additional solve. These changes preserve the noise model, iteration budgets, grouping rules and original-channel checks.
With shared spectra fixed, profiles and backgrounds can be updated independently across samples. Spectral contributions are then pooled in acquisition order. The spectral fusion queue retains unaffected candidates and refreshes only edges incident to a merged compound, preserving the greedy selection rule. These execution details and the complete objective are given in the logconNMF algorithm.
