These methods convert sequences from ape formats DNAbin and AAbin to tibbles.

as_tibble.DNAbin(x, label = "label", sequence = "sequence", ...)

as_tibble.AAbin(x, label = "label", sequence = "sequence", ...)

Arguments

x

a DNAbin or AAbin object.

label

Name of the column that stores the sequence labels in the returned tibble.

sequence

Name of the column that stores the sequences in the returned tibble.

...

Not used.

Value

A tibble with two columns (if name is not NULL, the default) or one column (otherwise).

See also

Examples

require(ape)
#> Loading required package: ape
require(tibble)
#> Loading required package: tibble
x <- rDNAbin(nrow = 10, ncol = 25)
as_tibble.DNAbin(x)
#> # A tibble: 10 × 2
#>    label  sequence                 
#>    <chr>  <DNA>                    
#>  1 Ind_1  TGCCTAACTGTAGAAATAAAAGCAT
#>  2 Ind_2  AGCTCGATTAGCCCCGGGGACTCGA
#>  3 Ind_3  GGTAGTCGCTAAGTTTCCGGATGGT
#>  4 Ind_4  CAATACACTGCGCTACAACTCAGCA
#>  5 Ind_5  CGCAATCAGCTAGCAAGTGAAGCCT
#>  6 Ind_6  ACGTTGACGCCAGGACTACTACCAG
#>  7 Ind_7  ACCGGAGGTCAGCAGCGGTCACGAC
#>  8 Ind_8  GTCTTGGTGAGTGGCTACCTTTATG
#>  9 Ind_9  CCTTCGGCAAGGCTACCTCTGTCTA
#> 10 Ind_10 GAGAATGTTTAGGCCGAAGATGATT