Skip to contents

Takes lineage strings e.g. 'Bacteria>Escherichia>Escherichia coli' and generates a sunburst plot. Size of each segment in sunburst is based on lineage frequency.

Usage

lineage2sunburst(
  lineage,
  sep = ">",
  return_dataframe = FALSE,
  verbose = FALSE,
  textorientation = c("horizontal", "radial", "tangential"),
  unit = "N"
)

Arguments

lineage

e.g. 'Bacteria>Escherichia>Escherichia coli' (character). Can generate for microbes using taxizedbextra::taxid2lineage()

sep

what character separates each parent-child in lineage strings (string)

return_dataframe

instead of returning plot, return the dataframe used to generate the plot (boolean)

verbose

verbose (boolean)

textorientation

orientation sunburst labels. One of "horizontal", "radial", "tangential" (string)

unit

would does count represent, e.g. 'reads' or 'samples' (string)

Value

sunburst plot (plotly) or inheritance + count dataframe if return_dataframe is TRUE

Examples

if (FALSE) {
taxids = c(rep(562, each =  50), rep(28901, times = 20))

 #Convert NCBI taxids to lineage strings
 lineage_strings = taxizedbextra::taxid2lineage(taxids)
 lineage2sunburst(lineage_strings, sep = ">")

}