Skip to contents

Select candidate modification sites from a bcerror tibble by thresholding the base-calling error rate. The result is a site list suitable for the sites argument of compute_charging_odds_ratios() and compute_odds_ratios().

Usage

call_bcerror_sites(bcerror, min_error = 0.1, min_cov = 20, refs = NULL)

Arguments

bcerror

A bcerror tibble from read_bcerror(), with columns ref, pos, cov, and error_rate.

min_error

Minimum error_rate for a position to be called. Default 0.1.

min_cov

Minimum coverage (cov) for a position to be considered. Default 20.

refs

Optional character vector of reference names to restrict to. If NULL (default), all references are considered.

Value

A tibble with columns ref, pos, cov, and error_rate, sorted by reference and position.

Details

This is an alternative to selecting sites from direct modification calls: base-calling error is an orthogonal, model-free signal, so it can be used when the modification-caller channels are not trusted for a given dataset. Note that error-derived sites carry no modification identity — a site is called because reads misbehave there, not because a particular modification was identified.

Examples

bcerr_path <- clover_example(
  "ecoli/summary/tables/wt-15-ctl-01/wt-15-ctl-01.bcerror.tsv.gz"
)
bcerr <- read_bcerror(bcerr_path)
call_bcerror_sites(bcerr, min_error = 0.05, min_cov = 10)
#> # A tibble: 850 × 4
#>    ref                     pos   cov error_rate
#>    <chr>                 <int> <dbl>      <dbl>
#>  1 host-tRNA-Ala-GGC-1-1    16    10     0.2   
#>  2 host-tRNA-Ala-GGC-1-1    18    30     0.267 
#>  3 host-tRNA-Ala-GGC-1-1    22   148     0.209 
#>  4 host-tRNA-Ala-GGC-1-1    24   175     1     
#>  5 host-tRNA-Ala-GGC-1-1    25   177     0.254 
#>  6 host-tRNA-Ala-GGC-1-1    26   183     0.0765
#>  7 host-tRNA-Ala-GGC-1-1    30   194     0.103 
#>  8 host-tRNA-Ala-GGC-1-1    31   196     0.214 
#>  9 host-tRNA-Ala-GGC-1-1    32   197     0.173 
#> 10 host-tRNA-Ala-GGC-1-1    33   206     0.107 
#> # ℹ 840 more rows