This function evaluates the presence of cancer in a sample by combining the cancerous signal across a catalogue of candidate mutations.
call_cancer(
mutations_df,
read_positions_df,
model,
beta,
alpha = 0.05,
calculate_confidence_intervals = FALSE,
use_turboem = TRUE
)
A data.frame()
with candidate mutations (SNVs) (chromosome, positions, reference and alternative)
A data.frame()
with read-positions. See get_read_positions_from_BAM()
A dreams model. See train_dreams_model()
.
Down sampling parameter from get_training_data()
for correcting the error-rates from the DREAMS model.
Alpha-level used for testing and confidence intervals. Default is 0.05.
Logical. Should confidence intervals be calculated? Default is FALSE.
Logical. Should turboEM::turboem()
be used for EM algorithm? Default is TRUE.
A list()
with:
cancer_info A data.frame()
with results for cancer calling across all mutations:
The estiamted tumor fraction (allele fraction).
The confidence interval of tf_est
.
The estiamted fraction/number of candidate mutations present in the sample.
The confidence interval of r_est
.
Number of candidate mutations tested.
Total count and coverage across all mutations (only reference and alternative allele(s).
Number of candidate mutations tested.
If the EM algorithm converged.
Number of steps and function evaluations by the EM algorithm.
The value of the log-likelihood function under the null (tf=0) and alternative (tf>0) hypothesis.
The chisq test statistic, degrees of freedom and p-value of the statistical test.
Whether cancer was detected at the supplied alpha level.
mutation_info A data.frame()
with information about the individual mutations:
The genomic position of the mutation.
The reference and alternative allele.
The estimated probability the mutation is present in the sample.
The expected count of the alternative allele under the error (null) model.
The count of the alternative allele.
The coverage used by the model (only referenceredas with and alternative allele).
The observed frequency of the alternative allele.