A function to determine ctDNA positivity with N repeated Monte Carlo simulations. Return a p-value based on Monte Carlo simulation test. Calls simulator function n_simulations times.
positivity_test(depths, alt_reads, rate, seed = 123,
n_simulations = 10000)
a vector with the depths of the variants
the observed variant allele reads
A named list containing mismatch rates as produced by get_background_rate function
the random seed
the number of simulations to run.
a scalar, simulation p-value.