joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
569 stars 187 forks source link

Is there a max. number of sample variables (imported as metadata file) that can be included in a phyloseq analysis to create an ordination plot? #1625

Open djdetweiler opened 1 year ago

djdetweiler commented 1 year ago

0

I am trying to create an ordination plot with phyloseq data:

phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 7934 taxa and 45 samples ]
sample_data() Sample Data:       [ 45 samples by 37 sample variables ]
tax_table()   Taxonomy Table:    [ 7934 taxa by 6 taxonomic ranks ]

When I attempt to carry out and plot the ordination (including sample arrows as labelled variables), the ordination does not include all the sample variables. I have 24 sample variables I specify for inclusion, but it seems to "max out" at 14 and will not include any additional variables. Furthermore, it seems to only include the first 14 in the metatable after trying different metatables with random combinations of variables.

Here is the current code:

cap_ord <- ordinate(
  physeq = saltmarsh_not_na, 
  method = "CAP",
  distance = bray_not_na,
  formula = ~ percent_water + BD + percent_OM + C + N + C_N + salinity + temp + pH + dic + doc_uM + nox + nh4 + po4 + don + doc_don + h2s + suva + a440 + E2_E3 + SR + protein_like + terrestrial_humic_like + m
)

cap_ord <- ordinate(
  physeq = saltmarsh_not_na, 
  method = "CAP",
  distance = bray_not_na,
  formula = ~ percent_water + BD + percent_OM + C + N + C_N + salinity + temp + pH + dic + doc_uM + nox + nh4 + po4 + don + doc_don + h2s + suva + a440 + E2_E3 + SR + protein_like + terrestrial_humic_like + m
)

arrowmat <- vegan::scores(cap_ord, display = "bp")

I do not include code for the plots since the issue is with the data itself.

Is there simply a maximum number of sample variables that phyloseq can handle with ordination plots?

Any insight is appreciated.