Arcadia-Science / sourmashconsumr

Working with the outputs of sourmash in R
https://arcadia-science.github.io/sourmashconsumr/
Other
21 stars 3 forks source link

function to produce a sankey plot from sourmash taxonomy output #32

Closed taylorreiter closed 1 year ago

taylorreiter commented 1 year ago

This PR introduces functions to make a sankey plot from one or many sourmash taxonomy annotate output tables. It also does some refactoring to combat repetitive code.

Default:

taxonomy_annotate_df <- read_taxonomy_annotate(Sys.glob("tests/testthat/SRR19*lineage*.csv"), separate_lineage = T)
plot_taxonomy_annotate_sankey(taxonomy_annotate_df = taxonomy_annotate_df, tax_glom_level = "species")

image

Summarized up to a level of taxonomy:

taxonomy_annotate_df <- read_taxonomy_annotate(Sys.glob("tests/testthat/SRR19*lineage*.csv"), separate_lineage = T)
plot_taxonomy_annotate_sankey(taxonomy_annotate_df = taxonomy_annotate_df, tax_glom_level = "order")

image

With a user-specified palette:

taxonomy_annotate_df <- read_taxonomy_annotate(Sys.glob("tests/testthat/SRR19*lineage*.csv"), separate_lineage = T)
plot_taxonomy_annotate_sankey(taxonomy_annotate_df = taxonomy_annotate_df, tax_glom_level = "order", palette = RColorBrewer::brewer.pal(8, "Set3"))

image