View source: R/extract_all_prob.R
extract_all_prob | R Documentation |
extract_all_prob() implements bayes' thereom to get the probabilites of a mutation coming from a specific signature
extract_all_prob(mutation, signatures, contribution)
mutation |
Input string of the mutation type to look at. Formatted examples: C[C>A]T, G[T>C]A |
signatures |
Matrix of the signatures relevent in sample |
contributions |
Matrix of how much each signature contributed to the samples |
A vector of the posteriors
library(MutationalPatterns) library(tidyverse) cosmic.sigs <- get_known_signatures() # Get signatures signatures <- matrix(nrow = 96, ncol = 2) signatures[,1] <- cosmic.sigs[,4] signatures[,2] <- get_ffpe_signature()# Naming columns and rows colnames(signatures) <- c("SBS4", "FFPE") rownames(signatures) <- get_mutation_types() # Get contributions contribution <- matrix(nrow = 2, ncol = 1) contribution[,1] <- c(0.5, 0.5) rownames(contribution) <- c("SBS4", "FFPE") mutation <- "A[C>T]A" extract_all_prob(mutation, signatures, contribution)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.