microeco icon indicating copy to clipboard operation
microeco copied to clipboard

heatmap x axis label

Open apoosakkannu opened this issue 1 year ago • 1 comments

Hi, I used ASV level abundance heatmap plot. I am getting species name along with ASV lable (below pic). i want to keep only ASV number not species names. Could you pls give me the idea. It use to be like that but now the species name added extra.

show 24 taxa at Genus level

t_all_generalists <- trans_abund$new(dataset = all_generalists_dataset, taxrank = "ASV", ntaxa = 24) figure1e<-t_all_generalists$plot_heatmap(min_abundance = 0.001, facet = "Host_taxa", xtext_keep = FALSE, withmargin = FALSE)

image

apoosakkannu avatar Apr 20 '23 13:04 apoosakkannu

Hi. It could come from the unrecognizable prefix. Two ways are available.

  1. Use tidy the taxonomy to make the tax_table well organized with the prefix by using tidy_taxonomy.
library(microeco)
library(magrittr)
data(dataset)
dataset$add_rownames2taxonomy("ASV")
dataset$tax_table %<>% tidy_taxonomy
dataset$cal_abund()
t1 <- trans_abund$new(dataset = dataset, taxrank = "ASV", ntaxa = 20)
t1$plot_heatmap(xtext_keep = FALSE, withmargin = FALSE)
  1. Another way is to change the default prefix option in trans_abund$new. Setting prefix = "\\|" means the prefix is just |, no other things, i.e. the connector character between taxonomic levels.
library(microeco)
data(dataset)
dataset$add_rownames2taxonomy("ASV")
dataset$cal_abund()
t1 <- trans_abund$new(dataset = dataset, taxrank = "ASV", ntaxa = 20, prefix = "\\|")
t1$plot_heatmap(xtext_keep = FALSE, withmargin = FALSE)

ChiLiubio avatar Apr 21 '23 01:04 ChiLiubio