hap_collapse | R Documentation |
hap_collapse()
collapses haplotypes from a DNAbin object,
keeping unique haplotypes only.
hap_collapse(dna, clean = TRUE, collapseSubstrings = TRUE, verbose = TRUE)
dna |
A DNAbin object. |
clean |
logical. Whether to remove or not remove non ACTG bases from alignment. |
collapseSubstrings |
logical. Whether to collapse or not collapse shorter but identical sequences. |
verbose |
logical. Returns a warning if any sequence contains non ACTG bases. See clean_dna for details. |
hap_collapse()
collapses a DNAbin object, keeping unique
haplotypes only. If clean = TRUE
, the function will call clean_dna to remove
any non ACTG bases from alignment prior to collapsing haplotypes. If clean = FALSE
,
the function will treat data as it is, and will not remove any bases. If
collapseSubstrings = TRUE
, the function will consider shorter but identical
sequences as the same haplotype and collapse them, returning the longest
sequence. If collapseSubstrings = FALSE
, the function will consider
shorter but identical sequences as different haplotypes and will keep them.
A DNAbin object.
Rupert A. Collins
# collapse into unique haplotypes, including shorter sequences
hap_collapse(geophagus, clean = TRUE, collapseSubstrings = TRUE)
# collapse into unique haplotypes keeping shorter sequences
hap_collapse(geophagus, clean = TRUE, collapseSubstrings = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.