Compute pairwise modification co-occurrence odds ratios.
Source:R/odds-ratios.R
compute_odds_ratios.RdGiven 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.
Arguments
- mod_calls_path
Path to a
{sample}.mod_calls.tsv.gzfile 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.- sites
Optional tibble of sites to test, with columns
refandpos, typically fromcall_bcerror_sites(). IfNULL(default), all positions present in the calls are used.
See also
compute_charging_odds_ratios() for modification against
charging, and call_bcerror_sites() for selecting sites.
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