View source: R/write_classification_to_vcf.R
| write_classification_to_vcf | R Documentation |
Add probabilities from classification data frame to a VCF file
write_classification_to_vcf(file, classifications.df)
file |
An VCF file |
classification.df |
Classification data frame with mutations as a column and posteriors for signatures. Must have 96 rows. |
library(MutationalPatterns)
library(tidyverse)
library(vcfR)
library(R.utils)
library(Biostrings)
library(BSgenome.Hsapiens.UCSC.hg38)
vcf.file <- system.file("extdata", "SIMULATED_SAMPLE_SBS4_1.vcf", package = "excerno")
# Load in signatures
cosmic.sigs <- get_known_signatures()
# Get signatures
signatures <- matrix(nrow = 96, ncol = 2)
signatures[,1] <- cosmic.sigs[,4]
signatures[,2] <- get_ffpe_signature()
rownames(signatures) <- get_mutation_types()
colnames(signatures) <- c("SBS4", "FFPE")
# Get contributions
contribution <- matrix(nrow = 2, ncol = 1)
contribution[,1] <- c(0.5, 0.5)
rownames(contribution) <- c("SBS4", "FFPE")
classification.df <- get_classification(signatures, contribution)
write_classification_to_vcf(vcf.file, classification.df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.