0

I load .biom data into R using library phyloseq.

Data2020 <- import_biom("XXX")
mapfile2020 <- import_qiime_sample_data("XXX")
tree <- read_tree("XXX")

mydata <- merge_phyloseq(Data2020, mapfile2020, tree)
colnames(tax_table(mydata)) <- c("Kingdom", "Phylum", "Class", "Order", "Family", "Genus", "Species") 

ps <- mydata 
ps1 <- subset_taxa(ps, Phylum != "NA")

Subset to the data I want.

WRB_data <- subset_samples(ps1, Site=="WRB")

Then Try to Subset by a taxa.

WRB_data2 <- subset_taxa(WRB_data, Phylum=="Acidobacteria")

Always results in this error. Please Help!?

Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent
bathyscapher
  • 1,615
  • 1
  • 13
  • 18
  • 1
    You need to provide a reproducible example. Please, refer to [this](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Francesco Grossetti Feb 19 '21 at 16:01

2 Answers2

0

Hard to verify without data, but it looks like there is no taxa of the phylum Acidobacteria in WRB_data.

bathyscapher
  • 1,615
  • 1
  • 13
  • 18
-1

I faced a similar problem, and overcame it by making sure this part is correctly labeled

(Phylum=="Acidobacteria")
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
taf_
  • 1