Usage
sankey_pq(
physeq = NULL,
fact = NULL,
taxa = 1:4,
add_nb_seq = FALSE,
min_prop_tax = 0,
tax2remove = NULL,
units = NULL,
symbol2sub = c("\\.", "-"),
...
)
Arguments
- physeq
(required): a
phyloseq-class
object obtained using thephyloseq
package.- fact
Name of the factor to cluster samples by modalities. Need to be in
physeq@sam_data
.- taxa
a vector of taxonomic rank to plot
- add_nb_seq
Represent the number of sequences or the number of OTUs (add_nb_seq = FALSE). Note that plotting the number of sequences is slower.
- min_prop_tax
(default: 0) The minimum proportion for taxa to be plotted. EXPERIMENTAL. For the moment each links below the min.prop. tax is discard from the sankey network resulting in sometimes weird plot.
- tax2remove
a vector of taxonomic groups to remove from the analysis (e.g.
c('Incertae sedis', 'unidentified')
)- units
character string describing physical units (if any) for Value
- symbol2sub
(default: c('\.', '-')) vector of symbol to delete in the taxonomy
- ...
Additional arguments passed on to
sankeyNetwork
Value
A sankeyNetwork
plot representing the
taxonomic distribution of OTUs or sequences. If fact
is set,
represent the distribution of the last taxonomic level in the modalities
of fact
Examples
data("GlobalPatterns", package = "phyloseq")
GP <- subset_taxa(GlobalPatterns, GlobalPatterns@tax_table[, 1] == "Archaea")
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘RNeXML’ ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘RNeXML’ ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘RNeXML’ ‘tidytree’
#> Found more than one class "phylo" in cache; using the first, from namespace 'phyloseq'
#> Also defined by ‘RNeXML’ ‘tidytree’
if (requireNamespace("networkD3")) {
sankey_pq(GP, fact = "SampleType")
}
#> Loading required namespace: networkD3
#> Warning: NAs introduced by coercion
# \donttest{
if (requireNamespace("networkD3")) {
sankey_pq(GP, taxa = 1:4, min_prop_tax = 0.01)
sankey_pq(GP, taxa = 1:4, min_prop_tax = 0.01, add_nb_seq = TRUE)
}
# }