pctopt {longreadvqs} | R Documentation |
Optimizing cut-off percentage for error minimization
Description
Finds an optimal cut-off percentage for error minimization (in vqssub, vqsassess, and vqscustompct functions) that can decrease the number of singleton haplotypes to less than the desired percentage of the total reads.
Arguments
fasta |
Input as a read alignment in FASTA format |
pctsing |
The desired percentage of singleton haplotypes relative to the total reads in the alignment. |
method |
Sequencing error minimization methods that replace low frequency nucleotide base (less than the "pct" cut-off) with consensus base of that position ("conbase": default) or with base of the dominant haplotype ("domhapbase"). |
samplingfirst |
Downsampling before (TRUE) or after (FALSE: default) the error minimization. |
gappct |
The percent cut-off particularly specified for gap (-). If it is not specified or less than "pct", "gappct" will be equal to "pct" (default). |
ignoregappositions |
Replace all nucleotides in the positions in the alignment containing gap(s) with gap. This will make such positions no longer single nucleotide variant (SNV). The default is "FALSE". |
samsize |
Sample size (number of reads) after down-sampling. If it is not specified or more than number of reads in the original alignment, down-sampling will not be performed (default). |
label |
String within quotation marks indicating name of read alignment (optional). |
Value
An optimal cut-off percentage for error minimization of an input sample and parameter settings. If label is specified, the output will be a data frame with percentage of singleton haplotypes at each cut-off percentage from zero to the optimal cut-off percentage.
Examples
## Locate input FASTA file-------------------------------------------------------------------------
fastafilepath <- system.file("extdata", "s1.fasta", package = "longreadvqs")
## Find an cut-off percentage that creates singleton haplotypes less than 50% of the alignment.----
pctopt(fastafilepath, pctsing = 50, label = "s1")