Changelog
Source:NEWS.md
prolfqua 1.9.13
Removed
- The 80 functions deprecated in 1.9.5 are removed: the old names (
R6_extract_values(),list_to_AnalysisConfiguration(),LR_test()and others), the helpers whose public route is a method ofLFQDataor its plotter, stats, transformer, aggregator and summariser objects (plot_pca(),summarize_stats(),robust_scale(),estimate_intensity()and others), the modelling helpers replaced bybuild_contrast_analysis()and theModelandContrastsclasses (contrasts_linfct(),moderated_p_limma(),multigroup_volcano()and others), thesim_build_models_*()andsim_make_model_*()simulators, andseparate_hierarchy(),script_copy_helper_vec(),get_contrast()andmatrix_to_tibble(). Theprolfqua-deprecatedhelp page lists the deprecated arguments only.LFQDataPlotter$missigness_histogram()is removed; use$missingness_histogram().
prolfqua 1.9.11
Withdrawn
- The identification-confidence and peptide-consistency weights committed after 1.9.10 are withdrawn from this branch, and results are again those of 1.9.10: the
ident_q_valuecolumn (notidentification_confidence), unweighted default model weights, nouse_identification_confidenceoruse_peptide_consistencyoptions, noAggregateLinearModeland norobscale_lowcv(). The work continues on a separate development branch.
Documentation
- The article “Comparing modelling methods on one dataset” fits every method of
build_contrast_analysis()(all 20, taken fromlist_facades()) and compares them withContrastsComparison: the status of each protein and contrast pair per method, the pairs each method estimates ($coverage(),$upset()), the pairs of one method ($pairs()), the log2 fold changes and statistics on the pairs all intensity methods share, the significant calls, and the sign, significance and coverage conflicts ($conflicts()). A last section compares plain limma, run as its User’s Guide recommends, as aContrastsTablewith its own column names: prolfqua’slimmawithout weights reproduces it.
prolfqua 1.9.10
Removed
-
ropeca_impute_nestedandropecaV2_impute_nested, added in 1.9.9, are removed without deprecation, because no package used them. In prolfquabenchmark they ranked last or next to last on all three peptide datasets (pAUC_5 by scaled p-value, CPTAC: 25.7 and 37.5, median of all methods 73.7): the peptides refit at the limit of detection weaken the median peptide statistic of truly changed proteins. Useropeca_nestedorropecaV2_nested; for proteins without observations in a group,lm_impute. The fix ofimpute_refit_singular()from 1.9.9 stays.
prolfqua 1.9.9
New features
- New methods
ropeca_impute_nestedandropecaV2_impute_nested: ROPECA and ROPECA V2 on peptide models fitted as inlm_impute. A peptide with a group without observations is refit at the limit of detection with a borrowed variance instead of being left out, so more peptides contribute and proteins whose peptides all miss a group get a result; such results haveestimate_type = "lod_imputed". V2 estimates the peptide correlation from the observed peptide models only.ropeca_nestedandropecaV2_nestedare unchanged. The factory figure andfacade_styles.tsvlist the 22 methods.
Bug fixes
-
impute_refit_singular(), and sobuild_model_impute(), always returns theimputedcolumn in the model table; before, it was missing when no fit needed a refit at the limit of detection.
prolfqua 1.9.8
New features
- New
ContrastsComparison: aligns the contrasts of several methods on protein and contrast, from facades or fromContrastsTables holding other tools’ results (theirContrastConfigurationnames the columns).$coverage()and$upset()show which pairs each method estimates;$conflicts()flags pairs where the methods contradict each other at an FDR threshold: significant in opposite directions, significant in one method but not in another that tested the pair, or significant in one and not estimated by another;$pairs()returns the pairs of one method with given columns defined. See the section “Comparing methods” of the vignetteModellingMethods.
prolfqua 1.9.7
Bug fixes
-
rlmno longer fails with “subscript out of bounds” when its robust weights leave a coefficient of a protein aliased (a regression in 1.9.6, found with the IonStar data of prolfquabenchmark). Contrasts oflm,rlmand the binomial methods are estimable when they lie in the row space of the weighted design the fit used; contrasts against observations the robust fit weights near zero are not estimable.
prolfqua 1.9.6
Behaviour changes
- Proteins with an empty group get exactly the contrasts they can estimate, equal to the differences of their observed group means, in every method. Before,
limmareported a wrong contrast when the empty group was the reference level (or cell) of the design, e.g. B − Ctrl under the name B − A, with its p-value, and lost the estimable one;limma_voomanddeqms_voomlost every contrast of a protein with any empty group. Subgroup models (~ subgroup) were affected for proteins absent from the alphabetically first subgroup. Contrasts a protein cannot estimate have no row inlimma,limma_voom,deqms_voom,lmanddeqms(deqms_voomand, ina * bmodels,lmanddeqmsreported NA rows) and are listed byget_missing(). The limma methods (limma,limma_voom,deqms_voom,limpaand the impute variants) now compute each protein’s contrast standard errors from its own observed, weighted samples;limma::contrasts.fit()approximated them for proteins with missing values or sample-varying weights (on simulated data 0.8 to 1.4 times the exact value), so their p-values change.lmanddeqmsina * bmodels with an empty cell now report the cell contrasts that do not need the empty cell (e.g. BZ − BX without AX), which they dropped before.
prolfqua 1.9.5
New features
-
inst/extdata/facade_styles.tsvlists every method ofbuild_contrast_analysis()with its family in the factory figure of the README (linear models, limma, limpa, LOD imputation, peptide level, detection, hurdle), the family’s colour, and a point shape and line type per method within the family, so plots comparing methods (as in prolfquabenchmark) style each method the same way. The factory figure is drawn from it. -
LFQDataPlotter$heatmap(row_order = )draws exactly the given features, in the given order and without row clustering, so two heatmaps of the same features can be compared row by row, e.g. before and after imputation (imputation changes the per-feature sd, so the most variable features and their clustering would differ).row_ordercannot be combined withn_most_variable; an unknown feature ID is an error that names it.
Behaviour changes
- prolfqua is label-free only: the isotope label is gone.
setup_analysis()no longer adds anisotopeLabelcolumn, sodata_long(), the wide rowdata and annotation,hierarchy_counts(),summarize_stats(), the missingness tables and every result table come without it, anddata_wide(as.matrix = TRUE)row names are the united hierarchy keys (P1, notP1~lfq~light). AnisotopeLabelcolumn in the input is an unconfigured column and is dropped; input with two labels per feature and sample fails as duplicate observations.hierarchy_counts()returns one row, also for empty input (counts of 0). - Removed without deprecation, because no package used them: the
AnalysisConfiguration$isotope_labelfield,LFQData$isotope_label(), and theisotope_labelargument ofhierarchy_counts()andsummarize_hierarchy()(passhierarchyandfactorsby name).list_to_analysis_configuration()still loads stored configurations that carry theisotope_labelkey and ignores it. - prolfqua now requires dplyr >= 1.1.1, ggplot2 >= 3.4.0 and purrr >= 1.0.0; earlier versions lacked functions and arguments prolfqua already used (joins pass
relationship =, added in dplyr 1.1.1). -
table_facade(kable = FALSE)returns the data frame instead ofNULL.table_facade()andplot_sample_correlation()(alsoLFQDataPlotter$sample_correlation()) name the Suggests package to install (knitr, corrplot) instead of failing with “there is no package called …”, and every help-page example runs without the Suggests packages. -
register_facade()refuses the names of built-in methods ("lm","limma", …). Before, registering such a name silently replaced the built-in entry, and the built-in facade then rejected valid input with an error naming the wrong class. Built-in facades check their input shape themselves instead of reading it from the registry. - Error messages state the problem in their first line (“
methodmust be one of …”, “Can’t find columnxindata.”) and name the function you called instead of prolfqua’s internal checker. Condition classes are unchanged; about 30 error and warning messages were reworded. A misspeltmethodlists the methods once and names the value given; before, the list appeared twice. - Joins inside prolfqua check that their lookup keys are unique: a duplicated subject, contrast or sample key in an input (for instance two rows for one protein and contrast passed to
merge_contrasts_results()) raises an error instead of silently multiplying rows. -
list_to_analysis_configuration()stops with a prolfqua error naming the keys that are not configuration fields (also method names such ashierarchy_keys); before, it failed with base R’s “cannot add bindings to a locked environment”. In the older nested format, keys of theparameterblock that are not fields (also method names such asset_response) are skipped, as other unknown keys there always were; before, a method name failed with “cannot change value of locked binding”. -
moderated_p_deqms_long()(used by the deqms methods) reports problems of its per-contrast variance fits as aprolfqua_fit_failedwarning, like the other fitting steps; before, the warning had no class. In the limma methods, limma’s warning about proteins without estimable coefficients is their “singular fits” (or “refit at the limit of detection”) entry in$provenance(), found from the coefficients, not from limma’s text; any other limma warning while fitting is aprolfqua_fit_failedwarning with limma’s text as the reason, where before it was a message hidden byprolfqua.verbose = FALSE. The variance moderation ofbinomial_firth_nestedandhurdle_nestedreports zero dispersions as a message instead of limma’s unclassed “Zero sample variances detected” warning (a warning of classprolfqua_fit_failedwhen more than half are zero); results are unchanged. - The
deqmsanddeqms_voommethods andContrastsModeratedDEqMSstop with aprolfqua_error_constant_countserror naming the count column when every protein has the same count, e.g. protein data without peptide counts, wherenr_childrenis 1; the variance-by-count trend cannot be fitted then. Before,get_contrasts()failed insidepredict.loess()with “NA/NaN/Inf in foreign function call”, or returned NaN p-values for every protein. - Plots: volcano, MA and score plots draw smaller, more transparent points, so dense regions stay readable;
ContrastsPlotter$barplot_threshold()fills bars with the colour-blind safe palette; score-plot reference lines are black and red regardless of the globalpalette().plot_pca()shapes the second factor with 19 distinguishable shapes and, when that factor has more levels, drops the shape mapping with a message; before, factors with more than 25 levels drew invalid shapes or no points. - Bad input fails where it enters, with a classed error (
prolfqua_error_bad_argumentunless noted), instead of giving wrong numbers or failing later:-
robscale(),robscale_subset()andget_scales()stop and name the samples without any measured value; before, one such sample made every scaled valueNA, without a warning. -
LFQData$new()without setup stops on missing key columns and on more than one row per sample and hierarchy key (prolfqua_error_duplicate_keys); before,get_Stats()counted the duplicates as replicates. -
build_contrast_analysis()and the facades check the contrasts when the analysis is built. A name that is neither a group (a factor key followed by a level) nor an earlier contrast (e.g. the typogrp_A), a contrast whose groups cancel (group_A - group_A), a constant, and anything other than+ - * /and parentheses (e.g. a function call) are errors. Before, a misspelt group was dropped with a warning and the analysis then failed with an unclassed error, and a contrast string could call any R function. - Single-valued arguments are checked: those of the simulators (
n_proteins,n_per_group,seed,with_missing, …),which_missing(),LFQData$new()(prefix,setup),setup_analysis(debug),null_split_check()(n_splits,n_features,seed), the sample-size methods (delta,power,sig.level,probs) and the strategies (model_name,trend,robust). Counts must be whole numbers. - List columns holding the response or a hierarchy, factor or sample column are refused.
-
lfqdata_from_wide()stops whenrowdatarepeats a hierarchy key or the value matrices have different row names; before, repeated keys failed later inLFQData$new()with a message about samples, and differing row names went unnoticed.
-
-
setup_analysis()keeps factor columns as factors, so their level order sets the reference level of the design and the order of the groups; an ordered factor becomes unordered and unused levels are dropped, both with a message. Before, factor columns became character labels in sorted order. Contrasts do not change; the coefficients of factor input are relative to its first level. -
LFQData$new()stores its data as a tibble, also for data.frame and data.table input, and stores the response as double, also when it is an integer. - Facade constructors name their arguments instead of taking
...: the limma and limpa methods taketrendandrobust, the iterative fits (rlm,rfit,rfit_impute,lmer_nested,binomial_nested,binomial_firth_nested,firth) takecontrol.build_contrast_analysis()passes its...to them, so an argument the method does not take is an error; before,firthandhurdle_nestedignored every further argument, includingcontrol. - A Suggests package a method needs (lme4 and lmerTest, logistf, Rfit) is checked once, before any protein is fitted; before, a missing package failed inside the fit of the first protein.
- The
firthmethod tests contrasts with the normal distribution (Wald z,df = Inf), as its coefficient table,confint()and logistf do; before, contrasts used t with n - p degrees of freedom. p-values are smaller, most with few samples; the test stays conservative at small sample sizes.binomial_firth_nestedandhurdle_nested, which moderate an estimated dispersion, keep their t tests. - The fit status of limpa analyses reports
not_convergedasNAinstead of 0: limpa returns no convergence status. - Informative messages name their operation: “Transformed response column added”, “filter_proteins_by_peptide_count: column added”, “write_boxplots: writing”, “write_pdf: writing”.
- Plots of data with expected missing values leave them out without ggplot2’s “Removed … rows” warning: the intensity density plot (
LFQDataPlotter$intensity_distribution_density()), the aggregation plots (AggregatorBase$plot(),plot_estimate(); lines still break at missing values), the plots ofLFQDataStats(violin(),density(),stdv_vs_mean(); sd and CV areNAfor features with fewer than two values) andmissingness_histogram(). - Log transforms (
LFQDataTransformer$log2(),$intensity_array()) of negative intensities give one warning of classprolfqua_negative_intensityandNaN; before, an unclassed warning was followed by R’s “NaNs produced”. -
LFQDataPlotter$na_heatmap()(more than 10,000 rows with missing values) andLFQDataPlotter$pairs_smooth()(more thanmaxsamples) show evenly spaced rows or samples instead of a random selection, so the plot is the same on every call.
Bug fixes
-
annotation_add_contrasts()handles designs with more contrasts than samples (e.g. 5 x 2 levels with interactions: 40 contrasts for 30 samples) by appendingNAsample rows that carry only a contrast, as it already padded the contrast columns for designs with fewer contrasts; before, it failed inbind_cols()with “Can’t recycle”. It stops with aprolfqua_error_bad_argumenterror when two combinations of factor levels get the same group name (a_b+canda+b_care botha_b_c); before, their samples were merged into one group. -
null_split_check()no longer addspseudo_group_to the configuration of theLFQDatapassed in; before, later calls on that object such asdata_wide()andget_Stats()$stats()failed. -
build_model_impute()stops with an error for input that is not aggregated (subject equals the hierarchy) and for strategies other thanstrategy_lm()andstrategy_rfit(). Before, peptide-level input was refitted with one placeholder row per missing sample, and mixed models failed with “$ operator not defined for this S4 class”. -
missingness_histogram()facets by thefactorsit is given; before, it summarised byfactorsbut faceted by all configured factors, and failed whenfactorswas a subset. -
table_factors_size()returns an ungrouped tibble when the design has two or more factors. -
summarize_stats_quantiles()(andLFQDataStats$stats_quantiles()) returnlongas an ungrouped tibble. -
summary_ropeca_median_p_scaled()stops with an error when thestatisticcolumn is missing; before, it filled the summary’sstatisticcolumn with the column name. - Hierarchy counts per sample (
HierarchyCountsSample,LFQDataSummariser$hierarchy_counts_sample()and its plot) work without annr_childrencolumn, counting every feature once, and stop with an error whennr_children > 1is requested without that column. -
LFQDataPlotter$pca_plotly()plots the principal components given inPC; before, it always plotted the first two. -
plot_heatmap_cor()colours by itscolorargument, spread from the lowest to the highest correlation (default white to red, as before); before,colorwas ignored. -
AggregatorBase$write_plots()(and the aggregators’write_plots()) uses itsshow.legendargument; before, the legend was never shown. -
linfct_matrix_contrasts()names an unnamed contrastcontrast_<i>; before, it dropped it with the warning “LHS of:=must be a string”. - Aggregation plots from
plot_estimate()andAggregatorBase$plot(), and boxplots fromLFQDataPlotter$boxplots(), no longer carry the whole data set:saveRDS()of one aggregation plot of 300 proteins writes 11 MB instead of 2 GB. -
null_split_check(n_splits = 2.5)stops with an error; before, it ran 98 splits. - The packaged IonStar peptides (
prolfqua_data("data_ionstar")) carry thenr_childrencolumn their configuration names, so they aggregate to proteins; before, aggregation stopped with “Columnnr_childrennot found”.
Performance
- The duplicate-key check run before modelling and aggregation (
build_model(),build_model_limma(), the facades and the aggregators), andprint()of anLFQData, count distinct keys by hashing instead of comparing rows; on precursor-level tables with millions of rows this takes a fraction of a second instead of seconds and no longer needs several GB of extra memory. -
write_plots()of the aggregators andLFQDataPlotter$write_boxplots()build and write one protein at a time, so their memory use no longer grows with the number of proteins (300 proteins: peak 0.33 GB instead of 0.84 GB). -
summarize_stats(), and with itget_Stats(), the heatmap feature selection and the limit of detection of the impute methods, computes all groups in one pass: 0.2 s instead of 10.5 s for 67,000 peptides in 12 samples. - Median-polish aggregation is about 4.5 times faster (2,000 proteins: 1.6 s instead of 7.4 s); rlm aggregation fits each protein in base R and is about 3.4 times faster than in the earlier development versions (2,000 proteins: 2.2 s instead of 7.5 s).
- Precursor-scale input (4.8 million rows) no longer makes a copy of the long table in the checks every analysis runs before fitting: the full-rank check of the design takes 0.04 s and no extra memory instead of 2.4 s and 1.4 GB, the check of the contrast groups needs 0.1 GB instead of 0.3 GB, and
nr_obs_sample()0.45 GB instead of 0.65 GB.LFQDataTransformer$robscale()scales in long format: 0.5 s and 0.25 GB instead of 3.9 s and 1.6 GB. Results are unchanged. -
LFQDataStats$power_fdr_pilot()pools the variances of all features at once: 0.1 s instead of 67 s for 100,000 peptides.Model$get_coefficients()binds the coefficients of all fits once and is about twice as fast (5,000 proteins: 1.6 s instead of 3.6 s). - Wald contrasts of the methods that fit one model per protein (lm, rlm, rfit, lm_impute, rfit_impute, deqms, ropeca) are computed once per protein instead of once per contrast row, and contrasts naming a group a protein lacks are skipped without raising and catching an error; the lm method on 5,000 proteins takes 4.9 s instead of 9.4 s.
Deprecated
- Renamed to snake_case:
lfqdata_to_summarized_experiment()(wasLFQDataToSummarizedExperiment()),lr_test()(LR_test()),lfq_power_t_test_quantiles()(lfq_power_t_test_quantiles_V2()),r6_extract_values()(R6_extract_values()),list_to_analysis_configuration()(list_to_AnalysisConfiguration()),list_to_contrast_configuration()(list_to_ContrastConfiguration()),summary_ropeca_median_p_scaled()(summary_ROPECA_median_p_scaled()), and the misspeltmissigness_histogram()andLFQDataPlotter$missigness_histogram()tomissingness_histogram(). The old names still work and warn; see?"prolfqua-deprecated". - Simulator arguments renamed:
Nprotton_proteins,Nton_per_group,PEPTIDEtopeptide,TWOtotwo_factorinsim_lfq_data(),sim_lfq_data_peptide_config(),sim_lfq_data_protein_config(),sim_lfq_data_2factor_config()andsim_build_models_lm(),_lmer(),_logistf(). The old arguments still work and warn. -
volcano_plotly()andmultigroup_volcano()take their data asdata;.data, which shadowed the tidy-eval pronoun, still works and warns. -
merge_contrasts_results(model_name = )is deprecated: it was never used, and the merged model keeps its name<prefer>_<add>. Passing it warns. - The 73 functions that were exported but documented only on internal help pages are deprecated and will be removed from the exports; prolfqua’s interface is
build_contrast_analysis(),LFQDatawith itsget_*()objects, and the model and contrast classes. Each still works, warns, and names its public route, e.g.summarize_stats():LFQData$get_Stats()$stats();plot_pca():LFQData$get_Plotter()$pca();estimate_intensity():LFQData$get_Aggregator("medpolish")$aggregate();compute_contrast(),linfct_from_model():build_contrast_analysis()andContrasts$get_linfct(). The full list, grouped by route, is in?"prolfqua-deprecated". This includeslfq_power_t_test_quantiles(),summary_ropeca_median_p_scaled()andmissingness_histogram(), the new names of three functions renamed above; their old names now point to the R6 methods as well. -
script_copy_helper_vec()andseparate_hierarchy()moved to prolfquapp;get_contrast()is deprecated without replacement (only prolfquatakeoutmissing used it, which has its own copy); formatrix_to_tibble()usetibble::as_tibble(x, rownames = ). -
LFQDataPlotter$heatmap(top_n = )is renamedn_most_variable, since it keeps the features with the largest sd (or CV);top_nstill works and warns.
Removed
- The example dataset
x5463yzwer453bbb(an annotation table of 36 samples). Theannotation_add_contrasts()example and the article “Contrasts from factors” build their annotation table withexpand.grid(). - The old test script in
inst/issue71is no longer installed.
Documentation
-
?ContrastsFacadeBaseis a public help page: how a facade for a new modelling backend is written and registered withregister_facade(), with a working example. - The reference index of the pkgdown site groups the help pages by topic. The article “Under the hood” explains how contrast strings become weights on the model coefficients with
Contrasts$get_linfct(), and the imputation vignette draws its before and after heatmaps withLFQDataPlotter$heatmap(row_order = ). - Help pages render Markdown, so code and links that showed as literal backticks or brackets now format; every exported function documents its return value; titles are in sentence case and
lfqdataarguments share one description. - Every argument of the exported functions is documented, and the
sim_build_models_logistf()example checks the fitted models instead of a field that does not exist. -
?prolfquahas a section “Input types and conversion”: which table classes are accepted, and how the response, factor and hierarchy columns are converted.?AggregateLimpadocuments the defaults of limpa’s iterative steps and why they are not exposed;?ContrastsFirthFacadedocuments its Wald z test. The help pages of the simulators,LFQData$new(),null_split_check()and the sample-size methods state the type and length of each argument. - The maintainer is Witold Wolski, the copyright holder the University of Zurich; Christian Panse and Jonas Grossmann are listed as contributors. prolfqua follows the rOpenSci Code of Conduct.
-
?prolfquahas a Resources section: memory per row, run time per protein for the matrix and per-subject backends, retained fitted models, and the cost ofnull_split_check().LFQData$get_config()says it returns the configuration of the object itself, not a copy, and the ignoredallargument (kept for theContrastsInterfacesignature) andglobalargument (kept for compatibility withContrasts$get_linfct()) say so. -
?build_model_limma_voomderives the vooma precision weights and the external weights (peptide counts per protein and sample), and states when the fit equalslimma::vooma()followed bylimma::lmFit(). -
ropeca_nestedis documented as a derivation of PECA and ROPECA:?ContrastsROPECANestedFacadelists what differs (no ROTS step, any design, at most 10 peptides in the beta correction) and compares it with PECA on the IonStar data: the same fold changes, and the same p-values for proteins with an odd number of peptides up to 10. The script isdata-raw/compare_peca.R. - Every public help page has a description, and the return values of the contrast generators,
merge_contrasts_results(),pivot_model_contrasts_to_wide(),volcano_plotly()and 15 other functions say what they return. The contrast generator examples and the article “Contrasts from factors” use neutral level names (genotype WT, KO). - The README is built from
README.Rmd, so its examples run; it has a statement of need, a list of related packages and the same install command as the vignettes. The vignette “Importing your data” points to the prolfquapp readers for DIA-NN, MaxQuant, Spectronaut and FragPipe output, showslfqdata_from_wide(), and its text matches its code. The reading lists include “Transforming and calibrating LFQ data”. - Vignettes no longer hide warnings. The remaining ones are fits that fail for single proteins (for example
lmer_nestedon proteins with one peptide); the vignettes explain them and show the record in$provenance(). - Corrected help texts: the medpolish
epsis a relative change of the sum of absolute residuals;?prolfqua_analysis_methodssays where each backend keepsconvergedanditerations. - The run times in
?prolfqua(Resources) and?build_contrast_analysisare measured again on this version, and the Resources section adds aggregation and the QC writers. - The GitHub install instructions in the README and the introduction vignette install the remotes package, which
BiocManager::install("fgcz/prolfqua")needs; before, they failed on an R installation without remotes. The README also says how to check the R version, what to do when prolfqua is not available for the installed Bioconductor version, and that the GitHub version is ahead of the Bioconductor release.
prolfqua 1.9.4
New features
plot_heatmap_cor(),plot_sample_correlation()and the plotter’s$heatmap_cor()and$sample_correlation()takemethod: astats::cor()method ("pearson","spearman","kendall") or a function returning a sample correlation matrix.predict()on fitted analyses returns predictions for any combination of subject and group (default: every subject in every input sample, including samples with missing responses), on the fitting scale. Groups absent from a subject’s fit are predicted from the limit-of-detection refit of the_imputemethods and areNAotherwise; ROPECA predicts per peptide, mixed models at population level, detection models as probabilities, and hurdle analyses per component.LFQDataprints a summary (samples, response and whether it is transformed, hierarchy counts, samples per factor level, response range, missing responses, provenance), andplot()on anLFQDatashows the response distribution per sample.digitscontrols the significant digits of numbers printed byprint()ofLFQData, of fitted analyses and of theirsummary()(default 3), and ofcontrast_summary_table(digits = ).Convergence controls:
strategy_rlm(),strategy_lmer(),strategy_binomial(),strategy_binomial_firth(),strategy_logistf(),strategy_rfit(), themedpolishandrlmaggregators (get_Aggregator(method, control = )) andestimate_intensity()take acontrollist (iteration limit, tolerance), whichbuild_contrast_analysis(..., control = )passes on, also forfirth. Defaults are unchanged and documented with their reasons; unknown names raiseprolfqua_error_bad_argument.Convergence statistics: model tables keep
convergedanditerationsper subject (rlm, glm and Firth, lmer, logistf;NAwhere the backend keeps no status), the fit status ofprint()andsummary()countsnot_converged, and a fit that stops at its iteration limit without a backend warning is recorded in$provenance().Provenance:
LFQData, models and analyses record problems and dropped items, read with$provenance(): values set toNA, removed rows, features and proteins, aggregation warnings, failed, warned, singular and LOD-refit fits, missing responses dropped per fit, and subjects absent from the contrasts with the reason. Each step reports its new entries in one message (failures: one warning);print()andsummary()of an analysis show a one-line summary.null_split_check()checks the calibration of normalization and model together: it splits the samples within each group at random into two pseudo-groups, tests them against each other with anybuild_contrast_analysis()method, and returns per split the share of p < 0.05 and p < 0.01, the number of FDR < 0.05 hits and the Kolmogorov-Smirnov distance from uniform, with the sample assignment and the contrasts. No feature differs between pseudo-groups, so a calibrated pipeline gives about 5% of p < 0.05 and no FDR hits.summarize_variance_explained()fits a least-squares model per feature of a log-transformedLFQData(default: the full factorial of its factors) and returns each term’s share of the feature’s variance (eta²) and the model R².pooled_variance_explained()pools the sums of squares over features; on complete features its R² equals the Euclidean PERMANOVA R². Use them to check that a normalization lowers within-group variance more than overall variance.LFQDataTransformer$subtract_sample_offsets()applies caller-supplied log2 offsets by sample ID and stores the adjusted intensities in a new response column.The Transforming and calibrating LFQ data vignette shows how to use the active response, internal reference proteins and offsets from external calibrants.
plot()now defaults to observed responses and fitted group means with confidence intervals for up to six subjects selected by FDR. Select subjects withsubjectand confidence level withlevel; volcano and MA plots remain available throughtype. Combined hurdle analyses retain the volcano default and expose fitted plots through their intensity and detection components.vcov()on fitted analyses returns coefficient covariances in a subject-keyed table, using borrowed uncertainty for LOD refits and moderated per-subject covariances for matrix models.fdr_sig_level()converts a target FDR, null-feature proportion and power into a per-test threshold for the existing protein and SD-quantile sample-size methods.power_fdr_prior_n()andLFQDataStats$power_fdr_pilot()plan balanced two-group sample sizes by averaging power over a pilot variance prior and a specified effect distribution. The QC and Sample Size Estimation vignette demonstrates both approaches.Fitted analyses support
print()(model overview without computing contrasts),summary()(fit status and significance counts per contrast),coef(),confint()(Wald intervals),formula(),nobs(),fitted()andresiduals()(with sample identifiers and imputation flags, on the fitted scale) andplot()(group means with intervals, volcano or MA plot). All registered backends are tested against this result contract; the Modelling methods vignette shows the methods.Fitted analyses retain an independent input snapshot. Matrix models retain their response matrix, weights and observed-response mask, and LOD-refitted models identify imputed rows for result inspection.
New method
ropecaV2_nested(ContrastsROPECAV2NestedFacade,ContrastsROPECAV2): ROPECA with calibrated protein p-values. It converts the moderated peptide t-statistics to normal scores and tests their median per protein against its exact null distribution, allowing for the peptide correlation estimated from the peptide model residuals.ropeca_nested, unchanged, is conservative for independent peptides and too significant for proteins with many correlated peptides. Share of p < 0.05 for unchanged proteins (prolfquabenchmark vignetteBenchmark_ropeca): 0.050 to 0.067 on simulated data and 0.041 to 0.053 on IonStar, against 0.037 to 0.082 and 0.018 to 0.000 forropeca_nested.diffis the median peptide fold change;statistic,std.errorand the 95% interval follow from the p-value.New option
prolfqua.verbose: setoptions(prolfqua.verbose = FALSE)to silence prolfqua’s informative messages (columns added, rows removed, files written). The messages carry classprolfqua_message, so applications can route them to their own log. Both options are described in?prolfqua.
Behaviour changes
LFQDataStats$power_t_test(),$power_t_test_quantiles()and$power_fdr_pilot()raise aprolfqua_error_bad_argumenterror on untransformed data. Before, they warned “…; aborting.” and returnedNULL, which a pipeline could pass on unnoticed.All ggplot figures have a new default look in the style of GraphPad Prism: white background, black axis lines with outward ticks, bold axis titles, bold facet labels on a light grey strip. Volcano, MA, score, fitted-value, PCA, density and SD-versus-mean plots keep faint gridlines; histograms, bar charts, boxplots and violins have none. Violins have a thinner outline (
linewidth = 0.3). Add any ggplot2 theme to override, or add the newtheme_prolfqua()to your own ggplots to match.setup_analysis()announces each transformation it applies with aprolfqua_message: source columns united into one key, non-character factor columns converted to character labels, unconfigured columns dropped, and rows with NA response added for absent feature and sample combinations. Its help lists every step and how to avoid it.build_contrast_analysis()checks before fitting that the fixed-effect design is of full rank across samples (aliased factors, empty interaction cells) and stops withprolfqua_error_collinear_designnaming the aliased coefficients; such designs used to fail later with unrelated errors.Fitting and aggregation reject data with more than one row per sample and hierarchy key (
prolfqua_error_duplicate_keys), also when theLFQDatawas created withoutsetup_analysis().LFQData$new()drops extra classes and attributes (e.g.I(), units, labels) from the response column with a message; transformations and models use the plain numeric values.Colour-blind safe default colours: abundance heatmaps use blue-white-red instead of green-black-red, factor levels in heatmap annotations and PCA use Okabe-Ito (viridis beyond 8 levels) instead of the ggplot2 hue palette, estimate types in volcano, MA and score plots use black, orange and blue instead of black, green and blue, and zero lines are grey instead of green.
Larger default text:
multigroup_volcano()labels default tosize = 3(was 1);plot_sample_correlation()uses the corrplot text sizes and passes...(e.g.tl.cex,number.cex) tocorrplot::corrplot.mixed().?prolfquaand?LFQDatastate how violated assumptions affect estimates: outliers pull least-squares fits whilerlmandrfitresist them, and missing low intensities shrink fold changes of down-regulated proteins toward zero, also with LOD imputation.Analysis help and the Modelling methods vignette document internal aggregation, detection encoding, retained responses and output scales, including which steps have no inverse.
The package help now defines the API lifecycle, analysis terminology and statistical terms. The Under the hood article explains categorical formula coding and contrast weights, and the analysis help documents measured runtime scaling.
Invalid analysis, simulation, response, contrast and count inputs now fail at the entry point with a classed error. Method keys must match exactly (case sensitive). A misspelled limma weights column is an error rather than an unweighted fit. Subset scaling rejects mismatched transformation states.
Fewer hard dependencies (Imports: 23 to 12): ‘UpSetR’, ‘ComplexHeatmap’, ‘circlize’, ‘plotly’, ‘ggbeeswarm’, ‘progress’, ‘logistf’, ‘lme4’ and ‘lmerTest’ moved to Suggests; ‘forcats’ and ‘tidyselect’ are no longer needed. Functions that need a suggested package ask to install it; without ‘plotly’, ‘ggbeeswarm’ or ‘progress’ the density plot is static, box plots show jittered points and no progress bar is shown. Progress of aggregation and plot writing follows
options(prolfqua.progress).prolfqua no longer prints internal progress messages such as “setup done”, “completing cases”, “contrasts_linfct”, “starting aggregation”, the model formula or the number of rows with missing values.
All errors are raised with
rlang::abort()and carry classprolfqua_error; invalid arguments also carryprolfqua_error_bad_argument, so callers can catch prolfqua errors by class. Missing optional packages (limpa,Rfit) are reported withrlang::check_installed(), which offers to install them in interactive sessions.lm_impute,rfit_impute,limma_impute,limma_voom_impute: the limit-of-detection refit no longer warns “essentially perfect fit” or “non-finite value supplied by optim”, and thelimmavariants no longer warn “Partial NA coefficients” for the proteins they then refit. Results are unchanged.Missing and non-finite values: log transforms turn zero intensities into
NAwith a message instead of-Infwith a warning. Fitting and aggregation stop with classed errors onInf,-InforNaNintensities (prolfqua_error_nonfinite_response), onNAin hierarchy, factor or sample columns (prolfqua_error_missing_key) and on inputs without rows, where before the protein vanished from the contrasts behind a warning.which_missing()rejects input containingNA. See?prolfquaand the Modelling methods vignette.Zero residual variance: a subject with a constant or noiseless response (e.g. all intensities equal, or identical within each group) keeps its
diff, but its standard error, statistic, p-value and confidence limits areNA, with oneprolfqua_zero_variancewarning per contrast table. Before, these tests divided floating-point noise by noise (an rlm p-value of 1e-17 for a constant protein), and the near-zero variances shrank the moderation prior of all other proteins. Applies to lm, rlm, rfit, lmer and the limma and DEqMS methods; detection models keep their dispersion floor.rlmon a constant or noiseless subject returns the least-squares estimates with robust scale 0 instead of iteratingMASS::rlm(), whose scale could underflow to zero and turn the estimatesNAon Linux and Windows.Failed fits and warnings while fitting or aggregating (e.g. non-converging
rlm,lmer, Firth ormedpolish) are reported once per step as oneprolfqua_fit_failedwarning naming subjects and reasons, instead of one warning per protein; lmer contrast warnings join the singlecontrasts_linfctwarning, and limma’s “Partial NA coefficients” warning becomes a “singular fits” provenance entry.transform_work_intensity()returns the rows whose zeros becameNA(zeros) andestimate_intensity()the per-subject warnings (failures) instead of signalling them.sim_lfq_data_2factor_config()no longer warns “Unknown or uninitialised column:nrPeptides”.README: the getting-started example called the removed aggregator method
$medpolish()and the undeclared packageggpubr; it now runs as shown and ends withbuild_contrast_analysis(). Installation is from Bioconductor first.
Bug fixes
adjust_p_values(),summarize_hierarchy(),missingness_per_condition(),missingness_per_condition_cumsum(),HierarchyCountsSampleand thesummarytables ofContrastsPlotter$barplot_threshold()return ungrouped tibbles. Before, they kept the grouping used inside, so a latermutate()orsummarise()on the result ran per group without asking for it.LFQData$get_subset()errors whenxhas none of the subject-id columns. Before, it joined on no columns and returned the whole dataset.A data column named
thresholdorNno longer replaces the argument of the same name inremove_small_intensities(),filter_proteins_by_peptide_count()and top-N aggregation; the same holds forlimitinLFQDataPlotter$pairs_smooth().Plots:
ContrastsPlotter$histogram_diff()marks each contrast’s own median (before: the median over all contrasts, drawn once per row); volcano, MA and score plots accept a colour column with more than 4 levels (before: “Insufficient values in manual scale”) andmultigroup_volcano()accepts significance column names that are not syntactic, such asadj p;plot_stat_violin_median()shows median and quartiles as one point range (before: three unlabelled points per group); beeswarm points inplot_hierarchies_boxplot()are 1 to 4 mm (before: the child count in mm).medpolishandrlmaggregation no longer report “Responsemedpolish: dropped attributes names” (orlmrob): the estimates are returned as plain numeric values.rlmaggregation (get_Aggregator("rlm")) removed estimable design columns when a sample or peptide column was a factor with an unused level, and then silently used per-sample means for that protein. It now drops unused levels and removes only aliased columns. Data set up withsetup_analysis()(character columns) is not affected.LFQDataPlotter$write_pdf()and$write_boxplots()no longer append.pdfto a file name that already ends in.pdf.get_complete_model_fit(), and with itModel$get_anova(),Model$get_coefficients()and the coefficient and ANOVA plots, now leaves out fits with fewer coefficients than the full design, for example a protein with one group entirely missing. Before, every fit counted as complete, so these tables also listed such proteins, whose coefficients referred to another reference level. Limit-of-detection imputation is unchanged.moderated_p_limma(): when all variances are equal, one missing residual df no longer makes the prior df, and with it every moderated p-value,NA; the fallback prior df counts only rows with a variance.sim_lfq_data_peptide_config(),sim_lfq_data_protein_config()andsim_lfq_data_2factor_config()withwith_missing = FALSEreturn complete data with positive peptide counts; before, intensities chosen as missing were kept with a peptide count of 0, which gave them fitting weight 0.The introductory and Modelling methods vignettes no longer fail when
R CMD check --no-build-vignettesruns their code: the factory figure is left out of the extracted R code. The Transforming and calibrating LFQ data vignette ends with session information.Coefficient tables for LOD-refitted proteins use their borrowed covariance and degrees of freedom. Robust and rank-based models expose consistent coefficient and p-value columns, restoring their coefficient volcano plots. Firth coefficient tables skip failed fits.
Printing fitted analyses extracts coefficients from only the first few subject fits for its preview. Limma summaries correctly count failed fits and report singularity as unknown (
NA) instead of inferring it from failed fits.ANOVA extractors again accept the supported
LRT,RaoandCptests, with correct p-value column metadata. Direct construction validates the same choices asget_anova_df(). Analysis, aggregation and ANOVA selectors reject multi-value arguments instead of silently choosing the first value.Condition tests cover all-zero contrasts; covariance-borrowing documentation now describes selection of the largest matching donor subset, and its unreachable error and rescue-skipping branch have been removed.
The core R6 dependency is now declared explicitly, so subclass-based tests pass dependency checks in fresh environments.
deqms/deqms_voom(moderated_p_deqms()): proteins left out of the variance-on-count curve, e.g. with zero residual variance, got the prior variance of the first fitted protein instead of the curve’s value at their own peptide count, with the warning “‘newdata’ had 1 row but variables found have N rows”. They now get the curve’s value. Proteins without residual degrees of freedom get NA moderated statistics without “NaNs produced” warnings; the same holds for the unmoderated statistics oflimma-based methods.ropeca_nested/ContrastsROPECA: the protein p-value counted peptides without a p-value (failed or non-estimable peptide fits) in the number of peptides, which made those proteins too significant, e.g. p = 0.00067 instead of 0.0031 for two tested peptides and one untested.summary_ROPECA_median_p_scaled()now counts only peptides with a p-value inn_not_na, as the original ROPECA (PECA) does;dfofropeca_nestedchanges with it.
prolfqua 1.9.3
Behaviour changes
- The Firth backend fits one model per protein:
build_model_logistf()requires aggregated data, one row per protein and sample, and stops on peptide-level input.ModelFirth$modelsis themodel_analyse()result (model_df,strategy) instead of a list ofmodels1,models2andhkey, andContrastsFirth$get_linfct()returns that one container.sim_build_models_logistf()loses itspeptideargument.firthresults do not change. -
ContrastsFirth$get_contrasts()no longer prints the debug messages “determine linear functions:” and “get_contrasts -> contrasts_linfct”.
Removed
- The
firth_nestedmethod (ContrastsFirthNestedFacade,build_model_glm_peptide()). It fitted one 0/1 row per peptide and sample, so its detection p-values became more significant the more peptides a protein had: on the IonStar benchmark, the share of unchanged human proteins with p < 0.05 rose from 1.3% (2-3 peptides) to 7.7% (more than 20). Usebinomial_firth_nested, which applies the same Firth bias reduction to the detected-peptide counts per protein and sample and takes its degrees of freedom from the samples.ContrastsHurdleFacadeacceptsbinomial_nestedorbinomial_firth_nestedas the detection component.
prolfqua 1.9.2
New features
- New
lfqdata_from_wide(), the inverse oftidy_to_wide_config(): one or more feature x sample matrices, their row annotation and their sample annotation back to anLFQData. It replaces the matrix-to-long conversions that downstream packages write by hand for AnnData and SummarizedExperiment input. -
LFQDataTransformer$intensity_array()takestransformed;intensity_array(exp, force = TRUE, transformed = FALSE)marks a back-transformation as untransformed, so callers no longer resetis_transformed(FALSE)afterwards. - New
LFQData$is_aggregatable(): whether there is a hierarchy level below the modelled one to aggregate from. -
ContrastsFacadeBase$get_missing()uses the contrast column named in the facade’sContrastConfiguration(contrast_col) instead of assumingcontrast, so facades of other packages with their own column name (e.g. SAINT’sBait) can inherit it.
Behaviour changes
- Breaking: a
ContrastsPlotterhistogram spec takes the bin boundaries asbreaks, e.g.list(score = "FDR", breaks = seq(0, 1, by = 0.05)), passed toggplot2::geom_histogram(). The oldxlim = c(0, 1, 0.05)was not an axis range but a (from, to, by) triple; a spec without numericbreaksnow stops withprolfqua_error_bad_argument. - Requires tidyr >= 1.3.0: identifier splitting uses
tidyr::separate_wider_delim()instead of the supersededseparate(). Results are unchanged;separate_hierarchy(),get_uniprot_id_from_fasta_header()and the contrast-side parser no longer warn about identifiers with too few or too many pieces. - The model strategies (
strategy_lm()and the otherStrategy*classes),Model,ModelFirthandContrastsFirthcheck their arguments when constructed and stop withprolfqua_error_bad_argumentorprolfqua_error_missing_column: a strategy needs a formula,Modela model table with the subject columns and a strategy,ModelFirththe elementsmodels1,models2andhkey,ContrastsFirthaModelFirthand named contrasts. Before, a malformed argument failed later with an unrelated error. -
setup_analysis()reports a missingisotopeLabelorqValuecolumn with a message instead of a warning; both are optional and get the defaults"light"and0. A missingnr_childrencolumn still warns, because the default of 1 changes the fitting weights of aggregated data.
Bug fixes
-
LFQDataToSummarizedExperiment()stops with an install hint when SummarizedExperiment or S4Vectors is missing; before, it returnedNULLsilently. -
Contrasts$get_contrasts()no longer prints the debug lines “determine linear functions:” and “get_contrasts -> contrasts_linfct”. -
firthandfirth_nestedwork when the protein key is not calledprotein_Id:build_model_logistf()passed no subject id toModelFirth, so the contrasts looked for aprotein_Idcolumn and failed. - Building a contrast analysis (
build_contrast_analysis()and the facade classes) stops withprolfqua_error_bad_argumentwhen a contrast names a group without samples, e.g.group_Aafter all its runs were filtered out. The message names the contrast, the empty group and the groups with samples; before, the analysis went ahead and failed later or returned no estimates for that contrast. -
LFQDataPlotter$write_pdf()no longer closes the graphics devices the user has open (it calledgraphics.off()before and after writing).write_pdf(),write_boxplots(),LFQDataAggregator$write_plots()andLR_test(path = )close their PDF device when drawing fails, instead of leaving it open so that later plots go into it.write_boxplots()returns the file path invisibly.
prolfqua 1.9.1
New features
-
LFQData$remove_contaminants()returns a copy without contaminant proteins, usingconfig$pattern_contaminantsand the built-in prefixes ofis_contaminant(), asremove_decoys()does for decoys. -
LFQData$get_Aggregator(method = "limpa")returns anAggregateLimpa, which was not reachable throughget_Aggregator()before. -
tidy_to_wide_config()takesrow_keys, the columns that identify a row of the wide table; the default is still the hierarchy keys plus the isotope label. Keys that do not identify one value per sample are an error. -
ContrastsTable$new()takes an optionalconfig, theContrastConfigurationof the stored results. -
get_contrasts()takesallin every contrast class:ContrastsROPECANestedFacade$get_contrasts(all = TRUE)appends the remaining ROPECA columns to the standard ones;ContrastsHurdleFacadeaccepts it and always returns every column.
Behaviour changes
- Breaking for packages that register their own facades: the
needsvalue"same"is renamed to"aggregated", solookup_facade()reports"aggregated"or"nested", andregister_facade()rejects any other value withprolfqua_error_bad_argument. Before, any string was accepted and every value other than"nested"was treated as aggregated input. -
LFQData$filter_proteins_by_peptide_count()takes optionalthreshold,parentandchildarguments; the defaults areconfig$min_peptides_proteinand the first two hierarchy keys. It now counts the second hierarchy level within the first whatever thehierarchy_depth: peptide-level configurations are filtered (before, the call did nothing), and three-level hierarchies modelled at depth 2 count peptides per protein instead of precursors per peptide. A hierarchy with a single level is an error (prolfqua_error_bad_argument) instead of a warning. -
nr_features_experiment()writes its count tonr_features_expby default instead ofnr_child_exp, the column ofnr_children_experiment(), so the two counts can be joined. -
LFQData$rename_response()stops withprolfqua_error_bad_argumentwhen the new name is another existing column; before, it printed a message and left the data unchanged. Renaming to the current response name does nothing.rename_response()and theis_transformed(value)setter return theLFQDatainvisibly, so they can be chained.
Documentation
- The functions that count hierarchy entries (
hierarchy_counts(),summarize_hierarchy(),HierarchyCountsSample,nr_obs_sample(),nr_children_experiment(),nr_features_experiment()) link to each other as the “hierarchy counting” family, and each states whether it counts per sample or per experiment, and observed values only or all entries.nr_obs_sample()has a title that says what it computes.
prolfqua 1.9.0
Changes for the Bioconductor review (BiocContributions #171).
New features
- New method
binomial_firth_nested(ContrastsBinomialFirthNestedFacade,strategy_binomial_firth()): thebinomial_nesteddetection-count model with Firth’s bias reduction in place of the fixed pseudo-count. Likebinomial_nested, it sums peptide detections per protein and sample, so its dispersion and degrees of freedom come from the samples; unlikefirth_nested, its p-values therefore do not grow more significant with the number of peptides. Log odds ratios stay finite for proteins detected in one group only. - New method
hurdle_nested(ContrastsHurdleNestedFacade): a hurdle model from peptide-level input in one call,build_contrast_analysis(method = "hurdle_nested"). It aggregates to protein level with median polish, fitslm_imputeto the protein intensities andbinomial_firth_nestedto the peptide detection, and combines them withContrastsHurdleFacade. Being in the registry, it is also available to prolfquapp as a model. -
ContrastsHurdleFacade$new(intensity, detection)combines a fitted intensity facade (lm,lm_impute, …) with a fittedfirth_nested,binomial_nestedorbinomial_firth_nesteddetection facade, as msqrob2’s hurdle model does:p.valueis Fisher’s combination of the two component p-values, andFDRits BH adjustment within contrast. Proteins only one component estimates keep that component’s p-value; fully detected proteins keep their intensity p-value. The component p-values, the detection log odds ratio and the combined statistic are extra columns. No model is fitted.
Bug fixes
-
citation("prolfqua")works again:inst/CITATIONcontained a non-ASCII dash thatutils::readCitationFile()could not read.
Documentation
- New introductory vignette
vignette("prolfqua"): the prolfqua hex logo, links to all tutorials on the package website, an introduction centred onbuild_contrast_analysis()with a figure of it as a factory rolling out all modelling methods, installation with BiocManager, and a quick start usinglm_impute. - The README and the vignette
ModellingMethodsshow the factory figure too; the README links the eight vignettes in reading order, starting with the introduction. -
?build_contrast_analysisdescribes the function as the factory of the modelling methods and lists all 20 built-in methods by family, includingbinomial_firth_nestedandhurdle_nested, which were missing. - The package description names
build_contrast_analysis()and the modelling methods it offers. - New vignette
vignette("ModellingMethods"): runs everybuild_contrast_analysis()method on one small simulated dataset, with one summary line per method; it renders in a few seconds. - The package ships eight vignettes, numbered in reading order:
prolfqua,CreatingConfigurations,Comparing2Groups,ModellingMethods,TwoFactorDesigns,ContrastsFromFactors,ModelBasedImputationandQualityControlAndSampleSizeEstimation; together they build in about 25 seconds. Three more articles (ComparingMethods,SimulateData,LowLevelAPI) are on the website only, https://fgcz.github.io/prolfqua/articles/; all keep their URLs. - The vignettes and articles use
build_contrast_analysis()throughout.Comparing2Groupsand “Simulate Peptide level Data” fit their contrasts withlm_impute(proteins) andlm(peptides) in one call instead of building models and contrasts by hand. - The articles “Limma Backend”, “DEqMS-style Count-Dependent Variance Moderation”, “Modelling dataset with two Factors” and “Using limpa Directly” are removed:
ModellingMethodsand the articles “Comparing modelling methods on one dataset” and “Two-factor designs” cover their methods throughbuild_contrast_analysis(). - The imputation article is rewritten and renamed “Filling the gaps: model-based imputation for heatmaps and PCA”: why heatmaps and PCA need a complete matrix, why proteins missing in a whole group matter (below the LOD or switched off), how
impute_from_model()fills the matrix from thelm_imputemodels and the LOD, heatmaps and PCA before and after imputation, and the caveats. It moved toarticles/ModelBasedImputation.html; the oldTestingMissingInference.htmllink redirects there. - Articles renamed so that file names say what they cover:
ContrastFacadesis nowComparingMethods(“Comparing modelling methods on one dataset”),ContrastFacade2FactorisTwoFactorDesigns(“Two-factor designs”),Contrasts_from_factorsisContrastsFromFactors.CreatingConfigurationsis titled “Importing your data: AnalysisConfiguration”. The old URLs redirect to the new ones. - New article “Under the hood: strategy, model and contrasts”: the
lmmethod built step by step (strategy_lm(),build_model(),Contrasts,ContrastsModerated), giving the same result asbuild_contrast_analysis(), with model inspection, unmoderated contrasts andregister_facade(). -
Comparing2Groupsdescribes the simulated data it actually uses (the text still referred to MaxQuant Ionstar data) and no longer looks up protein IDs that do not exist in it. Both vignettes use BiocStyle. - The vignettes cite the published article (Wolski et al., J. Proteome Res. 2023, 22(4), 1092-1104, doi:10.1021/acs.jproteome.2c00441) instead of the 2022 bioRxiv preprint.
citation("prolfqua")lists the journal, volume, issue and pages in their own fields, and the README BibTeX no longer swaps volume and issue. -
?prolfquaopens a package overview page. - Typos fixed across the help pages, vignettes and README.
Behaviour changes
- prolfqua requires R 4.6 or later (was R 4.5.0), matching the Bioconductor release it targets.
-
script_copy_helper_vec()gains anoverwriteargument (defaultTRUE, as before). -
summary_ROPECA_median_p.scaled()is renamed tosummary_ROPECA_median_p_scaled()(Bioconductor function names must not contain.). There is no alias.
Removed
- Datasets
data_spectronautDIA250_A,data_skylinePRMSample_Aanddata_skylineSRM_HL_A; their examples use simulated data now.data_IonstarProtein_subsetNormanddata_SAINTe_outputmove to prolfquasaint,data_benchmarkExampleanddata_test_confusion_matrix_scoresto prolfquabenchmark (prolfqua_data(<name>, package = <package>)). The unused ExperimentHub manifestinst/extdata/metadata.csvis gone.inst/script/README.mddocuments the four datasets that remain. - The
lm_missingmethod (ContrastsLMMissingFacade) andContrastsMissing(group-mean substitution with a pooled-variance t-test).MissingHelperskeepsget_stats()andget_lod(); its imputation and contrast methods and theweightedargument are gone. All of it lives on in the new package prolfquatakeoutmissing: loading it registersmethod = "lm_missing"again. In prolfqua, uselm_impute, which refits the proteins plainlmcannot estimate with LOD-imputed values.
prolfqua 1.8.0
This release removes about 3,600 lines (20%) of dead or duplicated code from R/. Everything removed had no callers in prolfqua or in the downstream packages (prolfquapp, prophosqua, prolfquappPTMreaders, prolfquasaint, prolfquabenchmark, ptm-pipeline).
Bug fixes
-
filter_proteins_by_peptide_count()andnr_B_in_A()are back, internal: thefiltered()method of the saveddata_ionstardataset calls the filter, so its removal broke every caller of that dataset, prolfquapp’s QC vignette among them.nr_B_in_A(pdata, level_a, level_b)only counts the children of each parent; the filter,LFQData$filter_proteins_by_peptide_count()andnr_features_experiment()count through it instead of each repeating the count. -
sigma()forMASS::rlmfits took the square root twice. Therlmmethod’s contrastsigmaand all moderated statistics derived from it (std.error,statistic,df,p.value,FDR, confidence intervals) change; fold changes do not. On simulated data the moderated df drops from about 8,000 to about 25. -
moderated_p_limma(variance_floor = )withrobust = FALSEreturned NA moderated p-values for rows above the floor, because the scalar prior df was padded with NA when the floored rows were set toInf. This is the default path of thebinomial_nestedfacade (binomial_bound = TRUE). Rows above the floor now keep the estimated prior df. -
merge_contrasts_results(): when both inputs share a model name,modelNameis now<name>_prefer/<name>_addinstead of NA for every row. -
setup_analysis()no longer fails whensample_nameandfile_nameare the same column.
Behaviour changes
-
options(prolfqua.vectorize)is removed; contrasts always use the per-row path, which was already the default. Setting the option has no effect. -
ContrastsFirth: proteins whose contrast fails are reported with thecontrasts_linfct()warning listing the dropped protein IDs, instead of a message. -
ContrastsInterfaceprovides defaultget_Plotter()andto_wide()methods, so subclasses no longer need to implement them. -
estimate_intensity()takesmethod = "medpolish"or"rlm"instead of a function in.func. - A facade’s
configfield is filled on the firstget_config()call; useget_config()rather than reading$config. -
center_to_reference_cfg()always returns a median-centred copy (summaryandcopyremoved).scale_with_subset()gainscolnameand loses the unusedget_scales. -
plot_stat_violin_median()checksstatwithmatch.arg(), so the defaultstatnow works (it used “CV” only when given explicitly). -
get_p_values_pbeta()returns NA for an NAn.obsinstead of stopping. -
script_copy_helper_vec()reports the source path it actually copies from and warns once for a missing file;find_package_file()returnsNULLinvisibly when the file is not found. - Class vectors of strategies and aggregators include
StrategyBaseandAggregatorBase.
Removed
- Exported functions:
contrasts_fisher_exact(),contrasts_linfct_firth(),effective_contaminant_pattern(),effective_decoy_pattern(),filter_difference(),hierarchy_counts_sample(),is_singular_lm(),lfq_power_t_test_quantiles(),linfct_all_possible_contrasts(),linfct_factors_contrasts(),medpolish_estimate(),medpolish_estimate_df(),medpolish_estimate_dfconfig(),moderated_p_limma_long(),names_to_matrix(),nr_B_in_A(),plot_hierarchies_add_quantline(),plot_hierarchies_line_df(),plot_lmer_peptide_predictions(),remove_na_rows(),rlm_estimate(),rlm_estimate_dfconfig(),scatter_plotly(),summarize_stats_all(),tidy_to_wide(), and the function forms offilter_proteins_by_peptide_count()andremove_small_intensities()(theLFQDatamethods of the same names are unchanged).unregister_facade()is no longer exported. - Replacements where one exists: sample sizes via
LFQDataStats$power_t_test_quantiles()orlfq_power_t_test_quantiles_V2();summarize_stats(x, factor_key = NULL)forsummarize_stats_all(x); the Summariser method$hierarchy_counts_sample(). - Datasets
data_checksummarizerobustanddata_correlatedPeptideList. - R6 methods:
LFQData$filter_difference(),$omit_na(),$contaminant_proportion();LFQDataPlotter$write(),$write_pltly();Model$write_anova_figures(),$write_coef_figures()and the same onModelFirth;ContrastsPlotter$score_plotly(),$histogram_estimate()(use$histogram_diff());AnalysisConfiguration$id_required(). - Unused fields and arguments:
- strategies:
report_columns(argument and field of allstrategy_*()andStrategy*classes),is_mixed,$model_fun(get_formula = )(use$formula),strategy_logistf(test = ) - models and contrasts:
ModelLimma$design,$formulaand the matching$new()arguments;Model$anova_df,ModelFirth$anova_df;AnovaExtractor$col_fdr;Contrasts$protein_annot;ContrastsMissing$global,$present,$minsd - plotting:
ContrastsPlotterprefixandprotein_annotfields and$new(protein_annot = );LFQDataPlotterfile_paths_pdf,file_paths_html - other:
AnalysisConfiguration$hierarchy_keys(rev = );setup_analysis(cc = , from_factors = );plot_hierarchies_line(separate = );transform_work_intensity(intensity_new_name = );compute_pooled(method = )andpoolvar(method = )with the “V2” pooled variance;sim_make_model_lmer(singular = ); internal facade fieldsContrastsLMMissingFacade$missing_contrast,$merged,ContrastsLimpaNestedFacade$.lfqdata_nested
- strategies:
-
build_contrast_analysis()no longer honours an undocumentedbuilderfield on facade registry entries.
prolfqua 1.7.1
MissingHelpers$get_lod()no longer returns NA for data without groups seen once. It falls back to the partly observed groups with the fewest observations, and to the lowest group mean when every group is complete or empty.build_model_impute()therefore refits a protein missing a whole group in nearly complete data, where the NA LOD made the refit fail silently and left the protein unfitted.New
impute_from_model()fills the missing response cells of anLFQDatawith predictions from its per-proteinlmmodels (frombuild_model()orbuild_model_impute()), leaving observed values unchanged, and reports per protein how many cells were observed and imputed and by which route (complete,fitted,lod_refitornone). Additive designs such as~ group_ + pairare supported; a model that is not lm-based is an error.
prolfqua 1.7.0
A mixed-model analysis (
lmer_nested) no longer aborts partway through when a single protein has no estimable contrast. Such a protein is now dropped with a warning naming it, like a rank-deficient one, instead of failing the whole run withsubscript out of boundsfromlmerTest::contest().A
ContrastConfigurationbuilt withpvalue_col = NA_character_now stores""instead. HDF5 has no character NA, so a configuration serialized into an AnnData artifact came back withpvalue_colset to the literal string"NA"andhas_pvalue()reported a p-value column that no backend had produced. Backends without a p-value, such as SAINTexpress, are now read back correctly.The peptide count in simulated data is now called
nrPeptides, matching the name every reader in the ecosystem produces. It was the only place the column was callednr_peptides, which meant code written against simulated data did not work on real data – and vice versa – and downstream packages carried aliases between the two spellings. Thenr_peptidesoption (minimum peptides per protein) is unchanged; only the data column is renamed.New
list_to_ContrastConfiguration()rebuilds aContrastConfigurationfrom the plain list produced byR6_extract_values(), so a serialized column-role mapping (e.g. fromSummarizedExperimentmetadata or an AnnDataunsentry) can be restored with its methods, such ashas_pvalue(), intact.Moderated t/Wald contrast tables now report the posterior contrast standard error in
std.error, whilestd.error.unmoderatedanddf.unmoderatedpreserve the pre-moderation test inputs for downstream comparisons. Moderated confidence intervals now use the contrast scale rather than the residual-variance scale; this corrects intervals that were too wide when the raw contrast scale factor was below one and too narrow when it was above one. The separate infinite-prior-df fallback is unchanged and remains a distinct follow-up decision.main_effect_contrasts()now emits averaging contrasts with a top-levelLHS - RHS, making its output directly valid for the stricter contrast parser.Added the
binomial_nestedfacade for nested LFQ data. It reuses the Firth backend’s completed peptide-detection representation, fits protein-by-sample detected/undetected peptide counts with a quasibinomial GLM, and reports moderated protein-level log odds-ratio contrasts. A symmetric pseudo-count stabilizes separated fits, and posterior dispersion is bounded below by one by default (binomial_bound = FALSEdisables the bound).Variance moderation now uses
limma::squeezeVar()directly.moderated_p_limma()— and therefore every moderated Wald-test facade (lm,rlm,rfit,lm_impute,lm_missing,rfit_impute,lmer_nested) and the DEqMS small-group fallback — now callslimma::squeezeVar()instead of the vendoredsqueezeVarRob()fork (limma is already a dependency). Modern limma estimates the empirical-Bayes prior robustly on the fractional / low residual degrees of freedom these estimators produce, without themin_dfworkaround prolfqua inherited from MSqRob. This slightly changes moderated p-values, FDR and confidence bounds; on the IonStar spike-in benchmark AUC is unchanged, FDR calibration is maintained, and ≥99.7% of significance calls are identical. See theSqueezeVar_comparisonvignette inprolfquabenchmark. (ropeca_nestedis unaffected — it aggregates raw peptide-level p-values and never used variance moderation. A contrast with fewer than three features now returns unmoderated results, matching limma, where the empirical-Bayes prior is undefined.)Fixed the scale used to moderate
rlmcontrasts.StrategyRLM$sigma()now returns the robust scaleMASS::rlmbuilds its standard errors from (fit$s) instead ofstats::sigma()(the ordinary-residual scale). Because the two differ,ContrastsModerated’ssigma / sqrt(var.post)rescaling was leaving a spurious per-protein factor in moderatedrlmstatistics, p-values, FDR and confidence bounds. Only therlmfacade’s moderated output is affected —lmandrfitwere already coherent, andrlm’s unmoderated statistics (diff,std.error) were always correct.Removed the exported
squeezeVarRob()and its internal helpers (fitFDist_LG,fitFDistRobustly_LG); the whole vendoredsqueezeVarRob.Rfile is gone. Uselimma::squeezeVar()instead. DEqMS moderation now callslimma::trigammaInverse()(identical to the copy that was removed). This is a breaking change only for code that calledprolfqua::squeezeVarRob()directly — the ecosystem does not. Also dropped the now-unusedstatmodfromImports.User-facing errors at prolfqua’s public entry points now carry typed condition classes (all inheriting from
prolfqua_error), so callers and tests can catch failures by class instead of matching message text. Covered:setup_analysis(),build_contrast_analysis(), theLFQData$set_data()/set_config_value()mutators,LFQData$get_Aggregator(), the aggregators’ “must aggregate a multi-level hierarchy” / “aggregate first” checks,LFQDataTransformer$center_to_reference(), andContrastsSimpleImpute$get_contrasts().LFQData$set_data()andset_config_value()additionally now reject data that no longer contains the columns required by the current configuration, instead of accepting invalid state silently.Abundance-density plots now carry per-sample Plotly highlight keys, allowing interactive reports to fade non-hovered sample curves while preserving the existing ggplot output.
Breaking — contrast schema. The
modelNamecolumn ofget_contrasts()output is now the selected facade key (lm,rlm,rfit,lm_impute,lm_missing,limma,limma_impute,limma_voom,limma_voom_impute,limpa,deqms,deqms_voom,firth,lmer_nested,ropeca_nested,firth_nested,limpa_nested) instead of the testing-schema label (WaldTest_moderated,*_DEqMS,*_imputed, …). Rescue/imputation state moved to a newestimate_typecolumn with valuesobserved,lod_imputed, ormissing_fallback. The redundantfacadecolumn was removed (its role is now played bymodelName). The moderated-Wald-test wording belongs in methods text, not per-row labels. Downstream code that filtered onmodelName == "WaldTest_moderated"(or the_imputed/_DEqMSvariants) or read thefacadecolumn must migrate to the facade key andestimate_type.build_contrast_analysis()and the exportedFACADE_REGISTRYnow derive method dispatch and the available-method list from a single seeded registry (list_facades()), removing three hand-maintained copies that could drift. New exported base classContrastsFacadeBaseholds the shared facade plumbing; the 19 built-in facades are now thin subclasses.ContrastsPlottercolours volcano/MA/score plots byestimate_typewhen present (and the colour column was left at its default), using black for observed estimates, green for LOD-imputed estimates, and blue for group-mean fallback estimates.Correctness fixes:
AggregateTopNnow validatesfuncviamatch.arg(an invalid value errors instead of silently meaningmean);Model$get_anova()drops degenerate rows byis.na(factor)rather than a never-matching"NULL"string;sim_lfq_data()now honours itsmean_protargument;LFQDataTransformer/LFQDataSummariserdeep-clone their input like the other decorators (no more mutating the caller’s object);ContrastsFirth$get_linfct()returns the linfct-annotated model copies instead of mutating the shared model;contrasts_fisher_exact()pre-allocatesnrow(x)results;ContrastsMissingnow actually validates its output schema.Fixed the vectorized contrast path (
options(prolfqua.vectorize = TRUE)) to match the default loop path on rank-deficient (aliased) model fits: a contrast whose weights fall on non-estimable coefficients now returnsNAinstead of a spurious fold-change of 0 with aNaNp-value. The invalid-row guard now counts nonzero weights rather than summing signed weights, so contrasts with canceling+1/-1weights on missing coefficients are correctly flagged. The default (non-vectorized) path was never affected.The vectorized contrast path now assigns stable
contrast_1,contrast_2, … labels to unnamed contrasts, matching the documented naming behavior instead of leaking an expression into the result row names.get_contrast()now derivesgroup_1/group_2from the contrast’s left/right side expressions, fixing mislabeled per-group columns for averaging contrasts such as(group_A + group_B)/2 - group_Ctrl(previously it used the first two group tokens). SimpleA - Bcontrasts are unaffected. A contrast that is not a differenceLHS - RHSnow errors with a clear message instead of silently extracting the first two group tokens. Nested contrasts that reference an earlier contrast by name (e.g.Interaction = "AvsB_gv_X - AvsB_gv_Z") remain supported in theContrastsMissing/lm_missingpath.setup_analysis()now stops with an informative error (listing the offending keys) when a hierarchy-key/sample combination has more than one observation, instead of silently returning a different-schema count table that crashed downstream. Passdebug = TRUEto recover the old behaviour and return the count table for inspection.Removed the unused
impute_with_zcomp(),estimate_lod_global(), andfunction_lod_quantile()exports (and thezCompositionsdependency). For missing-value imputation useAggregateLimpa$new(lfqdata, impute_only = TRUE)$aggregate().Hardened
plot_pca(): errors early on duplicated sample names, an all-missing matrix, or too few samples instead of returningNULL(which brokepca_plotly()); joins scores to annotation with an explicitby; makesprcomp(center = TRUE, scale. = FALSE)explicit.Hardened abundance heatmaps for sparse significant-feature subsets: when row or column distances are non-finite because of missing values,
plot_heatmap()now falls back to the input order instead of returning aComplexHeatmapobject that fails during drawing.Abundance heatmaps now retain every partially observed feature that can be meaningfully row z-scored by default, while automatically removing constant, single-observation, and all-missing rows. Significant-feature reports no longer hide bait-only results or require a dataset-specific missing-value threshold, and sparse matrices render safely even when clustering distances are unavailable.
LFQDataPlotter$heatmap()now shows only thetop_nmost variable features (default 1000), ranked by the prolfqua per-feature statistic (CV for untransformed data, sd for transformed, viaLFQDataStats). Row clustering usesstats::hclust, which errors above 65536 features, so peptide-list / entrapment searches with tens of thousands of degenerate protein groups no longer crash the QC heatmap. Passtop_n = NULL(orInf) to keep every feature.StrategyLogistfnow uses Wald confidence intervals instead of profiling every coefficient, preventingfirth_nestedanalyses from stalling for days on proteins with hundreds or thousands of peptides.
prolfqua 1.6.1
- Added a
check-biocMakefile target and a Bioconductor Docker check image. - Updated BiocCheck-related documentation and vignette metadata.
-
ContrastsPlotter$volcano()andvolcano_plotly()no longer cap positive FDR/p-value scores at1e-4by default. - Renamed
LFQData$to_wide()todata_wide()and removed deprecated compatibility wrappers. - Split
nr_obs_experiment()intonr_children_experiment()andnr_features_experiment(). - Made
LFQDatadata/config internals private and moved callers to accessor methods. - Refactored transformer and aggregation helpers around current
LFQDataAPIs.