Changelog
Source:NEWS.md
cellpaintr 0.99.4
-
calculateStats()calibrates the t-statistic with a permutation test that relabels whole patients and refits all leave-one-out models (method = "permutation", the new default). It enumerates all relabelings if there are at mostn_permutations + 1of them and samples them otherwise.method = "t"keeps the p-values from the t-distribution, which are anti-conservative because the scores of different held-out patients are correlated. -
predictLOO()records its settings inmetadata(), andcalculateStats()takes the interest and reference levels from there instead of from the order of the factor levels. -
volcanoPlot()accepts precomputed statistics (stats) and passes further arguments, such asmethod, tocalculateStats().
cellpaintr 0.99.5
- The permutation test of
calculateStats()handles mixed designs, in which only some patients have cells of both levels, for example after quality control removed all cells of one level of a patient. It swaps the levels of the patients with both levels, permutes the levels among the other patients, and reports which patients have cells of one level only.
cellpaintr 0.99.6
-
calculateStats()offers a corrected paired t-test (method = "corrected"). For every pair of patients, it refits the models without both of them and adds the products of their influences on each other’s score differences to the sample variance, which makes the variance unbiased under the null hypothesis. It needs n(n-1)/2 fits per feature group for n patients instead of refitting all models for every relabeling, and it can reach small p-values with few patients. The attributevariance_ratioholds the corrected over the uncorrected variance. The permutation test stays the default. - Internal: model fitting of
compute_y_hat()moved into helpers shared with the corrected t-test; results are unchanged.
cellpaintr 0.99.7
Changes in response to the first Bioconductor review:
-
generate_data()is renamedgenerateData(), in line with the rest of the API. - New example data:
inst/extdata/jump_subset.csv.gz, 240 cells of the JUMP Cell Painting dataset (DMSO, AMG900, and dexamethasone on four plates) as exported by CellProfiler;inst/scripts/make-jump-subset.Rdocuments how it was made, andinst/scripts/README.mdthe provenance of all files ininst/extdata. - The vignette is rewritten around the JUMP data: it describes the CellProfiler input and its
Metadata_columns, explains every step, and shows the messages ofcalculateStats(). - New package man page (
?cellpaintr) with an overview of the workflow. - Exported functions validate their inputs and stop with informative messages;
predictLOO()accepts a charactertarget, needs at least two levels ofgroup, and keeps the cell names ofsceinstead of replacing them with integers. -
loadData()passes further arguments toreadr::read_csv(), for examplenum_threads. -
removeNAs(),removeLowVariance(),removeZeroInflation(), andtransformScale()have anassay_typeargument, and use vectorizedcolSums(),rowMeans(), andMatrixGenericsinstead ofapply(). - The relabelings of the permutation test run through
future.apply::future_lapply(), sequentially by default and in parallel afterfuture::plan(), with reproducible random numbers. - Functions are imported instead of declared as global variables;
rlang,stats,methods,MatrixGenerics, andfuture.applyare imported. - Long functions are split into helpers, and the code follows the Bioconductor style (80 characters, 4-space indents).
-
compute_y_hat()andaggregateYhat()are internal and have no man pages. - More unit tests check values, not only classes, and cover the input checks.
Changes to improve the package but unrelated to the Bioconductor review:
- The corrected t-test of
calculateStats()(method = "corrected") now divides the paired t-statistic by sqrt(2(n-1)/(n-2)), the factor by which it is too large if each score difference is a sum of pairwise interactions with the other patients. It needs no refits and no longer needs the settings ofpredictLOO(). It replaces the leave-two-out variance correction of 0.99.6 and its attributevariance_ratio. -
calculateStats()offers the correction of the corrected resampled t-test of Nadeau and Bengio (2003) (method = "nadeau_bengio"), which divides the paired t-statistic by sqrt((2n-1)/(n-1)). It corrects less thanmethod = "corrected"and needs a paired design with at least two patients and no refits. - The permutation test of
calculateStats()no longer refits relabelings that only repeat another one. Exchanging the two levels in all patients at once turns every score into one minus the score and leaves the statistic unchanged, so one patient now keeps its labels whenever this exchange is itself a relabeling (always in a paired design). This halves the number of refits, and the test stays exact. In a paired design with n patients, there are 2^(n-1) relabelings, and the smallest attainable p-value is 2^(1-n) instead of a nominal 2^-n that depended on the forest seeds. - The vignette explains that ROC curves and AUCs use the mean scores of each replicate and condition.
- The vignette scales the well means before the PCA. Robust z-scores are extreme for features with a median absolute deviation close to zero, and one well dominated the first principal component.
- The DESCRIPTION and the vignette describe when cellpaintr is more powerful than a location test on patient means (most cells shift, or the spread of features changes) and when it is less powerful (a strong response of a small subpopulation), following a comparison on effects spiked into JUMP control wells.
Bug fixes:
-
plotROC()andplotAUC()take the interest and reference levels from the settings ofpredictLOO()instead of from the order of the factor levels oftarget. Before, a charactertargetwhose interest level sorted first alphabetically, such as AMG900 against DMSO, swapped the two levels and turned every AUC into one minus the AUC. -
predictLOO()orders the levels of a charactertargetwith the reference level first. -
removeRowColEffect()subtracted the row and column effects of the wrong rows or columns when the first column of a plate lacked a row or the first row lacked a column, because it matched the effects to cells by position. It now matches them by name, and its median polish leaves out empty wells instead of setting their medians to zero.
cellpaintr 0.99.8
Changes in response to the second Bioconductor review:
-
removeRowColEffect()has aplateargument: with the column of the plate or batch of each cell, it fits the median polish to each plate separately. Without it, all cells are polished as one plate, and the function warns ifcolData(sce)has aPlatecolumn with several plates. - The vignette’s example of parallel permutations uses two workers.
- The vignette and
?calculateStatscite the paper that derives the corrected t-tests and studies their type I error and power with 4 to 12 replicates; the preprint will be available soon. - The biocViews include DataImport, CellBasedAssays, and StatisticalMethod.