Skip to contents

Given a modkit mod_calls.tsv.gz file, build a per-read binary modification matrix for each tRNA and compute Fisher's exact test for each pair of positions. This is computationally expensive for full datasets; use the refs parameter to restrict to specific tRNAs.

Usage

compute_odds_ratios(mod_calls_path, refs = NULL, min_reads = 10)

Arguments

mod_calls_path

Path to a {sample}.mod_calls.tsv.gz file from modkit.

refs

Optional character vector of reference names to include. If NULL, all references are processed.

min_reads

Minimum number of reads required for a tRNA to be included. Default 10.

Value

A tibble with columns: ref, pos1, pos2, odds_ratio, log_odds_ratio, p_value, total_obs.

Examples

path <- clover_example("ecoli/mod_calls.tsv.gz")
compute_odds_ratios(path)
#> # A tibble: 1 × 7
#>   ref                   pos1  pos2  odds_ratio log_odds_ratio p_value total_obs
#>   <chr>                 <chr> <chr>      <dbl>          <dbl>   <dbl>     <int>
#> 1 host-tRNA-Glu-TTC-1-1 34    46           2.5          0.916   0.516        15