Runs the local Digital Twin Test using the TDT test statistc. This test determines if there is a causal SNP somewhere in a specified windown, after accounting for all genetic variant outside the window.
conditional_tdt(sample, haps_matrix, snp_info, group, site, gen_map, n_reps = 500, exact = FALSE)
| sample | A dataframe in .sample format. |
|---|---|
| haps_matrix | A n x p matrix of 0-1. Each row represents one haplotypes.
To convert from indices to haplotype indices, an entry i in |
| snp_info | A dataframe with 5 columns: chromosome, snp_name, position, variant_1, and variant_2 (column naming is ignored). |
| group | A vector of entries specifying the group to test. Must be a vector of the form j:k for some j > 0 and k < p + 1. |
| site | The index of a column of |
| gen_map | Genetic map: a dataframe contining at least columns "pposition" and "gposition". |
| n_reps | Number of repetions of the randomization test. |
| exact | Whether or not to include the finite-sample correction. |
A p-value.
This function is not intented to be called repeatedly for different variants. Significant computational speedups would be possible in that case.