david-barnett / microViz

R package for microbiome data visualization and statistics. Uses phyloseq, vegan and the tidyverse. Docker image available.
https://david-barnett.github.io/microViz/
GNU General Public License v3.0
101 stars 11 forks source link

Correlation heat map issue assigning taxonomic rank #130

Closed jspychalla closed 9 months ago

jspychalla commented 11 months ago

Hello,

I set my rank to the genus level using

tax_agg(ps, "Genus") tax_agg(ps, rank = "Genus") and tax_agg(ps, rank = "Genus", force = TRUE)

I then set taxa_filt

taxa_filt <- sample(tax_top(ps, n=20), size=15)

when I use the cor_heatmap() function I get a correlation heat map of genera but one row in the middle is of k__Fungi Kingdom. Is there a way to filter this out?

Thanks so much !

jspychalla commented 11 months ago

PS I do not have this issue if I set rank = "Family" it seems like it is specific to genus

david-barnett commented 11 months ago

If I understand correctly, one of your most abundant genus-level features is fungal, but you don't want to consider fungi in your correlation heatmap

tax_select should help you, search for k__Fungi with deselect = TRUE

jspychalla commented 11 months ago

The dataset I am working with is a fungal dataset. For some reason when I specify rank = Genera, I get a heat map of fungal genera plus a row of kingdom fungi. The kingdom fungi row does not happen when I set the rank = Family. When I do this I get a heat map of fungal families.

Would running tax_select should help you, search for k__Fungi with deselect = TRUE deselect all the fungi from the dataset?

david-barnett commented 11 months ago

The dataset I am working with is a fungal dataset. For some reason when I specify rank = Genera, I get a heat map of fungal genera plus a row of kingdom fungi. The kingdom fungi row does not happen when I set the rank = Family. When I do this I get a heat map of fungal families.

try tax_fix to fill in the missing genus-level classifications, i believe your problem is arising from your use of force = TRUE in tax_agg, but it's unclear without seeing your actual code

Would running tax_select should help you, search for k__Fungi with deselect = TRUE deselect all the fungi from the dataset?

yes

david-barnett commented 9 months ago

assuming this helped? feel free to request to reopen if not