# AnalyticalMethodValidation

CI status | Coverage |
---|---|

A small package for analytical method validation, and sample analysis.

For command line interfaces, see `juliaquant`

.

## Function

`read`

: read csv file(s) into`AnalysisTable`

(See`ChemistryQuantitativeAnalysis.jl`

). Currently, only data from MassHunter Software in wide format is supported.

### Report functions

These function accept `AnalysisTable`

or `Batch`

.

`qc_report`

: compute statistics of QC samples.`ap_report`

: compute accuracy, repeatability and reproducibility.`recovery_report`

: compute recovery by prespiked/postspiked.`me_report`

: compute matrix effect by with_matrix/std_solution.`stability_report`

: compute stability in different condition and restoration days.`sample_report`

: average each sample.

### Util functions

`pivot`

: transform dataframe into wide format.`unpivot`

: transform dataframe into long format.`selectby`

: select values by specific column, and apply`select!`

as if the values are columns. This function is useful to merge multiple statistical values into specific formats.`mean_plus_minus_std`

: round and merge mean values and standard deviations with "±".`add_percentage`

: add "%".`normalize`

: normalize dataframe by the given normalizer.`qualify`

: replace data out of acceptable range.`qualify!`

: replace data out of acceptable range.

## Computation

### Intra-day

$$a_{d,j } = \dfrac{c_{d, j}}{conc.}$$

$$\mu_{d} = \sum_{j=1}^{n_d} \dfrac{a_{d, j}}{n_d}$$

$$s_{intra}^2 = \dfrac{1}{p}\sum_{i = 1}^{p}\sum_{j = 1}^{n_i} \dfrac{(a_{i, j} - \mu_i)^2}{n_i - 1}$$

$$accuracy_{intra, d} = \mu_{d}$$

$$rsd_{intra, d} = \dfrac{s_{intra}}{accuracy_{intra, d}}$$

$p$: number of days, $n_i$: number of repeats of $i$ th day, $c_{i, j}$: measured concentration of $i$ th day and $j$ th repeat, $conc.$: reference concentration

### Inter-day

$$\mu = \dfrac{1}{p}\sum_{i = 1}^{p}\sum_{j = 1}^{n_i} \dfrac{a_{i, j}}{n_i}$$

$$accuracy_{inter} = \sum_{i = 1}^{p} \dfrac{accuracy_{intra, i}}{p} = \mu$$

$$repeatability = rsd_{intra} = \dfrac{s_{intra}}{accuracy_{inter}}$$

$$s_{between}^2 = \sum_{i = 1}^{p} \dfrac{(\mu_i - \mu)^2}{n_d - 1}$$

$$s_{inter}^2 = max\ {0, s_{between}^2 - \dfrac{s_{intra}^2}{\hat{n}}\ }$$

$$\hat{n}=\dfrac{p}{\sum_{i=1}^p\dfrac{1}{n_i}}$$

$$reproducibility = rsd_{total} = \dfrac{\sqrt{s_{inter}^2+s_{intra}^2}}{accuracy_{inter}}$$

## Reference

Guidelines and Recommendations of the GTFCh

Appendix B - Requirements for the validation of analytical methods p.21~p.22