KasperSkytte / ampvis2

Tools for visualising microbial community amplicon data
https://kasperskytte.github.io/ampvis2/
GNU General Public License v3.0
66 stars 23 forks source link

amp_heatmap; add row for the sum of all "Other" #95

Closed macramm closed 4 years ago

macramm commented 4 years ago

Hello,

I am using amp_heatmap to make a heatmap. I would like to add a row at the bottom of the heatmap showing the sum of the relative abundance of everything that is not included in the heat map.

For example,

amp_heatmap(data, tax_aggregate = "Family", tax_show = 20, plot_values = TRUE)

I would like to add a row to the output heatmap that shows the sum of the abundance of all taxonomic groups that are not shown. The label for this row could be called "Other". In other words, I would like to show the abundance of everything not included in the 20 groups that are shown.

Is there a way to do this using amp_heatmap?

KasperSkytte commented 4 years ago

Hi there

There is no way to do that currently, sorry. But certainly would be a nice feature to have. I'll see if I can find a solution in the near future. What would you call the row with the remaining taxa? "other", "remaining taxa", something like that?

macramm commented 4 years ago

Hi. Thanks! Yes. I would call the remaining taxa "Other" or "Remaining taxa" or "Other taxa". Thank you. I appreciate you exploring the possibility of adding this feature.

KasperSkytte commented 4 years ago

I have added the feature in cc516b8344120c0a181eb7e1a56665277bd079f8. This is the result, let me know if it's sufficient.

library(ampvis2)
#> Loading required package: ggplot2
amp_heatmap(
  AalborgWWTPs, 
  group_by = "Plant",
  tax_aggregate = "Genus",
  showRemainingTaxa = TRUE,
  tax_empty = "remove")

Created on 2020-06-12 by the reprex package (v0.3.0)

macramm commented 4 years ago

Hi Kasper,

Thank you very much for adding this feature. After updating ampvis2, I could not get showRemainingTaxa = TRUE to work. I received the following error:

Error in amp_heatmap(d_sed, group_by = "Station", tax_aggregate = "Family", :unused argument (showRemainingTaxa = TRUE)

I must be incorrectly updating the ampvis2 package. I will resolve this though. I looked through your script (cc516b8) and it looked good. Thanks again. I will use this new feature often.

Sincerely,

Margaret


Margaret Cramm, MSc

Research Assistant

Geomicrobiology Group

University of Calgary

EEEL, Room 563

2500 University Drive NW

Calgary, Alberta, T2N 1N4

She/Her/Hers


From: Kasper Skytte Andersen notifications@github.com Sent: Friday, June 12, 2020 5:15 AM To: MadsAlbertsen/ampvis2 ampvis2@noreply.github.com Cc: Margaret Anne Cramm macramm@ucalgary.ca; Author author@noreply.github.com Subject: Re: [MadsAlbertsen/ampvis2] amp_heatmap; add row for the sum of all "Other" (#95)

[△EXTERNAL]

I have added the feature in cc516b8https://github.com/MadsAlbertsen/ampvis2/commit/cc516b8344120c0a181eb7e1a56665277bd079f8. This is the result, let me know if it's sufficient.

library(ampvis2)

> Loading required package: ggplot2

amp_heatmap( AalborgWWTPs, group_by = "Plant", tax_aggregate = "Genus", showRemainingTaxa = TRUE, tax_empty = "remove")

[https://camo.githubusercontent.com/9ec6db2553afeebb434e74ce8151a751646522d8/68747470733a2f2f692e696d6775722e636f6d2f3637573262346b2e706e67]https://camo.githubusercontent.com/9ec6db2553afeebb434e74ce8151a751646522d8/68747470733a2f2f692e696d6775722e636f6d2f3637573262346b2e706e67

Created on 2020-06-12 by the reprex packagehttps://reprex.tidyverse.org (v0.3.0)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/MadsAlbertsen/ampvis2/issues/95#issuecomment-643216723, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOR5GL6FXEW5M5HCWILRSOLRWIE6DANCNFSM4NS6BQ3Q.