Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heatmap normalise_by only works by sample names #168

Open
bernt-matthias opened this issue Jan 23, 2024 · 4 comments
Open

Heatmap normalise_by only works by sample names #168

bernt-matthias opened this issue Jan 23, 2024 · 4 comments

Comments

@bernt-matthias
Copy link
Contributor

According to the docs I can

A variable or a specific sample in the metadata to normalise the counts by.

If I do

amp_heatmap(AalborgWWTPs, normalise=T, normalise_by = 'Plant')

I get: Error: Plant is not found among group names, cannot normalise

I debugged this a bit, and it seems that normalisation is only possible by a sample at the moment.

Note, For me it would be fine to fix the docs.

@KasperSkytte
Copy link
Owner

Hi. It uses the values in the variable supplied to group_by. So fx group by Plant, then supply normalise_by = "Aalborg West" should work. Could adjust docs if it's unclear.

@bernt-matthias
Copy link
Contributor Author

Just tried

> data("AalborgWWTPs")
> amp_heatmap(AalborgWWTPs, normalise=T, normalise_by = "Aalborg West")
Error: Aalborg West is not found among group names, cannot normalise

@KasperSkytte
Copy link
Owner

Like this, but a different error. It's rarely used, but should be a quick fix.

library("ampvis2")
#> Loading required package: ggplot2
amp_heatmap(
  AalborgWWTPs,
  group_by = "Plant",
  tax_aggregate = "Genus",
  normalise_by = "Aalborg West"
)
#> Error in normalise_by %chin% unique(abund7$.Group): table is type 'integer' (must be 'character' or NULL)

Created on 2024-01-23 with reprex v2.1.0

@bernt-matthias
Copy link
Contributor Author

I see. Combining group_by and normalise_by seems to make sense. At least I would have an intuition what happens in the normalisation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants