50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

delimtools (version 0.2.0)

haplotype_tbl: Summarise Haplotypes Down to One Row

Description

haplotype_tbl() returns a tbl_df summarising all unique haplotype frequencies and duplicates into a single row.

Usage

haplotype_tbl(dna, clean = TRUE, collapseSubstrings = TRUE, verbose = TRUE)

Value

an object of class tbl_df.

Arguments

dna

an object of class DNAbin.

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.

Author

Rupert A. Collins, Pedro S. Bittencourt.

Details

haplotype_tbl() uses a combination of clean_dna and hap_collapse to summarise haplotypes into a tibble. Each row of the tibble has an unique haplotype, its frequency and all its collapsed duplicates in a flattened string.

Examples

Run this code

# get haplotype table
haplotype_tbl(geophagus) 

Run the code above in your browser using DataLab