Skip to contents

Here we filter allele frequencies with a normal + uniform mixture model. nQuack utilizes the scaled probability of each data point belonging to each mixture model, which is inferred in the expectation maximization algorithm. We remove allele frequencies where probability of belonging to uniform mixture is higher than their probability of belonging to any other mixture. We also implement nQuire's denoise method here, which utilizes the inferred alpha parameter and a histogram of base frequencies to filter the data.

Usage

denoise_data(xm, plot = TRUE, filter = "both")

Arguments

xm

Matrix with total coverage and coverage for a randomly sampled allele.

plot

Default to TRUE. The plots do not share the same y-axis, so careful interpretation is key. Warning, if nothing is removed, the plot of removed data will be missing.

filter

Indicates which method to remove data based upon. Options: 'both', 'nquire', or 'nquack'. nQuack utilizes the scaled probability of each data point belonging to each mixture model, removing sites where the probability of belonging to uniform mixture is higher than their probability of belonging to any other mixture. nQuire utilizes the inferred alpha parameter and a histogram of base frequencies to filter the data.

Value

Numeric matrix with total coverage and coverage for a randomly sampled allele.