Creates a cross-tabulation (contingency table) comparing two taxonomic ranks from a phyloseq object. Useful for comparing taxonomic assignments from different databases, algorithms, or taxonomic levels.
Arguments
- physeq
(required) A
phyloseq-classobject obtained using thephyloseqpackage.- rank_1
(character, default "Family") The name of the first taxonomic rank (column in tax_table slot) for the cross-tabulation rows.
- rank_2
(character, default "Class") The name of the second taxonomic rank (column in tax_table slot) for the cross-tabulation columns.
- ...
Additional arguments passed to
gtsummary::tbl_cross().
Examples
tc_df_pq(data_fungi_mini)
Agaricomycetes
Atractiellomycetes
Tremellomycetes
Unknown
tc_df_pq(data_fungi_mini, rank_1 = "Order", rank_2 = "Family")
Aporpiaceae
Atractiellales_fam_Incertae_sedis
Auriculariaceae
Cantharellales_fam_Incertae_sedis
Corticiaceae
Entolomataceae
Exidiaceae
Hericiaceae
Hymenochaetales_fam_Incertae_sedis
Hyphodermataceae
Lyophyllaceae
Peniophoraceae
Phanerochaetaceae
Polyporaceae
Pterulaceae
Russulales_fam_Incertae_sedis
Schizoporaceae
Steccherinaceae
Stereaceae
Tricholomataceae
Unknown
if (FALSE) { # \dontrun{
# Compare taxonomic assignments from different methods
ref_fasta <- system.file("extdata", "mini_UNITE_fungi.fasta.gz",
package = "MiscMetabar", mustWork = TRUE
)
data_fungi_mini2 <- data_fungi_mini |>
add_new_taxonomy_pq(ref_fasta, suffix = "_sintax", method = "sintax") |>
add_new_taxonomy_pq(ref_fasta, suffix = "_lca", method = "lca")
tc_df_pq(data_fungi_mini2, rank_1 = "Class_lca", rank_2 = "Class_sintax")
} # }