Skip to content

Commit 03c2c1a

Browse files
committed
upadte readme
1 parent de5a822 commit 03c2c1a

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

README.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ Quick Start
4848
4949
library(msImpute)
5050
51-
# xna is a numeric matrix with NAs (for MAR/MNAR diagnosis only)
52-
# "group" defines experimental condition (e.g. control, treatment etc).
51+
# Let xna be a numeric matrix of log-intensity with NAs
52+
# Let "group" defines a single experimental condition (e.g. control, treatment etc).
53+
# Let "design" defines the experimental design (e.g. model.matrix(~0+group+batch)).
5354
5455
# select peptides missing in at least one experimental group
56+
group <- factor(c('control','control','conditionA','conditionA'))
5557
selectFeatures(xna, method="ebm", group=group)
5658
5759
@@ -60,24 +62,46 @@ selectFeatures(xna, method="ebm", group=group)
6062
selectFeatures(xna, method="hvp", n_features=500)
6163
6264
63-
# impute MAR data by low-rank models (v2 is enhanced version of v1 implementation)
65+
# Impute MAR data by low-rank approximation (v2 is enhanced version of v1 implementation tailored to small data)
6466
xcomplete <- msImpute(xna, method="v2")
6567
6668
67-
# impute MNAR data by low-rank models (adaptation of low-rank models for MNAR data)
68-
xcomplete <- msImpute(xna, method="v2-mnar", group=group)
69+
# Impute complex MV mechanims (MNAR and MAR) as mixture of two normal distributions (known as the Barycenter approach)
70+
design <- model.matrix(~0+group+batch)
71+
xcomplete <- msImpute(xna, method="v2-mnar", design=design)
72+
73+
74+
# Allow for features with very few (less than 4) measurements
75+
xcomplete <- msImpute(xna, method="v2-mnar", design=design, relax_min_obs = TRUE)
76+
77+
# Rank-2 approximation for the modeling MAR MVs in small sample regimes
78+
xcomplete <- msImpute(xna, method="v2-mnar", design=design, relax_min_obs = TRUE, rank.max = 2)
79+
80+
81+
# Disable seed generator such that the lower component of the mixture corresponding to MNAR is stochastic and returns a different results with each call (Note this is not recommended for reproducibility)
82+
xcomplete <- msImpute(xna, method="v2-mnar", design=design, relax_min_obs = TRUE, rank.max = 2, use_seed = FALSE)
6983
7084
71-
# Requires python. See Manual for more information.
72-
top.hvp <- findVariableFeatures(xna)
73-
computeStructuralMetrics(xcomplete,
74-
group,
75-
xna[rownames(top.hvp)[1:50],],
76-
k = 2)
7785
7886
7987
```
8088

89+
News
90+
---------------------
91+
**22.03.2025**
92+
The following changes have been made to function calls:
93+
- The use of 'group' is now deprecated. msImpute now allows specifying a design matrix (which has to have zero intercept) to accommodate more complex missing value (MV) data generation processes such as LC batch.
94+
- The new version models log-intensity as a mixture of two normal distributions, one for the MAR and one for the MNAR component. The weights of the mixture (equivalent to `a` or `alpha` in the old API) are determined according to a Dirichlet distribution learned from mv patterns, so you no longer need to specify the weights of the two distributions manually.
95+
- The new version also allows for retaining peptides/proteins with very few measurements (e.g. less than 4) via `relax_min_obs`.
96+
- In the old API, imputation was set to be deterministic for reproducibility purposes. If you wish to keep it stochastic for the lower component of the mixture that corresponds to MNAR distribution (sampling from down-shifted distribution) please set the use_seed argument.
97+
98+
The following dependencies were removed:
99+
- reticulate
100+
- scran
101+
102+
The following functions are deprecated:
103+
- `computeStructuralMetrics`
104+
81105
Tutorials
82106
---------------------
83107
Example workflows can be found under `figures/` in the [reproducibility repository](https://github.com/DavisLaboratory/msImpute-reproducibility) associated with the manuscript.

0 commit comments

Comments
 (0)