Skip to contents

This function takes a compiled data.frame following the format shown in the template_WES_data object and calculates basic sample sizes and detection rates for all gene targets.

Usage

calc_sample_sizes(df, cutoff = 40)

Arguments

df

A data.frame produced by the compile_tac_data function containing 'target_name' and 'ct_value' columns.

cutoff

Numeric scalar giving the cutoff Ct value over which a gene target is deemed absent from a sample. Default is 40.

Value

data.frame

Examples

calc_sample_sizes(template_WES_data)
#>   pathogen n_NA n_total n_lt_cutoff n_ge_cutoff observation_rate detection_rate
#> 1 target_0  790    1290        1290           0             0.62              1
#> 2 target_1  417     623         623           0             0.60              1
#> 3 target_2  372     668         668           0             0.64              1
#> 4 target_3  386     654         654           0             0.63              1
#>   ct_median ct_hpd_025 ct_hpd_975
#> 1     30.43      28.78      33.96
#> 2     29.26      24.99      33.66
#> 3     32.33      29.40      35.29
#> 4     29.64      27.00      31.80