This is probably an incredibly simple question but I’m incredibly inexperienced with R and phyloseq! I really want to try out decontam on my data though so decided to have a go.
I used qza_to_phyloseq in qiime2R to import my deblurred feature table, sample metadata (a tab-separated .txt), insertion tree and Greengenes taxonomy file as a phyloseq object in RStudio.
phy <- qza_to_phyloseq("~/Documents/Bam/LongitudinalAnalysis/Decontam/merged-table.qza", "~/Documents/Bam/LongitudinalAnalysis/insertion-tree.qza", "~/Documents/Bam/LongitudinalAnalysis/Decontam/gg_taxonomy.qza", "~/Documents/Bam/LongitudinalAnalysis/Decontam/MergedBam_Mapping_MHD.txt")
Description of ‘phy’:
phyloseq-class experiment-level object otu_table() OTU Table: [ 1987 taxa and 779 samples ] sample_data() Sample Data: [ 779 samples by 45 sample variables ] tax_table() Taxonomy Table: [ 1987 taxa by 7 taxonomic ranks ] phy_tree() Phylogenetic Tree: [ 1987 tips and 1985 internal nodes ]
When I did
head(sample_data(phy)) it looks like none of the metadata category headers are there (i.e. the first line is sample info, not the headers). This was also borne out when I went through subsequent steps in the decontam vignette and tried e.g. plotting the data by library size (the colouring didn’t work as I expected because the category names couldn’t be found).
Did I do something wrong when importing and how can I make sure the category headers are kept?