Learn R Programming

ctDNAtools (version 0.4.0)

positivity_test: Computes a p-value of ctDNA positivity with a Monte-Carlo based sampling test

Description

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.

Usage

positivity_test(depths, alt_reads, rate, seed = 123,
  n_simulations = 10000)

Arguments

depths

a vector with the depths of the variants

alt_reads

the observed variant allele reads

rate

A named list containing mismatch rates as produced by get_background_rate function

seed

the random seed

n_simulations

the number of simulations to run.

Value

a scalar, simulation p-value.

See Also

test_ctDNA