View source: R/p_prior_mutations.r
p_prior_mutations | R Documentation |
This is an auxiliary function in single package. It computes the prior probability of mutation in a gene library.
p_prior_mutations(
rates.matrix,
mean.n.mut,
ref_seq,
save = FALSE,
output_file = "tablePriorMutations.txt"
)
rates.matrix |
Mutation rate matrix: 4x5 matrix, each row/col representing a nucleotide (col adds deletion), and the values is the mutational rate from row to col. |
mean.n.mut |
Mean number of mutations expected (one number). |
ref_seq |
DNAStringSet containing the true reference sequence. |
save |
Logical. Should data be saved in a output_file? |
output_file |
File name for output, if save=TRUE. |
Data frame with columns wt.base (wild type nucleotide), nucleotide (mutated nucleotide), p_mutation (probaility of mutation)
refseq_fasta <- system.file("extdata", "ref_seq.fasta", package = "single")
ref_seq <- Biostrings::subseq(Biostrings::readDNAStringSet(refseq_fasta), 1,10)
train_reads_example <- system.file("extdata", "train_seqs_500.sorted.bam",
package = "single")
counts_pnq <- pileup_by_QUAL(train_reads_example,pos_start=1,pos_end=10)
p_prior_mutations <- p_prior_mutations(rates.matrix = mutation_rate,
mean.n.mut = 5,ref_seq = ref_seq)
head(p_prior_mutations)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.