Qiime2R phyloseq object not recognising controls

When I try to make a phyloseq object with the following code, the phyloseq object seems to only recognise the samples not the negative controls. Does anyone know why this may be happening? I have the names of the controls in my metadata file so they should be coming up.

library("qiime2R")
physeq3<-qza_to_phyloseq(
features="DADA2-table4andneg.qza",
tree="rooted-tree4andneg.qza",
"NCBI_LSURef_97_10_uniq_5-8-300_classification_VSEARCHwithneg.qza",
metadata = "metadata-2.txt")
physeq3

when I import the files separately using read_qza I can see the negative is in there but it is just when I use the qza_to_phyloseq that it does not seem to recognize it as a sample. Is there a way to just read the files in using read_qza then combining these files into a phyloseq object?

Not sure if it is something to do with the names as my samples are called 020221-AT-1 and my controls are called Anya-Neg1.

Thanks

Hello Anya,

When a phyloseq object is created, only the sample names that match are included. So if the sample names are even slightly different between your feature table, tree, and metadata (like Anya-Neg1 vs anya-neg1) they will be dropped silently.

(If your control sample is called both 020221-AT-1 and Anya-Neg1, that would explain it.)

Double check those samples names and let us know if you find any differences. :mag_right:

Hi @colinbrislawn,

Thank you for your reply, I have checked the names in the feature table and the metadata and they are all matching. I am not sure how to check the names in the tree though?

Thanks
Anya

Hi @colinbrislawn, just after I wrote that I realised that there was a space after my negative names in my metadata. Once I removed this space it worked!

Thanks for your help
Anya

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.