best CV estimation — best_CV_estimation • protGear
Description: A function to select the best CV by combining the replicates in duplicates. The function has been build for up to to 3 replicates so far

# best CV estimation

Source: `R/cv_estimation_tag_functions.R`
`best_CV_estimation.Rd`

A function to select the best CV by combining the replicates in duplicates. The function has been build for up to to 3 replicates so far

    best_CV_estimation(dataCV, slide_id, lab_replicates, cv_cut_off)

## Arguments

dataCV

  A data frame

slide_id

  A character string containing the identifier of the data frame variable.

lab_replicates

  A numeric value indicating the number of lab replicates.

cv_cut_off

  a numeric value for the CV cut off. Should be between 0-100

## Value

A data frame with the best CV's estimated

## Details

Select set of replicates with the best CV

## Examples

    dataC <- readr::read_csv(system.file("extdata",
     "dataC.csv", package="protGear"))
    #> Rows: 567 Columns: 11
    #> ── Column specification ────────────────────────────────────────────────────────
    #> Delimiter: ","
    #> chr (3): sampleID, antigen, iden
    #> dbl (8): sample_array_ID, FMedian, BGMedian, FMedianBG_correct, Block, Colum...
    #>
    #> ℹ Use `spec()` to retrieve the full column specification for this data.
    #> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
    ## this file has 3 lab replicates and the default names
    dataCV <- cv_estimation(dataC  ,lab_replicates=3)
    #> Warning: The replicates are as expected per sample per antigen
    best_CV_estimation(dataCV,slide_id = "iden", lab_replicates = 3,
     cv_cut_off = 20)
    #> Adding missing grouping variables: `row`
    #> # A tibble: 126 × 27
    #> # Groups:   row [126]
    #>      row antigen sampleID sample_ar…¹  meanX   sdX sdX2_X3 sdX1_X3 sdX1_X2   CVX
    #>    <int> <chr>   <chr>          <dbl>  <dbl> <dbl>   <dbl>   <dbl>   <dbl> <dbl>
    #>  1     1 AMA1    0.0085            11   643.  98.5    70      69.3   139.  15.3
    #>  2     2 AMA1    0.0255             8   699   52.6    74.2    33.9    40.3  7.52
    #>  3     3 AMA1    0.076              5   633.  81.3    35.4    77.1   112.  12.8
    #>  4     4 AMA1    0.23               2  1725.  60.5    32.5    84.8    52.3  3.51
    #>  5     5 AMA1    0.73              19  2504. 119.    166.     61.5   105.   4.75
    #>  6     6 AMA1    177.78             4 58262  709.    994.    383.    612.   1.22
    #>  7     7 AMA1    19.75             10 64143. 353.    476.    367.    109.   0.55
    #>  8     8 AMA1    2.19              16  9243  383.    528.    156.    372.   4.15
    #>  9     9 AMA1    533                1 53180. 559.    117.    735.    619.   1.05
    #> 10    10 AMA1    59.26              7 61601  894.   1078.   1111.     32.5  1.45
    #> # … with 116 more rows, 17 more variables: CVX2_X3 <dbl>, CVX1_X3 <dbl>,
    #> #   CVX1_X2 <dbl>, cvCat_all <chr>, cvSelected_all <dbl>, iden <chr>,
    #> #   `1` <dbl>, `2` <dbl>, `3` <dbl>, x <chr>, meanX1_X2 <dbl>, meanX1_X3 <dbl>,
    #> #   meanX2_X3 <dbl>, meanSelected <dbl>, mean_best_CV <dbl>, best_CV <dbl>,
    #> #   best_CV_cat <chr>, and abbreviated variable name ¹​sample_array_ID