fit_logregr | R Documentation |
This is an auxiliary function in single package. It takes counts_pnq and for each position and nucleotide it fits SINGLE's logistic regression.
fit_logregr(
counts_pnq,
ref_seq,
p_prior_errors,
p_prior_mutations,
save = FALSE,
output_file_fits,
output_file_data,
verbose = FALSE,
keep_fit_quality = FALSE
)
counts_pnq |
Data frame with columns position nucleoide quality counts, as returned by pileup_by_QUAL |
ref_seq |
DNAStringSet containing the true reference sequence. |
p_prior_errors |
Data frame with columns position nucleotide prior.error, as the one returned by p_prior_errors(). |
p_prior_mutations |
Data frame with columns wt.base, nucleotide and p_mutation (probaility of mutation), as the one returned by p_prior_mutations(). |
save |
Logical. Should data be saved in a output_file? |
output_file_fits |
File into which save the single fits if save=TRUE |
output_file_data |
File into which save the fitted data if save=TRUE |
verbose |
Logical. |
keep_fit_quality |
Logical. Should parameters related to the quality of the fit be returned in extra columns of the output? |
data.frame with columns position, nucleotide, slope and intercept (of the sigmoidal regression).
refseq_fasta <- system.file("extdata", "ref_seq.fasta", package = "single")
ref_seq = Biostrings::readDNAStringSet(refseq_fasta)
train_reads_example <- system.file("extdata", "train_seqs_500.sorted.bam",
package = "single")
counts_pnq <- pileup_by_QUAL(bam_file=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)
p_prior_errors <- p_prior_errors(counts_pnq=counts_pnq)
fits <- fit_logregr(counts_pnq = counts_pnq,ref_seq=ref_seq,
p_prior_errors = p_prior_errors,p_prior_mutations = p_prior_mutations)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.